├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .storybook
├── main.js
├── manager-head.html
├── manager.js
├── preview.js
└── theme.js
├── FUNDING.yml
├── LICENSE
├── README.md
├── docs
├── Avatar.html
├── Button.html
├── Checkbox.html
├── Container.html
├── FileNotFound.html
├── Footer.html
├── Input.html
├── Loader.AtomicSpinner.html
├── Loader.BouncySpinner.html
├── Loader.DefaultSpinner.html
├── Loader.html
├── Navbar.html
├── Notice.html
├── Pagination.html
├── RadioButton.html
├── Select.html
├── Switch.html
├── ToTop.html
├── asset-manifest.json
├── avatar_Avatar.js.html
├── button_Button.js.html
├── checkbox_Checkbox.js.html
├── components_avatar_Avatar.js.html
├── components_button_Button.js.html
├── components_checkbox_Checkbox.js.html
├── components_container_Container.js.html
├── components_footer_Footer.js.html
├── components_input_Input.js.html
├── components_loader_Loader.js.html
├── components_loader_atomic_AtomicSpinner.js.html
├── components_loader_bouncy_BouncySpinner.js.html
├── components_loader_default_DefaultSpinner.js.html
├── components_navbar_Navbar.js.html
├── components_notice_Notice.js.html
├── components_pages_404_FileNotFound.js.html
├── components_pagination_PaginationList.js.html
├── components_radiobutton_RadioButton.js.html
├── components_select_Select.js.html
├── components_switch_Switch.js.html
├── components_totop_ToTop.js.html
├── container_Container.js.html
├── favicon.ico
├── footer_Footer.js.html
├── global.html
├── iframe.html
├── index.html
├── input_Input.js.html
├── main.2132ca66e14e6488e138.bundle.js
├── main.2132ca66e14e6488e138.bundle.js.map
├── main.a3b61ef3ae532b46eec8.bundle.js
├── navbar_Navbar.js.html
├── notice_Notice.js.html
├── pages_404_FileNotFound.js.html
├── pagination_PaginationList.js.html
├── precache-manifest.78a94f64a776d73fa5e794c9294eb057.js
├── radiobutton_RadioButton.js.html
├── runtime~main.2132ca66e14e6488e138.bundle.js
├── runtime~main.2132ca66e14e6488e138.bundle.js.map
├── runtime~main.870e8ee0658e83d05c6b.bundle.js
├── sb_dll
│ ├── storybook_docs-manifest.json
│ ├── storybook_docs_dll.js
│ ├── storybook_ui-manifest.json
│ └── storybook_ui_dll.js
├── scripts
│ ├── custom.js
│ ├── linenumber.js
│ ├── prettify
│ │ ├── Apache-License-2.0.txt
│ │ ├── lang-css.js
│ │ └── prettify.js
│ ├── search.js
│ └── utils.min.js
├── select_Select.js.html
├── service-worker.js
├── static
│ └── css
│ │ ├── main.35bae824.chunk.css
│ │ └── main.35bae824.chunk.css.map
├── styles
│ ├── custom.css
│ ├── daybrush.css
│ ├── jsdoc.css
│ └── prettify.css
├── switch_Switch.js.html
├── totop_ToTop.js.html
├── utilities_setClassName.js.html
├── vendors~main.2132ca66e14e6488e138.bundle.js
├── vendors~main.2132ca66e14e6488e138.bundle.js.LICENSE.txt
├── vendors~main.2132ca66e14e6488e138.bundle.js.map
├── vendors~main.b3728e18857e2df6c710.bundle.js
└── vendors~main.b3728e18857e2df6c710.bundle.js.LICENSE.txt
├── jakelib
├── tasks.jake
└── tasks
│ ├── build.js
│ ├── clean.js
│ └── start.js
├── jsdoc.json
├── jsdoc
├── LICENSE.md
├── fixtures
│ ├── base
│ │ ├── chains.js
│ │ └── index.js
│ ├── documents
│ │ ├── binder.js
│ │ ├── collector.js
│ │ ├── model.js
│ │ ├── probe.js
│ │ └── schema.js
│ ├── fixtures.conf.json
│ ├── mixins
│ │ ├── bussable.js
│ │ └── signalable.js
│ ├── strings
│ │ └── format.js
│ ├── tutorials
│ │ ├── Brush Teeth.md
│ │ ├── Drive Car.md
│ │ └── Fence Test.md
│ └── utils
│ │ └── logger.js
├── package.json
├── publish.js
├── static
│ ├── scripts
│ │ ├── custom.js
│ │ ├── linenumber.js
│ │ ├── prettify
│ │ │ ├── Apache-License-2.0.txt
│ │ │ ├── lang-css.js
│ │ │ └── prettify.js
│ │ ├── search.js
│ │ └── utils.min.js
│ └── styles
│ │ ├── custom.css
│ │ ├── daybrush.css
│ │ ├── jsdoc.css
│ │ └── prettify.css
└── tmpl
│ ├── augments.tmpl
│ ├── container.tmpl
│ ├── details.tmpl
│ ├── example.tmpl
│ ├── examples.tmpl
│ ├── exceptions.tmpl
│ ├── layout.tmpl
│ ├── mainpage.tmpl
│ ├── members.tmpl
│ ├── method.tmpl
│ ├── params.tmpl
│ ├── properties.tmpl
│ ├── returns.tmpl
│ ├── source.tmpl
│ ├── tutorial.tmpl
│ └── type.tmpl
├── package.json
├── rollup.config.js
├── src
├── assets
│ ├── icons
│ │ ├── ArrowLeftAltIcon.js
│ │ ├── ArrowLeftIcon.js
│ │ ├── ArrowUpAltIcon.js
│ │ ├── ArrowUpIcon.js
│ │ ├── CheckAltIcon.js
│ │ ├── CheckIcon.js
│ │ ├── ChevronDownAltIcon.js
│ │ ├── ChevronDownIcon.js
│ │ ├── ChevronLeftAltIcon.js
│ │ ├── ChevronLeftIcon.js
│ │ ├── ChevronRightAltIcon.js
│ │ ├── ChevronRightIcon.js
│ │ ├── ChevronUpAltIcon.js
│ │ ├── ChevronUpIcon.js
│ │ ├── CloseAltIcon.js
│ │ ├── CloseIcon.js
│ │ ├── MenuAltIcon.js
│ │ └── MenuIcon.js
│ ├── images
│ │ └── default-logo.png
│ └── scss
│ │ ├── custom-properties.scss
│ │ ├── fonts.scss
│ │ ├── functions.scss
│ │ ├── mixins.scss
│ │ ├── styles.module.scss
│ │ ├── type-scale.scss
│ │ └── variables.scss
├── components
│ ├── avatar
│ │ ├── Avatar.js
│ │ └── Avatar.scss
│ ├── button
│ │ ├── Button.js
│ │ └── Button.scss
│ ├── checkbox
│ │ ├── Checkbox.js
│ │ └── Checkbox.scss
│ ├── container
│ │ ├── Container.js
│ │ └── Container.scss
│ ├── footer
│ │ ├── Footer.js
│ │ └── Footer.scss
│ ├── input
│ │ ├── Input.js
│ │ └── Input.scss
│ ├── loader
│ │ ├── Loader.js
│ │ ├── Loader.scss
│ │ ├── atomic
│ │ │ ├── AtomicSpinner.js
│ │ │ └── AtomicSpinner.module.scss
│ │ ├── bouncy
│ │ │ ├── BouncySpinner.js
│ │ │ └── BouncySpinner.module.scss
│ │ └── default
│ │ │ ├── DefaultSpinner.js
│ │ │ └── DefaultSpinner.module.scss
│ ├── navbar
│ │ ├── Navbar.js
│ │ └── Navbar.scss
│ ├── notice
│ │ ├── Notice.js
│ │ └── Notice.scss
│ ├── pages
│ │ └── 404
│ │ │ ├── FileNotFound.js
│ │ │ └── FileNotFound.scss
│ ├── pagination
│ │ ├── PaginationList.js
│ │ └── PaginationList.scss
│ ├── radiobutton
│ │ ├── RadioButton.js
│ │ └── RadioButton.scss
│ ├── select
│ │ ├── Select.js
│ │ └── Select.scss
│ ├── switch
│ │ ├── Switch.js
│ │ └── Switch.scss
│ └── totop
│ │ ├── ToTop.js
│ │ └── ToTop.scss
├── stories
│ ├── 0-Welcome.stories.js
│ ├── Avatar.stories.js
│ ├── Button.stories.js
│ ├── Checkbox.stories.js
│ ├── Container.stories.js
│ ├── Footer.stories.js
│ ├── Input.stories.js
│ ├── Loader.stories.js
│ ├── Navbar.mobile.stories.js
│ ├── Navbar.stories.js
│ ├── Notice.stories.js
│ ├── Pages.stories.js
│ ├── Pagination.stories.js
│ ├── Radio.stories.js
│ ├── Select.stories.js
│ ├── Switch.stories.js
│ └── ToTop.stories.js
└── utilities
│ └── setClassName.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "@babel/preset-env",
4 | "@babel/react",
5 | ["minify", {
6 | "builtIns": false
7 | }]
8 | ],
9 | "plugins": [
10 | "@babel/plugin-proposal-async-generator-functions",
11 | "@babel/plugin-proposal-class-properties",
12 | "@babel/plugin-proposal-object-rest-spread",
13 | "@babel/plugin-transform-arrow-functions",
14 | "@babel/plugin-transform-async-to-generator",
15 | "@babel/plugin-transform-classes",
16 | "@babel/plugin-transform-computed-properties",
17 | "@babel/plugin-transform-destructuring",
18 | "@babel/plugin-transform-for-of",
19 | "@babel/plugin-transform-parameters",
20 | "@babel/plugin-transform-shorthand-properties",
21 | "@babel/plugin-transform-spread",
22 | "@babel/plugin-transform-sticky-regex",
23 | "@babel/plugin-transform-template-literals"
24 | ]
25 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = false
9 | trim_trailing_whitespace = true
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | build/
2 | dist/
3 | node_modules/
4 | stories/
5 | .snapshots/
6 | *.min.js
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es6: true,
5 | mocha: true
6 | },
7 | extends: ['plugin:react/recommended', 'airbnb'],
8 | globals: {
9 | Atomics: 'readonly',
10 | SharedArrayBuffer: 'readonly'
11 | },
12 | parser: 'babel-eslint',
13 | parserOptions: {
14 | ecmaFeatures: {
15 | jsx: true
16 | },
17 | ecmaVersion: 12,
18 | sourceType: 'module'
19 | },
20 | plugins: ['react'],
21 | rules: {
22 | 'array-bracket-spacing': [0],
23 | 'arrow-body-style': [0],
24 | 'arrow-parens': ['warn'],
25 | 'brace-style': [0],
26 | 'comma-dangle': ['warn', 'never'],
27 | 'consistent-return': [0],
28 | 'eol-last': [0],
29 | 'func-names': ['warn', 'always', {
30 | generators: 'as-needed'
31 | }],
32 | 'global-require': ['warn'],
33 | 'implicit-arrow-linebreak': [0],
34 | 'import/no-dynamic-require': ['warn'],
35 | 'import/no-extraneous-dependencies': [0],
36 | 'import/order': ['warn'],
37 | 'import/prefer-default-export': [0],
38 | 'indent': ['warn', 2, {
39 | SwitchCase: 1
40 | }],
41 | 'jsx-a11y/anchor-is-valid': ['warn'],
42 | 'jsx-a11y/click-events-have-key-events': [0],
43 | 'jsx-a11y/interactive-supports-focus': [0],
44 | 'jsx-a11y/label-has-associated-control': [0],
45 | 'jsx-a11y/no-noninteractive-element-interactions': [0],
46 | 'keyword-spacing': ['warn'],
47 | 'linebreak-style': [0],
48 | 'max-len': ['warn'],
49 | 'no-console': ['warn', {
50 | allow: ['warn', 'error']
51 | }],
52 | 'no-nested-ternary': [0],
53 | 'no-param-reassign': [0],
54 | 'no-mixed-spaces-and-tabs': ['warn'],
55 | 'no-multi-spaces': ['warn'],
56 | 'no-multiple-empty-lines': [0],
57 | 'no-restricted-syntax': [0],
58 | 'no-tabs': ['warn'],
59 | 'no-trailing-spaces': ['warn'],
60 | 'no-unneeded-ternary': ['warn'],
61 | 'no-underscore-dangle': ['warn'],
62 | 'no-unused-vars': ['warn'],
63 | 'no-use-before-define': ['error', {
64 | 'functions': false
65 | }],
66 | 'object-curly-newline': [0],
67 | 'object-curly-spacing': ['warn'],
68 | 'object-shorthand': ['warn', 'always'],
69 | 'one-var': ['warn', {
70 | 'initialized': 'never'
71 | }],
72 | 'one-var-declaration-per-line': ['warn', 'initializations'],
73 | 'operator-linebreak': ['warn'],
74 | 'padded-blocks': [0],
75 | 'prefer-arrow-callback': ['warn'],
76 | 'prefer-const': ['warn'],
77 | 'prefer-destructuring': [
78 | 'warn',
79 | {
80 | array: true,
81 | object: true
82 | },
83 | {
84 | enforceForRenamedProperties: false
85 | }
86 | ],
87 | 'prefer-template': ['warn'],
88 | 'quotes': ['warn'],
89 | 'quote-props': ['warn', 'consistent'],
90 | 'rest-spread-spacing': ['warn', 'never'],
91 | 'semi': ['warn'],
92 | 'spaced-comment': ['warn'],
93 | 'space-before-function-paren': ['warn'],
94 | 'react/destructuring-assignment': [0],
95 | 'react/forbid-prop-types': [0],
96 | 'react/jsx-closing-bracket-location': ['warn'],
97 | 'react/jsx-curly-newline': ['warn'],
98 | 'react/jsx-curly-spacing': ['warn', 'always'],
99 | 'react/jsx-filename-extension': [0],
100 | 'react/jsx-fragments': [0],
101 | 'react/jsx-indent': ['warn', 2],
102 | 'react/jsx-equals-spacing': ['warn'],
103 | 'react/jsx-one-expression-per-line': ['warn'],
104 | 'react/jsx-props-no-spreading': [0],
105 | 'react/jsx-tag-spacing': ['warn'],
106 | 'react/jsx-wrap-multilines': ['warn'],
107 | 'react/no-access-state-in-setstate': [0],
108 | 'react/no-array-index-key': [0],
109 | 'react/no-unused-state': ['warn'],
110 | 'react/prop-types': ['warn'],
111 | 'react/prefer-stateless-function': ['warn'],
112 | 'react/require-default-props': ['warn'],
113 | 'react/sort-comp': [0],
114 | 'react/state-in-constructor': ['warn', 'never']
115 | },
116 | settings: {
117 | 'import/resolver': {
118 | node: {
119 | paths: ['./', 'src']
120 | }
121 | }
122 | }
123 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # builds
4 | .rpt2_cache
5 | build
6 | dist
7 | storybook-static
8 |
9 | # dependencies
10 | node_modules
11 |
12 | # debug
13 | npm-debug.log*
14 | yarn-debug.log*
15 | yarn-error.log*
16 |
17 | # misc
18 | .DS_Store
19 | .env
20 | .env.local
21 | .env.development.local
22 | .env.test.local
23 | .env.production.local
24 | .idea/
25 | .vscode/
26 | .yarn/
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const src = path.resolve(__dirname, '../src');
3 |
4 | // Webpack config
5 | const webpack = config => {
6 | return {
7 | ...config,
8 | resolve: {
9 | ...config.resolve,
10 | modules: [ ...config.resolve.modules, src ],
11 | alias: { ...config.resolve.alias, src }
12 | },
13 |
14 | // Limit console "noise"
15 | performance: { hints: false }
16 | }
17 | };
18 |
19 |
20 | module.exports = {
21 | stories: ['../src/**/*.stories.js'],
22 | addons: [
23 | '@storybook/addon-actions',
24 | '@storybook/addon-links',
25 | '@storybook/addon-viewport/register',
26 | '@storybook/preset-create-react-app'
27 | ],
28 |
29 | // Webpack for Storybook "manager"
30 | managerWebpack: config => webpack(config),
31 |
32 | // Webpack for Storybook "stories"
33 | webpackFinal: config => webpack(config)
34 | };
--------------------------------------------------------------------------------
/.storybook/manager-head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Default Storybook
5 |
6 |
7 |
19 |
20 |
--------------------------------------------------------------------------------
/.storybook/manager.js:
--------------------------------------------------------------------------------
1 | import { addons } from '@storybook/addons';
2 | import theme from './theme';
3 |
4 | addons.setConfig({ theme });
--------------------------------------------------------------------------------
/.storybook/preview.js:
--------------------------------------------------------------------------------
1 | import { addParameters } from '@storybook/client-api';
2 | import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
3 |
4 | addParameters({
5 | viewport: {
6 | viewports: INITIAL_VIEWPORTS,
7 | },
8 | });
--------------------------------------------------------------------------------
/.storybook/theme.js:
--------------------------------------------------------------------------------
1 | import { create } from '@storybook/theming/create';
2 |
3 | export default create({
4 | base: 'light',
5 |
6 | // Main colors
7 | colorPrimary: '#57a9a9',
8 | colorSecondary: '#773d3d',
9 |
10 | // UI
11 | appBg: '#f5f5f5',
12 | appContentBg: '#f5f5f5',
13 | appBorderColor: '#773d3d',
14 | appBorderRadius: 4,
15 |
16 | // Typography
17 | fontBase: 'Nova Flat',
18 | fontCode: 'monospace',
19 | mainTextSize: 16,
20 |
21 | // Text colors
22 | textColor: '#050505',
23 | textInverseColor: '#f5f5f5',
24 |
25 | // Toolbar colors
26 | barTextColor: '#773d3d',
27 | barSelectedColor: '#773d3d',
28 | barBg: '#e0e0e0',
29 |
30 | // Brand
31 | brandTitle: 'Default Component Library',
32 | brandUrl: 'https://github.com/default-services/components#readme',
33 | brandImage: 'https://avatars3.githubusercontent.com/u/65836493?s=132'
34 | });
--------------------------------------------------------------------------------
/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # repo: your_github_handle/.github
2 | # filename: FUNDING.YML
3 |
4 | github: iPzard
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Daniel W.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Default Component Library
2 |
3 | [](https://www.npmjs.com/package/@default-services/components)
4 | [](https://github.com/default-services/components#readme)
5 | [](https://github.com/default-services/components/blob/master/LICENSE)
6 |
7 | > Open-source and npm-published React component library.
8 |
9 |
10 | ## 🐱🏍 Install
11 |
12 | **npm:**
13 | ```bash
14 | npm install @default-services/components
15 | ```
16 | **yarn:**
17 | ```bash
18 | yarn add @default-services/components
19 | ```
20 |
21 |
22 | ## 🐱💻 Use
23 | ```jsx
24 | import React from 'react';
25 | import { Button } from '@default-services/components';
26 |
27 | const MyComponent = (props) => {
28 | return (
29 |
30 | Hello Default!
31 |
32 | );
33 | };
34 | ```
35 |
36 |
37 | ## 🐱👓 Docs
38 | Learn more about using the Default component library for your project: [Default documentation](https://default.services)
39 |
40 |
41 | ## 🐱🐉 Support
42 | Default component library utilizes technologies such as Babel and PostCSS to ensure all code is cross-browser compatible, and supports **at least** the following browsers:
43 | | [ ](http://godban.github.io/browsers-support-badges/) IE / Edge | [ ](http://godban.github.io/browsers-support-badges/) Firefox | [ ](http://godban.github.io/browsers-support-badges/) Chrome | [ ](http://godban.github.io/browsers-support-badges/) Safari | [ ](http://godban.github.io/browsers-support-badges/) iOS Safari | [ ](http://godban.github.io/browsers-support-badges/) Samsung | [ ](http://godban.github.io/browsers-support-badges/) Opera |
44 | | --------- | --------- | --------- | --------- | --------- | --------- | --------- |
45 | | IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions
46 |
47 |
48 | ## 🐱👤 Develop
49 | Code documentation for this project, created with [JSDoc](https://github.com/jsdoc/jsdoc), can be found here:
50 | [Default component library](https://default-services.github.io/components)
51 |
52 | For Default contribution guidelines, see: [Contributing to Default](https://github.com/default-services/components/wiki/Contributing-to-Default)
53 |
54 |
55 | ## 🦟 Bugs
56 | Bugs reported on the project's [issues page](https://github.com/default-services/components/issues) will be exterminated as quickly as possible, be sure to include steps to reproduce so they can be spotted easily.
57 |
58 |
59 | ## 🏷️ License
60 |
61 | MIT © [Default](https://github.com/default-services/components/blob/master/LICENSE)
--------------------------------------------------------------------------------
/docs/asset-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": {
3 | "main.css": "./static/css/main.35bae824.chunk.css",
4 | "main.js": "./main.2132ca66e14e6488e138.bundle.js",
5 | "main.css.map": "./static/css/main.35bae824.chunk.css.map",
6 | "main.js.map": "./main.2132ca66e14e6488e138.bundle.js.map",
7 | "runtime~main.js": "./runtime~main.2132ca66e14e6488e138.bundle.js",
8 | "runtime~main.js.map": "./runtime~main.2132ca66e14e6488e138.bundle.js.map",
9 | "vendors~main.js": "./vendors~main.2132ca66e14e6488e138.bundle.js",
10 | "vendors~main.js.map": "./vendors~main.2132ca66e14e6488e138.bundle.js.map",
11 | "iframe.html": "./iframe.html",
12 | "precache-manifest.78a94f64a776d73fa5e794c9294eb057.js": "./precache-manifest.78a94f64a776d73fa5e794c9294eb057.js",
13 | "service-worker.js": "./service-worker.js",
14 | "vendors~main.2132ca66e14e6488e138.bundle.js.LICENSE.txt": "./vendors~main.2132ca66e14e6488e138.bundle.js.LICENSE.txt"
15 | },
16 | "entrypoints": [
17 | "runtime~main.2132ca66e14e6488e138.bundle.js",
18 | "vendors~main.2132ca66e14e6488e138.bundle.js",
19 | "static/css/main.35bae824.chunk.css",
20 | "main.2132ca66e14e6488e138.bundle.js"
21 | ]
22 | }
--------------------------------------------------------------------------------
/docs/avatar_Avatar.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | avatar/Avatar.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
avatar/Avatar.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import PropTypes from 'prop-types';
46 | import React from 'react';
47 | import setClassName from 'utilities/setClassName';
48 |
49 | /**
50 | * @namespace Avatar
51 | * @description Avatar component. For example, to be represent a user.
52 | * @property {string} variant - Variant of avatar to use (e.g., "large", "medium", or "small").
53 | * @property {children} - Image to use as avatar.
54 | * @tutorial `src\stories\Avatar.stories.js`.
55 | */
56 |
57 | export const Avatar = (props) => {
58 | const {
59 | children,
60 | ...componentProps
61 | } = props;
62 |
63 | return (
64 | <article { ...componentProps } className={ setClassName(props, 'avatar') }>
65 | { children }
66 | </article>
67 | );
68 | };
69 |
70 | Avatar.propTypes = {
71 | children: PropTypes.node.isRequired
72 | };
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/docs/button_Button.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | button/Button.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
button/Button.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import PropTypes from 'prop-types';
46 | import React from 'react';
47 | import setClassName from 'utilities/setClassName';
48 |
49 | /**
50 | * @namespace Button
51 | * @description Default styled button component.
52 | * @property {string} variant - Variant of button to use (e.g., "round").
53 | * @property {children} - Child elements to nest in button.
54 | * @tutorial `src\stories\Button.stories.js`.
55 | */
56 |
57 | export const Button = (props) => {
58 | const {
59 | children,
60 | ...componentProps
61 | } = props;
62 |
63 | return (
64 | <a { ...componentProps } className={ setClassName(props, 'button') } role='button'>
65 | { children }
66 | </a>
67 | );
68 | };
69 |
70 | Button.propTypes = {
71 | variant: PropTypes.string
72 | };
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/docs/container_Container.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | container/Container.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
container/Container.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import React from 'react';
46 | import setClassName from 'utilities/setClassName';
47 |
48 | // import PropTypes from 'prop-types';
49 |
50 |
51 | /**
52 | * @namespace Container
53 | * @description Default styled container component.
54 | * @tutorial `src\stories\Container.stories.js`.
55 | */
56 |
57 | export const Container = props => {
58 |
59 | const {
60 | children,
61 | ...componentProps
62 | } = props;
63 |
64 | return (
65 | <section { ...componentProps } className={ setClassName(props, 'container') }>
66 | { children }
67 | </section>
68 | );
69 | };
70 |
71 | // Container.propTypes = { };
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/default-services/components/a87e6a0e4441d7e93993c063102cd379a27728d3/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/footer_Footer.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | footer/Footer.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
footer/Footer.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import React from 'react';
46 | import setClassName from 'utilities/setClassName';
47 |
48 | // import PropTypes from 'prop-types';
49 |
50 |
51 | /**
52 | * @namespace Footer
53 | * @description Default styled footer component.
54 | * @tutorial `src\stories\Footer.stories.js`.
55 | */
56 |
57 | export const Footer = props => {
58 | const {
59 | children,
60 | ...componentProps
61 | } = props;
62 |
63 | return (
64 | <footer { ...componentProps } className={ setClassName(props, 'footer') }>
65 | { children }
66 | </footer>
67 | );
68 | };
69 |
70 | // Footer.propTypes = { };
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/docs/iframe.html:
--------------------------------------------------------------------------------
1 | Storybook No Preview Sorry, but you either have no stories or none are selected somehow.
Please check the Storybook config. Try reloading the page. If the problem persists, check the browser console, or the terminal you've run Storybook from.
--------------------------------------------------------------------------------
/docs/input_Input.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | input/Input.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
input/Input.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import PropTypes from 'prop-types';
46 | import React from 'react';
47 | import setClassName from 'utilities/setClassName';
48 |
49 | /**
50 | * @namespace Input
51 | * @description Default styled input component.
52 | * @property {string} type - If provided, is discarded and replaced with "text".
53 | * @tutorial `src\stories\Input.stories.js`.
54 | */
55 |
56 | export const Input = props => {
57 | const {
58 | className,
59 | type,
60 | ...inputProps
61 | } = props;
62 |
63 | // Error for invalid `type` props
64 | const error = component => console.error(`Type "${type}" used for the \`Input\` component, use the \`${component}\` component instead.`);
65 |
66 | switch(type) {
67 | case 'radio':
68 | return error('RadioButton');
69 |
70 | case 'checkbox':
71 | return error('Checkbox');
72 |
73 | // Else if valid
74 | default:
75 | return (
76 | <label className={ setClassName(props, 'input') }>
77 | <input { ...inputProps } type='text' />
78 | </label>
79 | );
80 | };
81 | };
82 |
83 |
84 | Input.propTypes = {
85 | type: PropTypes.string
86 | };
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/docs/main.2132ca66e14e6488e138.bundle.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"main.2132ca66e14e6488e138.bundle.js","sources":["webpack:///main.2132ca66e14e6488e138.bundle.js"],"mappings":"AAAA","sourceRoot":""}
--------------------------------------------------------------------------------
/docs/precache-manifest.78a94f64a776d73fa5e794c9294eb057.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = (self.__precacheManifest || []).concat([
2 | {
3 | "revision": "48513cc99ff100434cdec9274d9f8831",
4 | "url": "iframe.html"
5 | },
6 | {
7 | "url": "main.2132ca66e14e6488e138.bundle.js"
8 | },
9 | {
10 | "url": "runtime~main.2132ca66e14e6488e138.bundle.js"
11 | },
12 | {
13 | "revision": "d3efaa6cff58de865b1a",
14 | "url": "static/css/main.35bae824.chunk.css"
15 | },
16 | {
17 | "url": "vendors~main.2132ca66e14e6488e138.bundle.js"
18 | },
19 | {
20 | "url": "vendors~main.2132ca66e14e6488e138.bundle.js.LICENSE.txt"
21 | }
22 | ]);
--------------------------------------------------------------------------------
/docs/runtime~main.2132ca66e14e6488e138.bundle.js:
--------------------------------------------------------------------------------
1 | !function(modules){function webpackJsonpCallback(data){for(var moduleId,chunkId,chunkIds=data[0],moreModules=data[1],executeModules=data[2],i=0,resolves=[];i)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/docs/scripts/search.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | var nav = document.querySelector("nav");
4 | var searchBar = nav.querySelector(".search");
5 | var input = searchBar.querySelector("input");
6 | // var submit = searchBar.querySelector("button");
7 | var groups = Array.prototype.slice.call(document.querySelectorAll("nav>ul .parent")).map(function (group) {
8 | var items = Array.prototype.slice.call(group.querySelectorAll("a"));
9 | var strings = items.map(function (a) {
10 | return a.innerText.toLowerCase();
11 | });
12 |
13 | return {el: group, items: items, strings, strings};
14 | });
15 | input.addEventListener("keyup", function (e) {
16 | var value = input.value.toLowerCase();
17 |
18 | if (value) {
19 | utils.addClass(nav, "searching");
20 | } else {
21 | utils.removeClass(nav, "searching");
22 | return;
23 | }
24 | groups.forEach(function (group) {
25 | var isSearch = false;
26 | var items = group.items;
27 |
28 | group.strings.forEach(function (v, i) {
29 | var item = items[i];
30 | if (utils.hasClass(item.parentNode, "parent")) {
31 | item = item.parentNode;
32 | }
33 | if (v.indexOf(value) > -1) {
34 | utils.addClass(item, "targeting");
35 | isSearch = true;
36 | } else {
37 | utils.removeClass(item, "targeting");
38 | }
39 | });
40 | if (isSearch) {
41 | utils.addClass(group.el, "module-targeting");
42 | } else {
43 | utils.removeClass(group.el, "module-targeting");
44 | }
45 | });
46 | });
47 | })();
--------------------------------------------------------------------------------
/docs/scripts/utils.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2018 Daybrush
3 | @name: @daybrush/utils
4 | license: MIT
5 | author: Daybrush
6 | repository: https://github.com/daybrush/utils
7 | @version 0.4.0
8 | */
9 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.utils=t()}(this,function(){"use strict";var u="rgb",c="rgba",f="hsl",l="hsla",e=[u,c,f,l],t="function",n="object",r="string",i="undefined",a=typeof window!==i,o=["webkit","ms","moz","o"],s=function(e){if(typeof document===i)return"";var t=(document.body||document.documentElement).style,n=o.length;if(typeof t[e]!==i)return e;for(var r=0;r {
21 | if (event.data && event.data.type === 'SKIP_WAITING') {
22 | self.skipWaiting();
23 | }
24 | });
25 |
26 | workbox.core.clientsClaim();
27 |
28 | /**
29 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to
30 | * requests for URLs in the manifest.
31 | * See https://goo.gl/S9QRab
32 | */
33 | self.__precacheManifest = [].concat(self.__precacheManifest || []);
34 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
35 |
36 | workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), {
37 |
38 | blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
39 | });
40 |
--------------------------------------------------------------------------------
/docs/static/css/main.35bae824.chunk.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"static/css/main.35bae824.chunk.css","sources":["webpack:///fonts.scss"],"sourcesContent":["@font-face {\r\n font-family: 'Nova Flat';\r\n font-style: normal;\r\n font-weight: 400;\r\n font-display: swap;\r\n src: local('Nova Flat'), local('NovaFlat'), url(https://fonts.gstatic.com/s/novaflat/v11/QdVUSTc-JgqpytEbVeb0viFl.woff2) format('woff2');\r\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\r\n}\r\n\r\n@font-face {\r\n font-family: 'Roboto';\r\n font-style: normal;\r\n font-weight: 400;\r\n font-display: swap;\r\n src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');\r\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\r\n}\r\n"],"mappings":"AAAA;;","sourceRoot":""}
--------------------------------------------------------------------------------
/docs/styles/custom.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/default-services/components/a87e6a0e4441d7e93993c063102cd379a27728d3/docs/styles/custom.css
--------------------------------------------------------------------------------
/docs/styles/daybrush.css:
--------------------------------------------------------------------------------
1 | .readme table {
2 | border-spacing: 0;
3 | border-collapse: collapse;
4 | }
5 | .readme * {
6 | box-sizing: border-box;
7 | }
8 | .readme table th, .readme table td {
9 | padding: 6px 13px;
10 | border: 1px solid #ddd;
11 | }
12 |
13 | nav>ul>li:after {
14 | content: "";
15 | position: absolute;
16 | right: 10px;
17 | top: 0;
18 | bottom: 0;
19 | width: 0;
20 | height: 0;
21 | margin: auto 0px;
22 | border-top: 7px solid #ccc;
23 | border-left: 6px solid transparent;
24 | border-right: 6px solid transparent;
25 | }
26 | nav li h4, nav li ul {
27 | display: none;
28 | }
29 |
30 | .name.typescript {
31 | background: #374E79;
32 | font-size: 14px;
33 | }
34 | .name.typescript .signature {
35 | color: #21de60;
36 | }
37 | .ts-params.typescript table .last {
38 | display: none;
39 | }
40 | table.params th, table.params tr td , table.params tr td.type{
41 | word-break: break-word;
42 | white-space: normal;
43 | }
44 |
45 | nav .search {
46 | position: relative;
47 | margin: 0px 10px;
48 | border: 3px solid #333;
49 | height: 43px;
50 | }
51 | nav .search .input-area {
52 | position: absolute;
53 | left: 0;
54 | top: 0;
55 | right: 35px;
56 | height: 35px;
57 | }
58 | nav .search input {
59 | position: relative;
60 | width: 100%;
61 | height: 100%;
62 | border: 0;
63 | padding: 0;
64 | text-indent: 10px;
65 | font-weight: bold;
66 | font-size: 14px;
67 | outline: none;
68 | }
69 | nav .search button {
70 | position: absolute;
71 | top: 0;
72 | right: 0px;
73 | width: 35px;
74 | height: 35px;
75 | border: 0;
76 | padding: 0;
77 | outline: none;
78 | cursor: pointer;
79 | }
80 | nav .search button:before {
81 | position: absolute;
82 | content: "";
83 | width: 18px;
84 | height: 18px;
85 | top: 7px;
86 | left: 7px;
87 | border: 3px solid #333;
88 | border-radius: 50%;
89 | box-sizing: border-box;
90 | }
91 | nav .search button:after {
92 | position: absolute;
93 | content: "";
94 | width: 3px;
95 | height: 11px;
96 | top: 21px;
97 | left: 18px;
98 | background: #333;
99 | transform-origin: 50% 0%;
100 | -ms-transform-origin: 50% 0%;
101 | -webkit-transform-origin: 50% 0%;
102 | transform: rotate(-45deg);
103 | -ms-transform: rotate(-45deg);
104 | -webkit-transform: rotate(-45deg);
105 | }
106 |
107 | nav.searching li:after {
108 | display: none!important;
109 | }
110 | nav.searching li h4, nav.searching li ul {
111 | display: block!important;
112 | }
113 |
114 | nav.searching .parent {
115 | display: none;
116 | }
117 | nav.searching .parent ul li a {
118 | display: none;
119 | }
120 |
121 | nav.searching .parent.module-targeting {
122 | display: block;
123 | }
124 | nav.searching .parent.module-targeting ul li a {
125 | display: none;
126 | }
127 | nav.searching .parent.module-targeting ul li a.targeting {
128 | display: block;
129 | }
130 | nav.searching .parent.targeting ul li a {
131 | display: block;
132 | }
133 |
134 | nav>h2.custom>a {
135 | margin:12px 10px;
136 | }
--------------------------------------------------------------------------------
/docs/styles/prettify.css:
--------------------------------------------------------------------------------
1 | .pln {
2 | color: #ddd;
3 | }
4 |
5 | /* string content */
6 | .str {
7 | color: #61ce3c;
8 | }
9 |
10 | /* a keyword */
11 | .kwd {
12 | color: #fbde2d;
13 | }
14 |
15 | /* a comment */
16 | .com {
17 | color: #aeaeae;
18 | }
19 |
20 | /* a type name */
21 | .typ {
22 | color: #8da6ce;
23 | }
24 |
25 | /* a literal value */
26 | .lit {
27 | color: #fbde2d;
28 | }
29 |
30 | /* punctuation */
31 | .pun {
32 | color: #ddd;
33 | }
34 |
35 | /* lisp open bracket */
36 | .opn {
37 | color: #000000;
38 | }
39 |
40 | /* lisp close bracket */
41 | .clo {
42 | color: #000000;
43 | }
44 |
45 | /* a markup tag name */
46 | .tag {
47 | color: #8da6ce;
48 | }
49 |
50 | /* a markup attribute name */
51 | .atn {
52 | color: #fbde2d;
53 | }
54 |
55 | /* a markup attribute value */
56 | .atv {
57 | color: #ddd;
58 | }
59 |
60 | /* a declaration */
61 | .dec {
62 | color: #EF5050;
63 | }
64 |
65 | /* a variable name */
66 | .var {
67 | color: #c82829;
68 | }
69 |
70 | /* a function name */
71 | .fun {
72 | color: #4271ae;
73 | }
74 |
75 | /* Specify class=linenums on a pre to get line numbering */
76 | ol.linenums {
77 | margin-top: 0;
78 | margin-bottom: 0;
79 | }
80 |
--------------------------------------------------------------------------------
/docs/switch_Switch.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | switch/Switch.js - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
switch/Switch.js
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | import React, { Component } from 'react';
46 |
47 | import setClassName from 'utilities/setClassName';
48 |
49 | // import PropTypes from 'prop-types';
50 |
51 | /**
52 | * @namespace Switch
53 | * @description Default styled switch/toggle component.
54 | * @tutorial `src\stories\Switch.stories.js`
55 | */
56 |
57 | export class Switch extends Component {
58 | state = { status: false };
59 | toggle = (callback) => this.setState({ status: !this.state.status }, () => callback || null);
60 | handleClick = () => this.toggle(this.props.onClick());
61 |
62 | render() {
63 |
64 | return (
65 | <article
66 | { ...this.props }
67 | onClick={ this.handleClick }
68 | data-active={ this.state.status }
69 | className={ setClassName(this.props, 'switch') }
70 | >
71 | <span />
72 | </article>
73 | );
74 | }
75 | };
76 |
77 | // Switch.propTypes = {};
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/docs/vendors~main.2132ca66e14e6488e138.bundle.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | object-assign
3 | (c) Sindre Sorhus
4 | @license MIT
5 | */
6 |
7 | /*!
8 | * https://github.com/es-shims/es5-shim
9 | * @license es5-shim Copyright 2009-2020 by contributors, MIT License
10 | * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
11 | */
12 |
13 | /*!
14 | * https://github.com/paulmillr/es6-shim
15 | * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
16 | * and contributors, MIT License
17 | * es6-shim: v0.35.4
18 | * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
19 | * Details and documentation:
20 | * https://github.com/paulmillr/es6-shim/
21 | */
22 |
23 | /*!
24 | * isobject
25 | *
26 | * Copyright (c) 2014-2017, Jon Schlinkert.
27 | * Released under the MIT License.
28 | */
29 |
30 | /** @license React v0.19.1
31 | * scheduler.production.min.js
32 | *
33 | * Copyright (c) Facebook, Inc. and its affiliates.
34 | *
35 | * This source code is licensed under the MIT license found in the
36 | * LICENSE file in the root directory of this source tree.
37 | */
38 |
39 | /** @license React v16.13.1
40 | * react-dom.production.min.js
41 | *
42 | * Copyright (c) Facebook, Inc. and its affiliates.
43 | *
44 | * This source code is licensed under the MIT license found in the
45 | * LICENSE file in the root directory of this source tree.
46 | */
47 |
48 | /** @license React v16.13.1
49 | * react.production.min.js
50 | *
51 | * Copyright (c) Facebook, Inc. and its affiliates.
52 | *
53 | * This source code is licensed under the MIT license found in the
54 | * LICENSE file in the root directory of this source tree.
55 | */
56 |
57 | //! stable.js 0.1.8, https://github.com/Two-Screen/stable
58 |
59 | //! © 2018 Angry Bytes and contributors. MIT licensed.
60 |
--------------------------------------------------------------------------------
/docs/vendors~main.2132ca66e14e6488e138.bundle.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"vendors~main.2132ca66e14e6488e138.bundle.js","sources":["webpack:///vendors~main.2132ca66e14e6488e138.bundle.js"],"mappings":";AAAA","sourceRoot":""}
--------------------------------------------------------------------------------
/docs/vendors~main.b3728e18857e2df6c710.bundle.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | //! stable.js 0.1.8, https://github.com/Two-Screen/stable
2 |
3 | //! © 2018 Angry Bytes and contributors. MIT licensed.
4 |
--------------------------------------------------------------------------------
/jakelib/tasks.jake:
--------------------------------------------------------------------------------
1 | const { build } = require('./tasks/build.js');
2 | const { clean } = require('./tasks/clean.js');
3 | const { start } = require('./tasks/start.js');
4 |
5 | namespace('tasks', () => {
6 |
7 | // Build scripts
8 | desc('Builds project and/or Storybook.');
9 | task('build', { async: true }, build);
10 |
11 | // Start scripts
12 | desc('Starts project or Storybook.');
13 | task('start', { async: true }, start);
14 |
15 | // Clean scripts
16 | desc('Cleans project "junk" files.');
17 | task('clean', { async: true }, clean);
18 | });
--------------------------------------------------------------------------------
/jakelib/tasks/build.js:
--------------------------------------------------------------------------------
1 | const { execSync } = require('child_process');
2 |
3 | const build = () => {
4 | // Process potential script arguments in `package.json`
5 | const command = process.argv.reduce((accumulator, argument) => {
6 | switch(argument) {
7 | case 'project':
8 | accumulator = 'rollup -c';
9 | return accumulator;
10 |
11 | case 'storybook':
12 | accumulator = 'build-storybook';
13 | return accumulator;
14 |
15 | default:
16 | accumulator = 'rollup -c && build-storybook';
17 | return accumulator;
18 | }
19 | }, '');
20 |
21 | // Execute shell command
22 | execSync(command, { stdio: 'inherit' });
23 |
24 | };
25 |
26 | module.exports = { build };
--------------------------------------------------------------------------------
/jakelib/tasks/clean.js:
--------------------------------------------------------------------------------
1 | const rimraf = require('rimraf');
2 |
3 | // Files that are deleted no matter which clean method is used
4 | const defaultFiles = [ 'package-lock.json', 'yarn.lock', 'yarn-error.log' ];
5 |
6 | const clean = () => {
7 | // Process potential script arguments in `package.json`
8 | const files = process.argv.reduce((accumulator, argument) => {
9 | switch(argument) {
10 | case 'project':
11 | accumulator = [ ...accumulator, 'dist', 'node_modules' ];
12 | return accumulator;
13 |
14 | case 'storybook':
15 | accumulator = [ ...accumulator, 'docs', 'storybook-static' ];
16 | return accumulator;
17 |
18 | default:
19 | accumulator = [ ...accumulator, 'dist', 'docs', 'node_modules', 'storybook-static' ];
20 | return accumulator;
21 | }
22 | }, defaultFiles);
23 |
24 |
25 | // Delete selected file(s)
26 | // Array.from(new Set()) used to remove potential duplicates
27 | Array.from(new Set(files)).forEach(file => {
28 | try {
29 | rimraf(file, () => console.log(`${file} deleted.`));
30 | } catch (error) {
31 | console.error(`unable to delete ${file}: ${error}`);
32 | }
33 | });
34 | };
35 |
36 | module.exports = { clean };
--------------------------------------------------------------------------------
/jakelib/tasks/start.js:
--------------------------------------------------------------------------------
1 | const { execSync } = require('child_process');
2 |
3 | const start = () => {
4 | // Process potential script arguments in `package.json`
5 | const command = process.argv.reduce((accumulator, argument) => {
6 | switch(argument) {
7 | case 'project':
8 | accumulator = 'rollup -c -w';
9 | return accumulator;
10 |
11 | case 'storybook':
12 | accumulator = 'start-storybook -p 9009';
13 | return accumulator;
14 |
15 | default:
16 | accumulator = 'rollup -c -w start-storybook -p 9009';
17 | return accumulator;
18 | }
19 | }, '');
20 |
21 | // Execute shell command
22 | execSync(command, { stdio: 'inherit' });
23 | };
24 |
25 | module.exports = { start };
--------------------------------------------------------------------------------
/jsdoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "source": {
3 | "include": ["src"],
4 | "includePattern": ".js$",
5 | "excludePattern": "(node_modules/|docs)"
6 | },
7 | "plugins": ["plugins/markdown"],
8 | "templates": {
9 | "cleverLinks": true,
10 | "monospaceLinks": true
11 | },
12 | "opts": {
13 | "recurse": true,
14 | "destination": "docs",
15 | "template": "jsdoc",
16 | "readme": "readme.md"
17 | }
18 | }
--------------------------------------------------------------------------------
/jsdoc/LICENSE.md:
--------------------------------------------------------------------------------
1 | # License
2 |
3 | Docdash is free software, licensed under the Apache License, Version 2.0 (the
4 | "License"). Commercial and non-commercial use are permitted in compliance with
5 | the License.
6 |
7 | Copyright (c) 2016 Clement Moron and the
8 | [contributors to docdash](https://github.com/clenemt/docdash/graphs/contributors).
9 | All rights reserved.
10 |
11 | You may obtain a copy of the License at:
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | In addition, a copy of the License is included with this distribution.
15 |
16 | As stated in Section 7, "Disclaimer of Warranty," of the License:
17 |
18 | > Licensor provides the Work (and each Contributor provides its Contributions)
19 | > on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
20 | > express or implied, including, without limitation, any warranties or
21 | > conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
22 | > PARTICULAR PURPOSE. You are solely responsible for determining the
23 | > appropriateness of using or redistributing the Work and assume any risks
24 | > associated with Your exercise of permissions under this License.
25 |
26 | The source code for docdash is available at:
27 | https://github.com/clenemt/docdash
28 |
29 | # Third-Party Software
30 |
31 | Docdash includes or depends upon the following third-party software, either in
32 | whole or in part. Each third-party software package is provided under its own
33 | license.
34 |
35 | ## JSDoc 3
36 |
37 | JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the
38 | "License"). Commercial and non-commercial use are permitted in compliance with
39 | the License.
40 |
41 | Copyright (c) 2011-2016 Michael Mathews and the
42 | [contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors).
43 | All rights reserved.
44 |
45 | You may obtain a copy of the License at:
46 | http://www.apache.org/licenses/LICENSE-2.0
47 |
48 | In addition, a copy of the License is included with this distribution.
49 |
50 | As stated in Section 7, "Disclaimer of Warranty," of the License:
51 |
52 | > Licensor provides the Work (and each Contributor provides its Contributions)
53 | > on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
54 | > express or implied, including, without limitation, any warranties or
55 | > conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
56 | > PARTICULAR PURPOSE. You are solely responsible for determining the
57 | > appropriateness of using or redistributing the Work and assume any risks
58 | > associated with Your exercise of permissions under this License.
59 |
60 | The source code for JSDoc 3 is available at:
61 | https://github.com/jsdoc3/jsdoc
62 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/base/chains.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview The chains define the primary composition elements (functions) that determine the order of execution.
4 | *
5 | * @module base/chains
6 | * @requires dcl
7 | */
8 | var dcl = require( "dcl" );
9 | /**
10 | * @classDesc Chains define the primary composition elements (functions) that determine the order of execution.
11 | * @exports base/chains
12 | * @constructor
13 | */
14 | var Chains = dcl( null, {declaredClass : "base/chains"} );
15 | /**
16 | * The `close` method asks an object to shut itself down in a way that will allow it to be reopened, unlike the
17 | * [end method]{@link base/chains#end} which will call the destroy method which should make the object unusable, but also
18 | * devoid of all resources whereas `close` may still keep some resources open.
19 | *
20 | * | Heading 1 | Heading 2 | Heading 3 |
21 | * |-----------|-----------|-----------------|
22 | * | Bar | Food | This is a table |
23 | *
24 | * This uses the `before` chain which means the last one defined in the first one destroyed
25 | * @memberOf base/chains#
26 | * @name close
27 | * @see base/chains#open
28 | */
29 | dcl.chainBefore( Chains, "close" );
30 | /**
31 | * The `end` method will call the destroy method which should make the object unusable and
32 | * devoid of all resources, unlike the
33 | * [close method]{@link base/chains#close} asks an object to shut itself down in a way that will allow it to be reopened.
34 | *
35 | * This uses the `before` chain which means the last one defined in the first one destroyed
36 | * @memberOf base/chains#
37 | * @name end
38 | *
39 | * @example Add *this* to your application.properties.
40 | * {@lang bash}
41 | * foo=bar
42 | *
43 | */
44 | dcl.chainBefore( Chains, "end" );
45 | /**
46 | * Destroy is called by the end method and it is here that you should clean up after yourself. The difference between
47 | * `destroy` and [end]{@link base/chains#end} is the `end` is the verb that you raise on an object to ask it to go away
48 | * and `destroy` is where you actually do the work to clean up. Think of this as the counterpart of `constructor` yet
49 | * not called automatically.
50 | *
51 | * This uses the `before` chain which means the last one defined is the first one destroyed
52 | * @private
53 | * @memberOf base/chains#
54 | * @name destroy
55 | */
56 | dcl.chainBefore( Chains, "destroy" );
57 |
58 | /**
59 | * If you are using the open/close paradigm for an object that can kind of go dormant on {@link base/chains#close} and can be "reopened"
60 | * again later, here is where the "open" code will go.
61 | *
62 | * This used the `after` chain which means that the first one defined is the first one destroyed.
63 | *
64 | * @memberOf base/chains#
65 | * @name open
66 | * @see base/chains#close
67 | */
68 | dcl.chainAfter( Chains, "open" );
69 |
70 | module.exports = Chains;
71 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/base/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview This is base definition for all composed classes defined by the system
4 | * @module base
5 | * @requires base/chains
6 | * @requires dcl
7 | */
8 |
9 | var dcl = require( "dcl" );
10 | var chains = require( "./chains" );
11 |
12 | /**
13 | * @classdesc The base of all classes in the system, this is one of the few pure "classes" in core the of the system. It is a
14 | * pretty clean little class whose primary purpose is to surface the composition chains and a basis for storing
15 | * options on mixin and subclass instances. Options are handled at the instance rather than the prototype level
16 | * so that multiple instances don't compete for default values.
17 | *
18 | * @exports base
19 | * @constructor
20 | * @extends base/chains
21 | */
22 | var Base = dcl( [chains], /** @lends base# */{
23 | declaredClass : "Base",
24 | /**
25 | * Add an option to a class. If any members of the hash already exist in `this.options`, they will be overwritten.
26 | * @param {hash} options A hash of options you want to set
27 | * @see {base#addDefaultOptions}
28 | */
29 | addOptions : function ( options ) {
30 | options = options || {};
31 | if ( this.options ) {options = sys.extend( {}, sys.result( this, 'options' ), options );}
32 | this.options = options;
33 | },
34 | /**
35 | * Add a default option to a class. The default options are only set if there is not already a
36 | * value for the option.
37 | * @param {hash} options A hash of options you want to set
38 | * @see {base#addOptions}
39 | */
40 | addDefaultOptions : function ( options ) {
41 | options = options || {};
42 | if ( this.options ) {options = sys.defaults( {}, sys.result( this, 'options' ), options );}
43 | this.options = options;
44 | },
45 |
46 | /**
47 | * Call this to close your object and dispose of all maintained resources. You can define this method on your
48 | * own classes without having to call the superclass instance, however it is reccomended that you put
49 | * all disposal code in `destroy()`. You must be disciplined about calling this on your instances.
50 | * @see {base/chains#end}
51 | * @see {base/chains#destroy}
52 | */
53 | end : function () {
54 | this.destroy()
55 | },
56 |
57 | /**
58 | * Called when it is time to get rid of all of your instance level references and objects and events. You can
59 | * define this method on your own classes without having to call the superclass instance. It is called by
60 | * `instance.end()` automatically
61 | * @see {base/chains#end}
62 | * @see {base/chains#destroy}
63 | */
64 | destroy : function () {
65 |
66 | }
67 |
68 |
69 | } );
70 |
71 | Base.compose = dcl;
72 | Base.mixin = dcl.mix;
73 | module.exports = Base;
74 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/documents/model.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like
4 | * that, it is a pure, in memory data container
5 | * @module documents/model
6 | * @require base
7 | * @require documents/probe
8 | * @require lodash
9 | */
10 |
11 | var Base = require( "../base" );
12 | var probe = require( "./probe" );
13 | var sys = require( "lodash" );
14 | /**
15 | * A model is the first level if usable data-bearing entity in the system. It does NOT include any verbs for saving or anything like
16 | * that, it is a pure, in memory data container
17 | * @exports documents/model
18 | * @constructor
19 | * @borrows module:documents/probe.get as get
20 | * @borrows module:documents/probe.set as set
21 | * @borrows module:documents/probe.any as any
22 | * @borrows module:documents/probe.all as all
23 | * @borrows module:documents/probe.remove as remove
24 | * @borrows module:documents/probe.seekKey as seekKey
25 | * @borrows module:documents/probe.seek as seek
26 | * @borrows module:documents/probe.findOne as findOne
27 | * @borrows module:documents/probe.findOneKey as findOneKey
28 | * @borrows module:documents/probe.findKeys as findKeys
29 | * @borrows module:documents/probe.find as find
30 | * @borrows module:documents/probe.update as update
31 | * @borrows module:documents/probe.some as some
32 | * @borrows module:documents/probe.every as every
33 | */
34 | var Model = Base.compose( [Base], /** @lends documents/model# */{
35 | constructor : function () {
36 | var that = this;
37 | probe.mixin( this );
38 |
39 | var idField = "_id";
40 | /**
41 | * The name of the field that uniquely identifies a record. When provided, some operations will take advantage of it
42 | *
43 | * @name _idField
44 | * @memberOf documents/model#
45 | * @type {string}
46 | * @private
47 | */
48 | Object.defineProperty( this, "_idField", {
49 | get : function () {
50 | return idField;
51 | },
52 | set : function ( val ) {
53 | idField = val;
54 | },
55 | configurable : false,
56 | enumerable : true,
57 | writable : true
58 | } );
59 |
60 | /**
61 | * The value of the primary key if {@link documents/model#_idField} is filled in. It will be null if none found
62 | *
63 | * @name _pkey
64 | * @memberOf documents/model#
65 | * @type {*}
66 | * @private
67 | */
68 | Object.defineProperty( this, "_pkey", {
69 | get : function () {
70 | var val;
71 | if ( !sys.isEmpty( that._idField ) ) {
72 | val = that[that._idField];
73 | }
74 | return val;
75 | },
76 | set : function ( val ) {
77 | if ( !sys.isEmpty( that._idField ) ) {
78 | that[that._idField] = val;
79 | }
80 | },
81 | configurable : false,
82 | enumerable : true,
83 | writable : true
84 | } );
85 |
86 | /**
87 | * If {@link documents/model#_idField} is filled in and it's value is empty this will be true.
88 | * @type {boolean}
89 | * @name isNew
90 | * @memberOf documents/model#
91 | */
92 | Object.defineProperty( this, "isNew", {
93 | get : function () {
94 | return !sys.isEmpty( that._idField ) && !sys.isEmpty( that[that._idField] )
95 | },
96 | configurable : false,
97 | enumerable : true,
98 | writable : false
99 | } );
100 |
101 | /**
102 | * Returns true if this instance is empty
103 | * @type {boolean}
104 | * @name isEmpty
105 | * @memberOf documents/model#
106 | */
107 | Object.defineProperty( this, "isEmpty", {
108 | get : function () {
109 | return sys.isEmpty( that );
110 | },
111 | configurable : false,
112 | enumerable : true,
113 | writable : false
114 | } );
115 | }
116 | } );
117 | module.exports = Model;
118 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/fixtures.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "tags": {
3 | "allowUnknownTags": true
4 | },
5 | "source": {
6 | "include": [
7 | "fixtures/",
8 | "./README.md"
9 | ]
10 | },
11 | "plugins": ["plugins/markdown"],
12 | "opts": {
13 | "encoding": "utf8",
14 | "template": "../",
15 | "destination": "../fixtures-doc/",
16 | "recurse": true,
17 | "verbose": true
18 | },
19 | "markdown": {
20 | "parser": "gfm",
21 | "hardwrap": true
22 | },
23 | "templates": {
24 | "cleverLinks": false,
25 | "monospaceLinks": false,
26 | "default": {
27 | "outputSourceFiles": true,
28 | "includeDate": false
29 | }
30 | },
31 | "docdash": {
32 | "static": false,
33 | "sort": true
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/mixins/bussable.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview Provides easy access to the system bus and provides some helper methods for doing so
4 | * @module mixins/bussable
5 | * @requires postal
6 | * @requires lodash
7 | * @requires base
8 | */
9 | var bus = require( "postal" );
10 | var Base = require( "../base" );
11 | var sys = require( "lodash" );
12 |
13 | /**
14 | * @classDesc Provides easy access to the system bus and provides some helper methods for doing so
15 | * @exports mixins/bussable
16 | * @mixin
17 | */
18 | var Bussable = Base.compose( [Base], /** @lends mixins/bussable# */{
19 | declaredClass : "mixins/Bussable",
20 | constructor : function () {
21 | /**
22 | * The list of subscriptions maintained by the mixin
23 | * @type {Array}
24 | * @memberof mixins/bussable#
25 | * @name _subscriptions
26 | * @private
27 | */
28 | this._subscriptions = {};
29 |
30 | this.log.trace( "Bussable constructor" );
31 | },
32 |
33 | /**
34 | * Subscribe to an event
35 | * @param {string} channel The channel to subscribe to
36 | * @param {string} topic The topic to subscribe to
37 | * @param {callback} callback What to do when you get the event
38 | * @returns {object} The subscription definition
39 | */
40 | subscribe : function ( channel, topic, callback ) {
41 | this.log.trace( "Bussable subscribe" );
42 | var sub = bus.subscribe( {channel : channel, topic : topic, callback : callback} );
43 | this.subscriptions[channel + "." + topic] = sub;
44 | return sub;
45 | },
46 |
47 | /**
48 | * Subscribe to an event once
49 | * @param {string} channel The channel to subscribe to
50 | * @param {string} topic The topic to subscribe to
51 | * @param {callback} callback What to do when you get the event
52 | * @returns {object} The subscription definition
53 | */
54 | once : function ( channel, topic, callback ) {
55 | this.log.trace( "Bussable once" );
56 | var sub = this.subscribe( channel, topic, callback );
57 | this.subscriptions[channel + "." + topic] = sub;
58 | sub.disposeAfter( 1 );
59 | return sub;
60 | },
61 |
62 | /**
63 | * Publish an event on the system bus
64 | * @param {string} channel The channel to publish to
65 | * @param {string} topic The topic to publish to
66 | * @param {object=} options What to pass to the event
67 | */
68 | publish : function ( channel, topic, options ) {
69 | this.log.trace( "Bussable publish" );
70 | bus.publish( {channel : channel, topic : topic, data : options} );
71 | },
72 |
73 | /**
74 | * Get a subscription definition
75 | *
76 | * @param {string} channel
77 | * @param {string} topic
78 | * @returns {object=} The subscription definition
79 | */
80 | getSubscription : function ( channel, topic ) {
81 | this.log.trace( "Bussable getSubscription" );
82 | return this.subscriptions[channel + "." + topic];
83 | },
84 |
85 | /**
86 | * Gets rid of all subscriptions for this object.
87 | * @private
88 | */
89 | destroy : function () {
90 | this.log.trace( "Bussable destroy" );
91 |
92 | sys.each( this.subscriptions, function ( sub ) {
93 | sub.unsubscribe();
94 | } );
95 | }
96 | } );
97 |
98 | module.exports = Bussable;
99 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/strings/format.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview String helper methods
4 | *
5 | * @module strings/format
6 | */
7 |
8 | /**
9 | * Format a string quickly and easily using .net style format strings
10 | * @param {string} format A string format like "Hello {0}, now take off your {1}!"
11 | * @param {...?} args One argument per `{}` in the string, positionally replaced
12 | * @returns {string}
13 | *
14 | * @example
15 | * var strings = require("papyrus/strings");
16 | * var s = strings.format("Hello {0}", "Madame Vastra");
17 | * // s = "Hello Madame Vastra"
18 | *
19 | * @example {@lang xml}
20 | *
21 | * <%= strings.format("Hello {0}", "Madame Vastra") %>
22 | *
23 | */
24 | module.exports = function ( format ) {
25 | var args = Array.prototype.slice.call( arguments, 1 );
26 | return format.replace( /{(\d+)}/g, function ( match, number ) {
27 | return typeof args[number] != 'undefined'
28 | ? args[number]
29 | : match
30 | ;
31 | } );
32 | };
33 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/tutorials/Drive Car.md:
--------------------------------------------------------------------------------
1 | #Lorem ipsum dolor sit amet
2 |
3 | Curabitur est mi, fermentum lacinia tincidunt vitae, mattis sit amet neque. Quisque diam nisl, accumsan ac porta tincidunt, iaculis facilisis ipsum. Nulla facilisi. Aenean a metus tortor. Pellentesque congue, mauris vitae viverra varius, elit nunc dictum nisl, rhoncus ultrices nulla sapien at leo. Duis ultricies porttitor diam. Nulla facilisi. Nullam elementum, lorem eu imperdiet laoreet, est turpis sollicitudin velit, in porttitor justo dolor vel urna. Mauris in ante magna. Curabitur vitae lacus in magna mollis commodo.
4 |
5 | ##Fusce lacinia, mauris ac aliquam consequat
6 | Fusce molestie blandit velit, sit amet dictum eros pharetra vitae. In erat urna, condimentum ac feugiat id, rutrum et nisi. Cras ac velit lorem. Nulla facilisi. Maecenas dignissim nulla in turpis tempus sed rhoncus augue dapibus. Nulla feugiat, urna non sagittis laoreet, dolor metus rhoncus justo, sed semper ante lacus eget quam. Sed ac ligula magna. Sed tincidunt pulvinar neque in porta. Nullam quis lacus orci. Pellentesque ornare viverra lacus, id aliquam magna venenatis a.
7 |
8 | Sed id tristique lorem. Ut sodales turpis nec mauris gravida interdum. Cras pellentesque, purus at suscipit euismod, elit nunc cursus nisi, ut venenatis metus sapien id velit. Sed lectus orci, pharetra non pulvinar vel, ullamcorper id lorem. Donec vulputate tincidunt ipsum, ut lacinia tortor sollicitudin id. Nunc nec nibh ut felis venenatis egestas. Proin risus mauris, eleifend eget interdum in, venenatis sed velit. Praesent sodales elit ut odio viverra posuere. Donec sapien lorem, molestie in egestas eget, vulputate sed orci. Aenean elit sapien, pellentesque vitae tempor sit amet, sagittis et ligula. Mauris aliquam sapien sit amet lacus ultrices rutrum. Curabitur nec dolor sed elit varius dignissim a a lacus. Aliquam ac convallis enim.
9 |
10 | Suspendisse orci massa, hendrerit sagittis lacinia consectetur, sagittis vitae purus. Aliquam id eros diam, eget elementum turpis. Nullam tellus magna, mollis in molestie id, venenatis rhoncus est. Proin id diam justo. Nunc tempus gravida justo at lobortis. Nam vitae venenatis nisi. Donec vel odio massa. Quisque interdum metus sit amet est iaculis tincidunt. Donec bibendum blandit purus, id semper orci aliquam quis. Nam tincidunt dolor eu felis ultricies tempor. Nulla non consectetur erat.
11 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/tutorials/Fence Test.md:
--------------------------------------------------------------------------------
1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non libero tristique, interdum quam in, fermentum massa. Aenean vestibulum velit eu massa faucibus accumsan. Aenean tempus quam ornare ligula gravida adipiscing. Suspendisse vestibulum diam quis quam lacinia convallis. Nunc rhoncus a elit ut dictum. Maecenas porta mi et risus convallis commodo. In hac habitasse platea dictumst. Morbi placerat sem nec eleifend hendrerit. Donec hendrerit pulvinar tristique. Pellentesque at nunc blandit, fringilla elit nec, dignissim arcu. Quisque sit amet enim urna. Nunc adipiscing lacinia justo. Pellentesque euismod nisi id elit auctor porttitor. Phasellus rutrum viverra felis, ac cursus ante vulputate ut. Donec laoreet felis ac risus vulputate sodales.
2 |
3 | Mauris sit amet risus non ligula lacinia iaculis. Sed ornare tellus velit, vel elementum quam porttitor tempus. Duis vestibulum augue eu diam malesuada auctor. Maecenas dignissim odio ut elit fermentum, id mollis leo mattis. Phasellus posuere augue sed interdum vestibulum. Etiam ac pharetra est. Integer tortor ligula, pharetra ac nisi nec, faucibus laoreet dolor. Nunc vehicula, enim et cursus tincidunt, nulla purus mollis urna, vel ultricies nisl mi a risus. Vestibulum sed urna sodales, pretium nisi sed, pretium sapien. Vivamus et massa tincidunt, semper nibh nec, eleifend urna. Integer auctor, eros at pharetra blandit, erat nibh mattis turpis, rhoncus elementum nisi mi vitae purus.
4 |
5 | Quisque elementum sapien id neque volutpat cursus non mattis velit.
6 |
7 |
8 | ```
9 | $mod : function ( qu, value ) {
10 | var operands = sys.flatten( qu.operands );
11 | if ( operands.length !== 2 ) {
12 | throw new Error( "$mod requires two operands" );
13 | }
14 | var mod = operands[0];
15 | var rem = operands[1];
16 | return value % mod === rem;
17 | },
18 |
19 | ```
20 |
21 |
22 | ```
23 | {@lang bash}
24 | #!/bin/bash
25 | echo Please, enter your firstname and lastname
26 | read FN LN
27 | echo "Hi! $LN, $FN !"
28 | ```
29 |
30 | ```bash
31 | #!/bin/bash
32 | echo Please, enter your firstname and lastname
33 | read FN LN
34 | echo "Hi! $LN, $FN !"
35 | ```
36 |
37 |
--------------------------------------------------------------------------------
/jsdoc/fixtures/utils/logger.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * @fileOverview The logging system for papyrus is based on [http://pimterry.github.io/loglevel/](loglevel) and slightly decorated
4 | * @module utils/logger
5 | * @requires dcl
6 | * @requires loglevel
7 | */
8 |
9 | var dcl = require( "dcl" );
10 | var log = require( 'loglevel' );
11 |
12 | /**
13 | * A logger class that you can mix into your classes to handle logging settings and state at an object level.
14 | * See {@link utils/logger} for the members of this class
15 | *
16 | * @exports utils/logger.Logger
17 | * @class
18 | * @see utils/logger
19 | */
20 | var Logger = dcl( null, /** @lends utils/logger.Logger# */{
21 | declaredClass : "utils/Logger",
22 |
23 | /**
24 | * Turn off all logging. If you log something, it will not error, but will not do anything either
25 | * and the cycles are minimal.
26 | *
27 | */
28 | silent : function () {
29 | log.disableAll();
30 | },
31 | /**
32 | * Turns on all logging levels
33 | *
34 | */
35 | all : function () {
36 | log.enableAll();
37 | },
38 | /**
39 | * Sets the logging level to one of `trace`, `debug`, `info`, `warn`, `error`.
40 | * @param {string} lvl The level to set it to. Can be one of `trace`, `debug`, `info`, `warn`, `error`.
41 | *
42 | */
43 | level : function ( lvl ) {
44 | if ( lvl.toLowerCase() === "none" ) {
45 | log.disableAll();
46 | } else {
47 | log.setLevel( lvl );
48 | }
49 | },
50 | /**
51 | * Log a `trace` call
52 | * @method
53 | * @param {string} The value to log
54 | */
55 | trace : log.trace,
56 | /**
57 | * Log a `debug` call
58 | * @method
59 | * @param {string} The value to log
60 | */
61 | debug : log.debug,
62 | /**
63 | * Log a `info` call
64 | * @method
65 | * @param {string} The value to log
66 | */
67 | info : log.info,
68 | /**
69 | * Log a `warn` call
70 | * @method
71 | * @param {string} The value to log
72 | */
73 | warn : log.warn,
74 | /**
75 | * Log a `error` call
76 | * @method
77 | * @param {string} The value to log
78 | */
79 | error : log.error
80 | } );
81 |
82 | module.exports = new Logger();
83 | /**
84 | * The system global, cross-platform logger
85 | * @name utils/logger
86 | * @static
87 | * @type {utils/logger.Logger}
88 | */
89 | module.exports.Logger = Logger;
90 |
--------------------------------------------------------------------------------
/jsdoc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "daybrush-jsdoc-template",
3 | "version": "1.6.0",
4 | "description": "A clean, responsive documentation template theme for JSDoc 3 inspired by lodash and minami",
5 | "main": "publish.js",
6 | "scripts": {
7 | "test": "jsdoc -c fixtures/fixtures.conf.json",
8 | "sync": "browser-sync start -s ../fixtures-doc -f ../fixtures-doc --reload-delay 1000 --no-ui --no-notify",
9 | "watch": "watch-run -d 1000 -p tmpl/**,static/** \"npm run test\""
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/daybrush/daybrush-jsdoc-template.git"
14 | },
15 | "devDependencies": {
16 | "jsdoc": "latest",
17 | "browser-sync": "latest",
18 | "watch-run": "latest"
19 | },
20 | "author": "Daybrush ",
21 | "license": "Apache-2.0",
22 | "keywords": [
23 | "jsdoc",
24 | "template",
25 | "tsdoc",
26 | "javascript",
27 | "typescript"
28 | ],
29 | "dependencies": {
30 | "@daybrush/utils": "^0.10.0"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jsdoc/static/scripts/custom.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/default-services/components/a87e6a0e4441d7e93993c063102cd379a27728d3/jsdoc/static/scripts/custom.js
--------------------------------------------------------------------------------
/jsdoc/static/scripts/linenumber.js:
--------------------------------------------------------------------------------
1 | /*global document */
2 | (function() {
3 | var source = document.getElementsByClassName('prettyprint source linenums');
4 | var i = 0;
5 | var lineNumber = 0;
6 | var lineId;
7 | var lines;
8 | var totalLines;
9 | var anchorHash;
10 |
11 | if (source && source[0]) {
12 | anchorHash = document.location.hash.substring(1);
13 | lines = source[0].getElementsByTagName('li');
14 | totalLines = lines.length;
15 |
16 | for (; i < totalLines; i++) {
17 | lineNumber++;
18 | lineId = 'line' + lineNumber;
19 | lines[i].id = lineId;
20 | if (lineId === anchorHash) {
21 | lines[i].className += ' selected';
22 | }
23 | }
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/jsdoc/static/scripts/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/jsdoc/static/scripts/search.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | var nav = document.querySelector("nav");
4 | var searchBar = nav.querySelector(".search");
5 | var input = searchBar.querySelector("input");
6 | // var submit = searchBar.querySelector("button");
7 | var groups = Array.prototype.slice.call(document.querySelectorAll("nav>ul .parent")).map(function (group) {
8 | var items = Array.prototype.slice.call(group.querySelectorAll("a"));
9 | var strings = items.map(function (a) {
10 | return a.innerText.toLowerCase();
11 | });
12 |
13 | return {el: group, items: items, strings, strings};
14 | });
15 | input.addEventListener("keyup", function (e) {
16 | var value = input.value.toLowerCase();
17 |
18 | if (value) {
19 | utils.addClass(nav, "searching");
20 | } else {
21 | utils.removeClass(nav, "searching");
22 | return;
23 | }
24 | groups.forEach(function (group) {
25 | var isSearch = false;
26 | var items = group.items;
27 |
28 | group.strings.forEach(function (v, i) {
29 | var item = items[i];
30 | if (utils.hasClass(item.parentNode, "parent")) {
31 | item = item.parentNode;
32 | }
33 | if (v.indexOf(value) > -1) {
34 | utils.addClass(item, "targeting");
35 | isSearch = true;
36 | } else {
37 | utils.removeClass(item, "targeting");
38 | }
39 | });
40 | if (isSearch) {
41 | utils.addClass(group.el, "module-targeting");
42 | } else {
43 | utils.removeClass(group.el, "module-targeting");
44 | }
45 | });
46 | });
47 | })();
--------------------------------------------------------------------------------
/jsdoc/static/scripts/utils.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2018 Daybrush
3 | @name: @daybrush/utils
4 | license: MIT
5 | author: Daybrush
6 | repository: https://github.com/daybrush/utils
7 | @version 0.4.0
8 | */
9 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.utils=t()}(this,function(){"use strict";var u="rgb",c="rgba",f="hsl",l="hsla",e=[u,c,f,l],t="function",n="object",r="string",i="undefined",a=typeof window!==i,o=["webkit","ms","moz","o"],s=function(e){if(typeof document===i)return"";var t=(document.body||document.documentElement).style,n=o.length;if(typeof t[e]!==i)return e;for(var r=0;rul>li:after {
14 | content: "";
15 | position: absolute;
16 | right: 10px;
17 | top: 0;
18 | bottom: 0;
19 | width: 0;
20 | height: 0;
21 | margin: auto 0px;
22 | border-top: 7px solid #ccc;
23 | border-left: 6px solid transparent;
24 | border-right: 6px solid transparent;
25 | }
26 | nav li h4, nav li ul {
27 | display: none;
28 | }
29 |
30 | .name.typescript {
31 | background: #374E79;
32 | font-size: 14px;
33 | }
34 | .name.typescript .signature {
35 | color: #21de60;
36 | }
37 | .ts-params.typescript table .last {
38 | display: none;
39 | }
40 | table.params th, table.params tr td , table.params tr td.type{
41 | word-break: break-word;
42 | white-space: normal;
43 | }
44 |
45 | nav .search {
46 | position: relative;
47 | margin: 0px 10px;
48 | border: 3px solid #333;
49 | height: 43px;
50 | }
51 | nav .search .input-area {
52 | position: absolute;
53 | left: 0;
54 | top: 0;
55 | right: 35px;
56 | height: 35px;
57 | }
58 | nav .search input {
59 | position: relative;
60 | width: 100%;
61 | height: 100%;
62 | border: 0;
63 | padding: 0;
64 | text-indent: 10px;
65 | font-weight: bold;
66 | font-size: 14px;
67 | outline: none;
68 | }
69 | nav .search button {
70 | position: absolute;
71 | top: 0;
72 | right: 0px;
73 | width: 35px;
74 | height: 35px;
75 | border: 0;
76 | padding: 0;
77 | outline: none;
78 | cursor: pointer;
79 | }
80 | nav .search button:before {
81 | position: absolute;
82 | content: "";
83 | width: 18px;
84 | height: 18px;
85 | top: 7px;
86 | left: 7px;
87 | border: 3px solid #333;
88 | border-radius: 50%;
89 | box-sizing: border-box;
90 | }
91 | nav .search button:after {
92 | position: absolute;
93 | content: "";
94 | width: 3px;
95 | height: 11px;
96 | top: 21px;
97 | left: 18px;
98 | background: #333;
99 | transform-origin: 50% 0%;
100 | -ms-transform-origin: 50% 0%;
101 | -webkit-transform-origin: 50% 0%;
102 | transform: rotate(-45deg);
103 | -ms-transform: rotate(-45deg);
104 | -webkit-transform: rotate(-45deg);
105 | }
106 |
107 | nav.searching li:after {
108 | display: none!important;
109 | }
110 | nav.searching li h4, nav.searching li ul {
111 | display: block!important;
112 | }
113 |
114 | nav.searching .parent {
115 | display: none;
116 | }
117 | nav.searching .parent ul li a {
118 | display: none;
119 | }
120 |
121 | nav.searching .parent.module-targeting {
122 | display: block;
123 | }
124 | nav.searching .parent.module-targeting ul li a {
125 | display: none;
126 | }
127 | nav.searching .parent.module-targeting ul li a.targeting {
128 | display: block;
129 | }
130 | nav.searching .parent.targeting ul li a {
131 | display: block;
132 | }
133 |
134 | nav>h2.custom>a {
135 | margin:12px 10px;
136 | }
--------------------------------------------------------------------------------
/jsdoc/static/styles/prettify.css:
--------------------------------------------------------------------------------
1 | .pln {
2 | color: #ddd;
3 | }
4 |
5 | /* string content */
6 | .str {
7 | color: #61ce3c;
8 | }
9 |
10 | /* a keyword */
11 | .kwd {
12 | color: #fbde2d;
13 | }
14 |
15 | /* a comment */
16 | .com {
17 | color: #aeaeae;
18 | }
19 |
20 | /* a type name */
21 | .typ {
22 | color: #8da6ce;
23 | }
24 |
25 | /* a literal value */
26 | .lit {
27 | color: #fbde2d;
28 | }
29 |
30 | /* punctuation */
31 | .pun {
32 | color: #ddd;
33 | }
34 |
35 | /* lisp open bracket */
36 | .opn {
37 | color: #000000;
38 | }
39 |
40 | /* lisp close bracket */
41 | .clo {
42 | color: #000000;
43 | }
44 |
45 | /* a markup tag name */
46 | .tag {
47 | color: #8da6ce;
48 | }
49 |
50 | /* a markup attribute name */
51 | .atn {
52 | color: #fbde2d;
53 | }
54 |
55 | /* a markup attribute value */
56 | .atv {
57 | color: #ddd;
58 | }
59 |
60 | /* a declaration */
61 | .dec {
62 | color: #EF5050;
63 | }
64 |
65 | /* a variable name */
66 | .var {
67 | color: #c82829;
68 | }
69 |
70 | /* a function name */
71 | .fun {
72 | color: #4271ae;
73 | }
74 |
75 | /* Specify class=linenums on a pre to get line numbering */
76 | ol.linenums {
77 | margin-top: 0;
78 | margin-bottom: 0;
79 | }
80 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/augments.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/example.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/examples.tmpl:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/exceptions.tmpl:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Type
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/layout.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Documentation
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/mainpage.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/members.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Type:
21 |
26 |
27 |
28 |
29 | Fires:
30 |
33 |
34 |
35 |
36 | Example 1? 's':'' ?>
37 |
38 |
39 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/method.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | Constructor
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Extends:
28 |
29 |
30 |
31 |
32 | Type:
33 |
38 |
39 |
40 |
41 | This:
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
57 | ()
58 | → {}
59 |
60 |
61 |
62 |
63 |
67 |
68 |
69 | Example 1? 's':'' ?>
70 |
71 |
72 |
73 |
74 |
75 | Requires:
76 |
79 |
80 |
81 |
82 | Fires:
83 |
86 |
87 |
88 |
89 | Listens to Events:
90 |
93 |
94 |
95 |
96 | Listeners of This Event:
97 |
100 |
101 |
102 |
103 | Throws:
104 | 1) { ?>
110 |
111 |
113 |
114 |
115 | Returns:
116 | 1) { ?>
122 |
123 |
125 |
126 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/params.tmpl:
--------------------------------------------------------------------------------
1 |
52 |
53 |
54 |
55 |
56 |
57 | Name
58 |
59 |
60 | Type
61 |
62 |
63 | Attributes
64 |
65 |
66 |
67 | Default
68 |
69 |
70 | Description
71 |
72 |
73 |
74 |
75 |
80 |
81 |
82 |
83 |
?
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | <nullable>
97 |
98 |
99 |
100 | <repeatable>
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | Properties
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/properties.tmpl:
--------------------------------------------------------------------------------
1 |
41 |
42 |
43 |
44 |
45 |
46 | Name
47 |
48 |
49 | Type
50 |
51 |
52 | Attributes
53 |
54 |
55 |
56 | Default
57 |
58 |
59 | Description
60 |
61 |
62 |
63 |
64 |
69 |
70 |
71 |
72 |
?
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | <nullable>
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | Properties
99 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/returns.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Type
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/source.tmpl:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/tutorial.tmpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0) { ?>
5 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/jsdoc/tmpl/type.tmpl:
--------------------------------------------------------------------------------
1 |
5 |
6 | |
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Daniel Wade",
3 | "contributors": [
4 | "Daniel Wade (https://github.com/iPzard)"
5 | ],
6 | "description": "Default components",
7 | "license": "MIT",
8 | "main": "dist/index.js",
9 | "module": "dist/index.modern.js",
10 | "name": "@default-services/components",
11 | "source": "src/index.js",
12 | "version": "2.0.2",
13 | "devDependencies": {
14 | "@babel/core": "^7.10.1",
15 | "@babel/plugin-proposal-async-generator-functions": "^7.10.1",
16 | "@babel/plugin-proposal-class-properties": "^7.10.1",
17 | "@babel/plugin-proposal-object-rest-spread": "^7.10.1",
18 | "@babel/plugin-transform-arrow-functions": "^7.10.1",
19 | "@babel/plugin-transform-async-to-generator": "^7.10.1",
20 | "@babel/plugin-transform-classes": "^7.10.1",
21 | "@babel/plugin-transform-computed-properties": "^7.10.1",
22 | "@babel/plugin-transform-destructuring": "^7.10.1",
23 | "@babel/plugin-transform-parameters": "^7.10.1",
24 | "@babel/plugin-transform-shorthand-properties": "^7.10.1",
25 | "@babel/plugin-transform-spread": "^7.10.1",
26 | "@babel/plugin-transform-sticky-regex": "^7.10.1",
27 | "@babel/plugin-transform-template-literals": "^7.10.1",
28 | "@babel/preset-env": "^7.10.2",
29 | "@babel/preset-react": "^7.10.0",
30 | "@rollup/plugin-alias": "^3.1.0",
31 | "@rollup/plugin-babel": "^5.0.2",
32 | "@rollup/plugin-commonjs": "^12.0.0",
33 | "@rollup/plugin-multi-entry": "^3.0.1",
34 | "@rollup/plugin-node-resolve": "^8.0.0",
35 | "@storybook/addon-actions": "^6.0.20",
36 | "@storybook/addon-links": "^6.0.20",
37 | "@storybook/addon-viewport": "^6.0.20",
38 | "@storybook/addons": "^6.0.20",
39 | "@storybook/preset-create-react-app": "^2.1.2",
40 | "@storybook/react": "^6.0.20",
41 | "autoprefixer": "^9.8.0",
42 | "babel-eslint": "^10.1.0",
43 | "babel-loader": "^8.1.0",
44 | "babel-preset-minify": "^0.5.1",
45 | "cross-env": "^7.0.2",
46 | "eslint": "^7.13.0",
47 | "eslint-config-airbnb": "^18.2.1",
48 | "eslint-plugin-import": "^2.22.1",
49 | "eslint-plugin-jsx-a11y": "^6.4.1",
50 | "eslint-plugin-react": "^7.21.5",
51 | "eslint-plugin-standard": "^4.0.1",
52 | "fiber": "^1.0.4",
53 | "gh-pages": "^2.2.0",
54 | "jake": "^10.7.1",
55 | "jsdoc": "^3.6.5",
56 | "node-sass": "^4.14.1",
57 | "npm-run-all": "^4.1.5",
58 | "postcss-preset-env": "^6.7.0",
59 | "prettier": "^2.0.4",
60 | "prop-types": "^15.7.2",
61 | "react-scripts": "^3.4.1",
62 | "regenerator-runtime": "^0.13.5",
63 | "rimraf": "^3.0.2",
64 | "rollup": "^2.11.2",
65 | "rollup-plugin-postcss": "^3.1.1",
66 | "sass": "^1.26.5",
67 | "typescript": "^3.9.3",
68 | "webpack": "^4.43.0"
69 | },
70 | "browserslist": [
71 | "defaults"
72 | ],
73 | "engines": {
74 | "node": ">= 10.16.0"
75 | },
76 | "files": [
77 | "dist"
78 | ],
79 | "keywords": [
80 | "components",
81 | "component",
82 | "react",
83 | "library",
84 | "default"
85 | ],
86 | "publishConfig": {
87 | "access": "public"
88 | },
89 | "repository": {
90 | "type": "git",
91 | "url": "https://github.com/default-services/components"
92 | },
93 | "scripts": {
94 | "build": "npx jake tasks:build",
95 | "build:all": "npx jake tasks:build",
96 | "build:docs": "jsdoc -c jsdoc.json",
97 | "build:project": "npx jake tasks:build project",
98 | "build:storybook": "npx jake tasks:build storybook",
99 | "clean": "npx jake tasks:clean",
100 | "clean:all": "npx jake tasks:clean",
101 | "clean:project": "npx jake tasks:clean project",
102 | "clean:storybook": "npx jake tasks:clean storybook",
103 | "start:project": "npx jake tasks:start project",
104 | "start:storybook": "npx jake tasks:start storybook"
105 | },
106 | "script-comments": {
107 | "build": "See `build:all` below",
108 | "build:all": "builds project and Storybook",
109 | "build:project": "builds project only (not Storybook)",
110 | "build:storybook": "builds Storybook",
111 | "clean": "See `clean:all` below",
112 | "clean:all": "cleans project and Storybook",
113 | "clean:project": "cleans project",
114 | "clean:storybook": "cleans Storybook",
115 | "start:project": "builds project and watches for changes",
116 | "start:storybook": "starts Storybook"
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import babel, { getBabelOutputPlugin } from '@rollup/plugin-babel';
2 |
3 | import alias from '@rollup/plugin-alias';
4 | import commonjs from '@rollup/plugin-commonjs';
5 | import multi from '@rollup/plugin-multi-entry';
6 | import postcss from 'rollup-plugin-postcss';
7 | import resolve from '@rollup/plugin-node-resolve';
8 |
9 | // Rollup alias paths
10 | const path = require('path');
11 |
12 | const assets = path.resolve(__dirname, './src/assets');
13 | const src = path.resolve(__dirname, './src');
14 | const utilities = path.resolve(__dirname, './src/utilities');
15 |
16 | // Post CSS plugins
17 | const postcssPresetEnv = require('postcss-preset-env');
18 | const autoprefixer = require('autoprefixer');
19 |
20 | // Babel config path
21 | const babelConfig = path.resolve(__dirname, '.babelrc');
22 |
23 | // Helper function to create config
24 | export default {
25 | input: 'src/components/**/*.js',
26 | output: [{
27 | name: 'default-component-library',
28 | sourcemap: true,
29 | file: 'dist/index.js',
30 | format: 'esm',
31 | globals: { react: 'React' }
32 | }],
33 | plugins: [
34 | alias({
35 | entries: [
36 | { find: 'assets', replacement: assets },
37 | { find: 'src', replacement: src },
38 | { find: 'utilities', replacement: utilities }
39 | ]
40 | }),
41 | babel({
42 | babelHelpers: 'bundled',
43 | compact: true,
44 | exclude: 'node_modules/**'
45 | }),
46 | commonjs(),
47 | getBabelOutputPlugin({ configFile: babelConfig }),
48 | multi(),
49 | postcss({
50 | extract: false,
51 | modules: true,
52 | plugins: [
53 | autoprefixer(),
54 | postcssPresetEnv({ stage: 0 })
55 | ],
56 | use: [ 'sass' ]
57 | }),
58 | resolve()
59 | ]
60 | };
--------------------------------------------------------------------------------
/src/assets/icons/ArrowLeftAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ArrowLeftAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ArrowLeftIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ArrowLeftIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ArrowUpAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ArrowUpAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ArrowUpIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ArrowUpIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/CheckAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const CheckAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/CheckIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const CheckIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronDownAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronDownAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronDownIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronDownIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronLeftAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronLeftAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronLeftIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronLeftIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronRightAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronRightAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronRightIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronRightIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronUpAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronUpAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/ChevronUpIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const ChevronUpIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/CloseAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const CloseAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/CloseIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const CloseIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/MenuAltIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const MenuAltIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/icons/MenuIcon.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const MenuIcon = props => {
4 | return (
5 |
6 | );
7 | };
--------------------------------------------------------------------------------
/src/assets/images/default-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/default-services/components/a87e6a0e4441d7e93993c063102cd379a27728d3/src/assets/images/default-logo.png
--------------------------------------------------------------------------------
/src/assets/scss/custom-properties.scss:
--------------------------------------------------------------------------------
1 | :root {
2 |
3 | // Main Colors
4 | --primary-color: #{$primary-color}; // Cadet Blue
5 | --primary-color-contrast: #{$primary-color-contrast};
6 | --primary-color-hover: #468787; // Paradiso
7 | --primary-color-focus: #386C6C; // Ming
8 | --secondary-color: #{$secondary-color}; // Apple Blossom
9 | --secondary-color-contrast: #{$secondary-color-contrast};
10 | --secondary-color-hover: #874646; // Lotus
11 | --secondary-color-focus: #6C3838; // Brown Sanguine
12 |
13 | // Light / Dark
14 | --white-color: #F5F5F5; // WhiteSmoke
15 | --black-color: #252525; // Nero
16 |
17 | // Greys
18 | --grey-color-light: #E7E7E7; // Whisper
19 | --grey-color-medium: #C3C3C3; // Silver
20 | --grey-color-dark: #484848; // Charcoal
21 |
22 | // Notices
23 | --notice-color: #BADCDC; // Powder Blue
24 | --warning-color: #F9E6AB; // Banana Mania
25 | --error-color: #E5C3C3; // Vanilla Ice
26 | --success-color: #C3E5C3; // Sea Mist
27 |
28 | // Box shadows
29 | --box-shadow-heavy: 1px 1px 6px 0px rgba(0,0,0,.25);
30 | --box-shadow-medium: 0px 1px 4px 0px rgba(0,0,0,.25);
31 | --box-shadow-light: 0 1px 1px 0px rgba(0,0,0,0.2);
32 |
33 | // Borders
34 | --border-radius: 4px;
35 | --border-radius-round: 50%;
36 | --border-radius-oval: 25px;
37 | --border-size: 2px;
38 | --border: solid var(--border-size) var(--grey-color-medium);
39 |
40 | // Fonts
41 | --primary-font: 'Nova Flat', monospace;
42 | --secondary-font: "Roboto", monospace;
43 |
44 | // Breakpoints
45 | --small-phone: #{$small-phone};
46 | --phone: #{$phone};
47 | --tablet: #{$tablet};
48 | --desktop: #{$desktop};
49 | --large-desktop: #{$large-desktop};
50 |
51 | // Input (radio/checkbox) size scale
52 | --input-size: 1.15rem;
53 |
54 | // Transitions
55 | --transition-speed-quick: .1s;
56 | --transition-speed-medium: .2s;
57 | --transition-speed-slow: .3s;
58 | --transition-animation-type: ease-in-out;
59 |
60 | // Transparency
61 | --transparent-slight: rgba(0,0,0,.15);
62 | --transparent-quarter: rgba(0,0,0,.25);
63 | --transparent-half: rgba(0,0,0,.5);
64 | --transparent-full: rgba(0,0,0,0);
65 | }
--------------------------------------------------------------------------------
/src/assets/scss/fonts.scss:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Nova Flat';
3 | font-style: normal;
4 | font-weight: 400;
5 | font-display: swap;
6 | src: local('Nova Flat'), local('NovaFlat'), url(https://fonts.gstatic.com/s/novaflat/v11/QdVUSTc-JgqpytEbVeb0viFl.woff2) format('woff2');
7 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
8 | }
9 |
10 | @font-face {
11 | font-family: 'Roboto';
12 | font-style: normal;
13 | font-weight: 400;
14 | font-display: swap;
15 | src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
16 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
17 | }
18 |
--------------------------------------------------------------------------------
/src/assets/scss/mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin primary-accessible-behavior {
2 | &:hover {
3 | color: var(--primary-color-hover);
4 | }
5 | &:focus {
6 | color: var(--primary-color-focus);
7 | }
8 | }
9 |
10 | @mixin secondary-accessible-behavior {
11 | &:hover {
12 | color: var(--secondary-color-hover);
13 | }
14 | &:focus {
15 | color: var(--secondary-color-focus);
16 | }
17 | }
18 |
19 | @mixin accessible-border-behavior {
20 | border: var(--border);
21 |
22 | &:hover, &:focus {
23 | outline: none;
24 | }
25 |
26 | &:not(li):hover {
27 | border: var(--border-size) solid var(--grey-color-dark);
28 | }
29 |
30 | li {
31 | &:hover {
32 | background-color: var(--grey-color-light);
33 | &:first-child {
34 | border-bottom: solid 1px var(--grey-color-dark);
35 | border-radius: var(--border-radius) var(--border-radius) 0 0;
36 |
37 | + li {
38 | border-top: solid 1px var(--grey-color-dark);
39 | }
40 | }
41 |
42 | &:not(:first-child):not(:last-child) {
43 | border-top: solid 2px var(--grey-color-dark);
44 | border-bottom: solid 1px var(--grey-color-dark);
45 | margin-top: -1px;
46 |
47 | + li {
48 | border-top: solid 1px var(--grey-color-dark);
49 | }
50 | }
51 |
52 | &:last-child {
53 | border-top: solid 2px var(--grey-color-dark);
54 | margin-top: -1px;
55 | border-radius: 0 0 var(--border-radius) var(--border-radius);
56 | }
57 | }
58 | }
59 |
60 | outline-color: var(--grey-color-dark);
61 | }
62 |
63 | @mixin input-label {
64 | display: grid;
65 | width: fit-content;
66 | grid-template-rows: 100%;
67 | grid-template-columns: 1fr 9fr;
68 | align-items: center;
69 | cursor: pointer;
70 |
71 | span:first-child {
72 | user-select: none;
73 | grid-column: 2;
74 | grid-row: 1;
75 | }
76 |
77 | input {
78 | grid-column: 1;
79 | grid-row: 1;
80 |
81 | + span, + svg {
82 | grid-column: 1;
83 | grid-row: 1;
84 | }
85 | }
86 | }
87 |
88 | @mixin mask {
89 | background: rgba(0,0,0,.1);
90 | top: 0;
91 | right: 0;
92 | bottom: 0;
93 | left: 0;
94 | touch-action: none;
95 | }
--------------------------------------------------------------------------------
/src/assets/scss/styles.module.scss:
--------------------------------------------------------------------------------
1 | // Utilities (order dependant)
2 | @import 'src/assets/scss/fonts.scss';
3 | @import 'src/assets/scss/functions.scss';
4 | @import 'src/assets/scss/variables.scss';
5 | @import 'src/assets/scss/custom-properties.scss';
6 | @import 'src/assets/scss/type-scale.scss';
7 | @import 'src/assets/scss/mixins.scss';
8 |
9 | // Component Sass files (allows access to prior file data above ↑)
10 | @import 'src/components/avatar/Avatar.scss';
11 | @import 'src/components/button/Button.scss';
12 | @import 'src/components/checkbox/Checkbox.scss';
13 | @import 'src/components/container/Container.scss';
14 | @import 'src/components/footer/Footer.scss';
15 | @import 'src/components/input/Input.scss';
16 | @import 'src/components/loader/Loader.scss';
17 | @import 'src/components/navbar/Navbar.scss';
18 | @import 'src/components/notice/Notice.scss';
19 | @import 'src/components/pages/404/FileNotFound.scss';
20 | @import 'src/components/pagination/PaginationList.scss';
21 | @import 'src/components/radiobutton/RadioButton.scss';
22 | @import 'src/components/select/Select.scss';
23 | @import 'src/components/switch/Switch.scss';
24 | @import 'src/components/totop/ToTop.scss';
--------------------------------------------------------------------------------
/src/assets/scss/type-scale.scss:
--------------------------------------------------------------------------------
1 | // Type scale configuration
2 |
3 | :root {
4 | --base-size: 1rem;
5 | --type-scale: 1.125;
6 | --header-font-family: var(--primary-font);
7 | --paragraph-primary-font-family: var(--primary-font);
8 | --paragraph-secondary-font-family: var(--secondary-font);
9 | --header-font-color: var(--primary-color);
10 |
11 | // Calculate and create H1-H6 custom properties
12 | @for $i from 1 through 5 {
13 | @if $i == 1 { --h5: calc(var(--base-size) * var(--type-scale)); }
14 | @else { --h#{6 - $i}: calc(var(--h#{7 - $i}) * var(--type-scale)); }
15 |
16 | h#{$i} { font-size: var(--h#{$i}); }
17 | }
18 |
19 | // Allow for responsive behavior
20 | // Custom properties don't work
21 | // must use Sass variables instead
22 | @media (min-width: $small-phone) {
23 | --type-scale: 1.1;
24 | }
25 |
26 | @media (min-width: $phone) {
27 | --type-scale: 1.125;
28 | }
29 |
30 | @media (min-width: $tablet) {
31 | --type-scale: 1.15;
32 | }
33 |
34 | @media (min-width: $desktop) {
35 | --type-scale: 1.175;
36 | }
37 |
38 | @media (min-width: $large-desktop) {
39 | --type-scale: 1.2;
40 | }
41 | }
42 |
43 | // Setting type scale
44 | body {
45 | font-family: var(--primary-font);
46 |
47 | // Left out of type scale loop to prevent
48 | // repeating declarations of all properties
49 | // for each header
50 | h1, h2, h3, h4, h5, h6 {
51 | font-weight: var(--font-weight);
52 | font-family: var(--header-font-family);
53 | color: var(--header-font-color);
54 | margin-top: 1rem;
55 |
56 | // Type scale when page is being printed
57 | @media print {
58 | font-size: 1rem;
59 | --header-font-family: Arial, Helvetica, Serif;
60 | --paragraph-primary-font-family: Arial, Helvetica, Serif;
61 | --paragraph-secondary-font-family: Arial, Helvetica, Serif;
62 | --header-font-color: black;
63 | }
64 | }
65 |
66 | // Type scale for common elements
67 | p {
68 | font-family: var(--paragraph-secondary-font-family);
69 | font-size: calc(var(--base-size) * var(--type-scale));
70 | margin-bottom: 1.25rem;
71 | }
72 |
73 | a {
74 | color: var(--primary-color);
75 |
76 | &:hover {
77 | color: var(--primary-color-hover);
78 | }
79 |
80 | &:active, &:focus {
81 | color: var(--primary-color-focus);
82 | }
83 | }
84 | }
--------------------------------------------------------------------------------
/src/assets/scss/variables.scss:
--------------------------------------------------------------------------------
1 | // Sass variables and custom properties are both computed differently
2 | // this makes having both available useful if in some cases. For example
3 | // Custom properties can't be used in Sass functions or as media query
4 | // breakpoints. Using Sass to work around these areas.
5 |
6 | // Colors
7 | $primary-color: #57A9A9; // Cadet Blue
8 | $primary-color-contrast: choose-contrast-color($primary-color);
9 | $secondary-color:#A95757; // Apple Blossom
10 | $secondary-color-contrast: choose-contrast-color($secondary-color);
11 |
12 | // Media breakpoints
13 | $small-phone: 380px;
14 | $phone: 480px;
15 | $tablet: 768px;
16 | $desktop: 960px;
17 | $large-desktop: 1200px;
--------------------------------------------------------------------------------
/src/components/avatar/Avatar.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace Avatar
8 | * @description Avatar component. For example, to be represent a user.
9 | * @property {string} variant - Variant of avatar to use (e.g., "large", "medium", or "small").
10 | * @property {children} - Image to use as avatar.
11 | * @tutorial `src\stories\Avatar.stories.js`.
12 | */
13 |
14 | export const Avatar = (props) => {
15 | const {
16 | children,
17 | ...componentProps
18 | } = props;
19 |
20 | return (
21 |
22 | { children }
23 |
24 | );
25 | };
26 |
27 | Avatar.propTypes = {
28 | children: PropTypes.node.isRequired
29 | };
--------------------------------------------------------------------------------
/src/components/avatar/Avatar.scss:
--------------------------------------------------------------------------------
1 | .avatar {
2 |
3 | border: solid 1px var(--grey-color-medium);
4 | border-radius: var(--border-radius-round);
5 | box-shadow: var(--box-shadow-heavy);
6 | overflow: hidden;
7 |
8 | // Any/all children
9 | * {
10 | max-width: 100%;
11 | }
12 |
13 | @mixin size($avatar-size, $margin-left) {
14 | width: $avatar-size;
15 | height: $avatar-size;
16 |
17 | img {
18 | padding-left: $margin-left;
19 | margin-bottom: -3px;
20 | }
21 | }
22 |
23 | // Default
24 | @include size(75px, .09rem);
25 |
26 | &[variant="large"] {
27 | @include size(100px, .125rem);
28 | }
29 |
30 | &[variant="medium"] {
31 | @include size(50px, .075rem);
32 | box-shadow: var(--box-shadow-medium);
33 | }
34 |
35 | &[variant="small"] {
36 | @include size(25px, .05rem);
37 | box-shadow: var(--box-shadow-medium);
38 | }
39 | }
--------------------------------------------------------------------------------
/src/components/button/Button.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace Button
8 | * @description Default styled button component.
9 | * @property {string} componentProps.variant - Variant of button to use (e.g., "round").
10 | * @property {children} - Child elements to nest in button.
11 | * @property {string} variant - Variant of button to use (e.g., "large" or "round").
12 | * @tutorial `src\stories\Button.stories.js`.
13 | */
14 |
15 | export const Button = (props) => {
16 | const {
17 | children,
18 | variant,
19 | ...componentProps
20 | } = props;
21 |
22 | let buttonClassName;
23 | switch (variant) {
24 | case 'large':
25 | buttonClassName = styles['button-large'];
26 | break;
27 |
28 | case 'large-round':
29 | buttonClassName = styles['button-large-round'];
30 | break;
31 |
32 | case 'round':
33 | buttonClassName = styles['button-round'];
34 | break;
35 |
36 | default:
37 | buttonClassName = styles.button;
38 | break;
39 | }
40 |
41 |
42 | return (
43 |
48 | { children }
49 |
50 | );
51 | };
52 |
53 | Button.propTypes = {
54 | children: PropTypes.any.isRequired,
55 | variant: PropTypes.string
56 | };
57 |
58 | Button.defaultProps = {
59 | variant: ''
60 | };
--------------------------------------------------------------------------------
/src/components/button/Button.scss:
--------------------------------------------------------------------------------
1 | .button {
2 | padding: .5rem 1.2rem .5rem;
3 | border-radius: var(--border-radius);
4 | text-decoration: none;
5 | background-color: var(--primary-color);
6 | color: var(--primary-color-contrast);
7 | box-shadow: var(--box-shadow-heavy);
8 | text-decoration: none;
9 | user-select: none;
10 | cursor: pointer;
11 |
12 | &:hover, &:active, &:focus {
13 | color: var(--primary-color-contrast);
14 | }
15 |
16 | &:active, &:focus {
17 | background-color: var(--primary-color-focus);
18 | }
19 |
20 | @media(max-width: $phone) {
21 | font-size: 1rem;
22 | padding: .5rem 1.25rem .5rem;
23 | margin: 0 .5rem;
24 | }
25 | }
26 |
27 | .button-round {
28 | @extend .button;
29 |
30 | border-radius: var(--border-radius-oval);
31 | }
32 |
33 | .button-large {
34 | @extend .button;
35 |
36 | display: flex;
37 | justify-content: center;
38 | width: 320px;
39 | padding: 0.65rem 0;
40 | }
41 |
42 | .button-large-round {
43 | @extend .button-round;
44 | @extend .button-large;
45 | }
--------------------------------------------------------------------------------
/src/components/checkbox/Checkbox.js:
--------------------------------------------------------------------------------
1 | import { CheckAltIcon } from 'src/assets/icons/CheckAltIcon';
2 | import { CheckIcon } from 'src/assets/icons/CheckIcon';
3 | import PropTypes from 'prop-types';
4 | import React from 'react';
5 | import setClassName from 'utilities/setClassName';
6 | import styles from 'src/assets/scss/styles.module.scss';
7 |
8 | /**
9 | * @namespace Checkbox
10 | * @description Default styled checkbox component.
11 | * @property {string} label - Label (text) for checkbox.
12 | * @property {string} type - If provided, discarded and replaced with "checkbox".
13 | * @property {string} variant - Variant of checkbox to use (e.g., "alt-icons").
14 | * @tutorial `src\stories\Checkbox.stories.js`.
15 | */
16 |
17 | export const Checkbox = (props) => {
18 | const {
19 | className, // Intentionally excluded from inputProps
20 | label,
21 | type,
22 | variant,
23 | ...inputProps
24 | } = props;
25 |
26 | if (type && type !== 'checkbox') { return console.warn(
27 | `\`Checkbox\` can only accept a \`type\` prop of "checkbox". Received "${props.type}", which was discarded and replaced by "checkbox".`
28 | ); }
29 |
30 | return (
31 |
32 | { label || '' }
33 |
34 | { variant === 'alt-icons' ? : }
35 |
36 | );
37 | };
38 |
39 | Checkbox.propTypes = {
40 | className: PropTypes.string,
41 | label: PropTypes.string,
42 | type: PropTypes.string,
43 | variant: PropTypes.string
44 | };
45 |
46 | Checkbox.defaultProps = {
47 | className: '',
48 | label: '',
49 | type: '',
50 | variant: ''
51 | };
--------------------------------------------------------------------------------
/src/components/checkbox/Checkbox.scss:
--------------------------------------------------------------------------------
1 | .checkbox {
2 |
3 | @include input-label;
4 | font-family: var(--primary-font);
5 |
6 | * {
7 | font-family: inherit;
8 | }
9 |
10 | input {
11 | border-radius: var(--border-radius);
12 | appearance: none;
13 | outline: none;
14 | width: var(--input-size);
15 | height: var(--input-size);
16 | transition: var(--transition-speed-quick);
17 | cursor: pointer;
18 | margin-right: .5rem;
19 |
20 | @include accessible-border-behavior;
21 |
22 | + svg {
23 | transition: var(--transition-speed-quick);
24 | pointer-events: none;
25 | width: .85rem;
26 | margin-left: .4rem;
27 | margin-top: .35rem;
28 | position: absolute;
29 | border-radius: calc(var(--border-radius) - 2px);
30 | color: rgba(0,0,0,0);
31 | position: absolute;
32 | }
33 |
34 | &:checked {
35 | background-color: var(--primary-color);
36 | + svg {
37 | color: var(--primary-color-contrast);
38 | visibility: visible;
39 | }
40 | }
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/src/components/container/Container.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace Container
8 | * @description Default styled container component.
9 | * @tutorial `src\stories\Container.stories.js`.
10 | */
11 | export const Container = (props) => {
12 |
13 | const {
14 | children,
15 | ...componentProps
16 | } = props;
17 |
18 | return (
19 |
25 | );
26 | };
27 |
28 | Container.propTypes = {
29 | children: PropTypes.any.isRequired
30 | };
--------------------------------------------------------------------------------
/src/components/container/Container.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | max-width: 1280px;
3 | margin: 0 auto;
4 | padding: 1rem;
5 | font-family: var(--primary-font);
6 |
7 | * {
8 | font-family: inherit;
9 | }
10 | }
--------------------------------------------------------------------------------
/src/components/footer/Footer.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace Footer
8 | * @description Default styled footer component.
9 | * @tutorial `src\stories\Footer.stories.js`.
10 | */
11 |
12 | export const Footer = (props) => {
13 | const {
14 | children,
15 | ...componentProps
16 | } = props;
17 |
18 | return (
19 |
22 | );
23 | };
24 |
25 | Footer.propTypes = {
26 | children: PropTypes.element.isRequired
27 | };
--------------------------------------------------------------------------------
/src/components/footer/Footer.scss:
--------------------------------------------------------------------------------
1 | .footer {
2 | display: flex;
3 | justify-content: center;
4 | align-items: center;
5 | background-color: var(--primary-color);
6 | color: var(--white-color);
7 | width: 100vw;
8 | min-height: 4rem;
9 | font-family: var(--primary-font);
10 |
11 | * {
12 | font-family: inherit;
13 | }
14 | }
--------------------------------------------------------------------------------
/src/components/input/Input.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace Input
8 | * @description Default styled input component.
9 | * @property {string} type - If provided, is reviewed for validity with this component.
10 | * @property {string} variant - Variant of input to use (e.g., "large").
11 | * @tutorial `src\stories\Input.stories.js`.
12 | */
13 | export const Input = (props) => {
14 | const {
15 | className,
16 | variant,
17 | ...inputProps
18 | } = props;
19 |
20 | // Error for invalid `type` props
21 | const error = (component) => (
22 | console.error(`Type "${props.type}" used for the \`Input\` component, use the \`${component}\` component instead.`)
23 | );
24 |
25 | // Set input class name
26 | let inputClassName;
27 | switch (variant) {
28 | case 'large':
29 | inputClassName = styles['input-large'];
30 | break;
31 |
32 | default:
33 | inputClassName = styles.input;
34 | break;
35 | }
36 |
37 | // Check for wrong types, only return component if valid
38 | switch (props.type) {
39 | case 'radio':
40 | return error('RadioButton');
41 |
42 | case 'checkbox':
43 | return error('Checkbox');
44 |
45 | default:
46 | return (
47 |
48 |
49 |
50 | );
51 | }
52 | };
53 |
54 | Input.propTypes = {
55 | className: PropTypes.string,
56 | type: PropTypes.string,
57 | variant: PropTypes.string
58 | };
59 |
60 | Input.defaultProps = {
61 | className: '',
62 | type: '',
63 | variant: ''
64 | };
65 |
--------------------------------------------------------------------------------
/src/components/input/Input.scss:
--------------------------------------------------------------------------------
1 | .input {
2 |
3 | input {
4 | padding: 5px 8px;
5 | border: solid var(--border-size) var(--grey-color-medium);
6 | border-radius: var(--border-radius);
7 | font-family: var(--primary-font);
8 |
9 | @include accessible-border-behavior;
10 | }
11 |
12 | }
13 |
14 | .input-large {
15 | @extend .input;
16 |
17 | input {
18 | width: 300px;
19 | height: 40px;
20 | padding: 0 8px;
21 | font-size: 1em;
22 | }
23 | }
--------------------------------------------------------------------------------
/src/components/loader/Loader.js:
--------------------------------------------------------------------------------
1 | import { AtomicSpinner } from 'src/components/loader/atomic/AtomicSpinner';
2 | import { BouncySpinner } from 'src/components/loader/bouncy/BouncySpinner';
3 | import { DefaultSpinner } from 'src/components/loader/default/DefaultSpinner';
4 | import PropTypes from 'prop-types';
5 | import React from 'react';
6 | import styles from 'src/assets/scss/styles.module.scss';
7 |
8 | /**
9 | * @namespace Loader
10 | * @description Default styled loader component.
11 | * @property {boolean} [show=false] - determines whether or not to show component.
12 | * @property {string} variant - variant type of Loader to use.
13 | *
14 | * @tutorial `src\stories\Loader.stories.js`.
15 | */
16 | export const Loader = (props) => {
17 |
18 | const {
19 | show = false,
20 | variant,
21 | ...loaderProps
22 | } = props;
23 |
24 | const Spinner = () => {
25 | switch (variant) {
26 | case 'atomic':
27 | return ;
28 |
29 | case 'bouncy':
30 | return ;
31 |
32 | case 'default':
33 | default:
34 | return ;
35 | }
36 | };
37 |
38 | return show ? (
39 |
40 |
41 |
42 | ) : null;
43 | };
44 |
45 | Loader.propTypes = {
46 | show: PropTypes.bool,
47 | variant: PropTypes.string
48 | };
49 |
50 | Loader.defaultProps = {
51 | show: false,
52 | variant: ''
53 | };
--------------------------------------------------------------------------------
/src/components/loader/Loader.scss:
--------------------------------------------------------------------------------
1 | .loader-container {
2 | cursor: not-allowed;
3 | position: fixed;
4 | top: 0;
5 | right: 0;
6 | bottom: 0;
7 | left: 0;
8 | background-color: var(--transparent-slight);
9 | display: flex;
10 | justify-content: center;
11 | align-items: center;
12 | z-index: 9991;
13 | }
--------------------------------------------------------------------------------
/src/components/loader/atomic/AtomicSpinner.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import setClassName from 'utilities/setClassName';
3 | import styles from 'src/components/loader/atomic/AtomicSpinner.module.scss';
4 |
5 | /**
6 | * @namespace AtomicSpinner
7 | * @description Atomic variant loader component.
8 | * @tutorial `src\stories\Loader.stories.js`.
9 | *
10 | * @memberof Loader
11 | */
12 | export const AtomicSpinner = (props) => {
13 |
14 | return (
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | );
57 | };
--------------------------------------------------------------------------------
/src/components/loader/atomic/AtomicSpinner.module.scss:
--------------------------------------------------------------------------------
1 | .atomic-spinner {
2 | width: 100px;
3 | height: 100px;
4 |
5 | circle {
6 | color: var(--secondary-color);
7 | }
8 |
9 | use {
10 | color: var(--grey-color-dark);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/components/loader/bouncy/BouncySpinner.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import setClassName from 'utilities/setClassName';
3 | import styles from 'src/components/loader/bouncy/BouncySpinner.module.scss';
4 |
5 | /**
6 | * @namespace BouncySpinner
7 | * @description Bouncy variant loader component.
8 | * @tutorial `src\stories\Loader.stories.js`.
9 | *
10 | * @memberof Loader
11 | */
12 | export const BouncySpinner = (props) => {
13 |
14 | return (
15 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | );
35 | };
--------------------------------------------------------------------------------
/src/components/loader/bouncy/BouncySpinner.module.scss:
--------------------------------------------------------------------------------
1 | .bouncy-spinner {
2 | width: 100px;
3 | height: 100px;
4 |
5 | circle:first-child {
6 | color: var(--primary-color);
7 | }
8 |
9 | circle:last-child {
10 | color: var(--secondary-color);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/components/loader/default/DefaultSpinner.module.scss:
--------------------------------------------------------------------------------
1 | .default-spinner {
2 | width: 100px;
3 | height: 100px;
4 |
5 | g {
6 | color: var(--primary-color);
7 | }
8 | }
--------------------------------------------------------------------------------
/src/components/notice/Notice.scss:
--------------------------------------------------------------------------------
1 | $notice-border-radius: var(--border-radius) var(--border-radius) 0 0;
2 | $notice-backing-border-radius: calc(#{var(--border-radius)} + 2px)
3 | calc(#{var(--border-radius)} + 2px)
4 | var(--border-radius)
5 | var(--border-radius);
6 |
7 | .notice {
8 | min-height: 125px;
9 | background: var(--white-color);
10 | border: var(--border);
11 | border-radius: var(--border-radius);
12 | box-shadow: var(--box-shadow-medium);
13 | border-radius: $notice-backing-border-radius;
14 | margin-top: 5rem;
15 | width: 400px;
16 | @media (max-width: 420px) {
17 | width: calc(100vw - 40px);
18 | }
19 |
20 | header {
21 | display: flex;
22 | justify-content: space-between;
23 | padding: .75rem 1rem .75rem .75rem;
24 | background-color: var(--primary-color);
25 | border-radius: $notice-border-radius;
26 | border: solid 1px var(--primary-color);
27 | border-bottom: none;
28 |
29 | h5 {
30 | color: var(--primary-color-contrast);
31 | margin: 0;
32 | }
33 | }
34 |
35 | article {
36 | display: grid;
37 | padding: .75rem 1rem 1rem .75rem;
38 |
39 | p {
40 | margin: 0;
41 | font-size: 1rem;
42 | color: var(--black-color);
43 | text-align: left;
44 | }
45 |
46 | article {
47 | display: flex;
48 | justify-content: flex-end;
49 | flex-wrap: wrap;
50 | padding-left: 0;
51 |
52 | // Default Input
53 | label[class*='input'] {
54 | width: 100%;
55 |
56 | input {
57 | width: calc(100% - 1.25rem);
58 | margin: .75rem 0 -10px;
59 | padding: .5rem;
60 | padding-right: 1.25rem;
61 | }
62 | }
63 |
64 | // Default Buttons
65 | a[class*='button'] {
66 | margin-top: 2rem;
67 | margin-left: 1.5rem;
68 | margin-bottom: -1rem;
69 | }
70 | }
71 |
72 | }
73 |
74 | svg {
75 | width: 1.15rem;
76 | cursor: pointer;
77 | color: var(--primary-color-contrast);
78 | margin-top: -1rem;
79 | margin-right: -.7rem;
80 | }
81 | }
82 |
83 | .notice-mask {
84 | @include mask;
85 | position: fixed;
86 | display: flex;
87 | justify-content: center;
88 | align-items: baseline;
89 | z-index: 9991;
90 | }
--------------------------------------------------------------------------------
/src/components/pages/404/FileNotFound.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace FileNotFound
8 | * @description Default styled 404 page component.
9 | * @tutorial `src\stories\Pages.stories.js`.
10 | */
11 |
12 | export class FileNotFound extends Component {
13 | state = {
14 | 0: 0,
15 | 1: 0,
16 | 2: 0
17 | };
18 |
19 | componentDidMount() {
20 | const randomNum = () => {
21 | return Math.floor(Math.random() * 9) + 1;
22 | };
23 |
24 | const loopOne = setInterval(() => this.setState({ 0: randomNum() }), 30);
25 | const loopTwo = setInterval(() => this.setState({ 1: randomNum() }), 30);
26 | const loopThree = setInterval(() => this.setState({ 2: randomNum() }), 30);
27 |
28 | setTimeout(() => {
29 | const clearIt = (interval, digit, time, value) => {
30 | setTimeout(() => {
31 | clearInterval(interval);
32 | this.setState({ [digit]: value });
33 | }, time);
34 | };
35 |
36 | clearIt(loopOne, 0, 40, 4);
37 | clearIt(loopTwo, 1, 80, 0);
38 | clearIt(loopThree, 2, 100, 4);
39 | }, 1000);
40 | }
41 |
42 | render() {
43 | const { props, state: numbers } = this;
44 | return (
45 |
46 |
47 |
48 | {numbers[2]}
49 |
50 |
51 |
52 | {numbers[1]}
53 |
54 |
55 |
56 | {numbers[2]}
57 |
58 |
59 |
Page not found
60 |
61 |
62 | );
63 | }
64 | }
--------------------------------------------------------------------------------
/src/components/pages/404/FileNotFound.scss:
--------------------------------------------------------------------------------
1 | .file-not-found {
2 |
3 | display: flex;
4 | flex-wrap: wrap;
5 | justify-content: center;
6 | text-align: center;
7 | align-items: flex-end;
8 | margin-top: 10em;
9 |
10 | h2 {
11 | font-size: 32px;
12 | color: var(--primary-color);
13 | font-weight: bold;
14 | padding-bottom: 20px;
15 | }
16 |
17 | > div {
18 | width: 540px;
19 |
20 | > div {
21 | display: inline-block;
22 |
23 | span {
24 | color: var(--white-color);
25 | background: var(--primary-color);
26 | border-radius: 50%;
27 | display: inline-block;
28 | width: 150px;
29 | line-height: 150px;
30 | font-size: 120px;
31 | font-weight: bold;
32 | margin: 15px;
33 |
34 | @media(max-width: 615px) {
35 | width: 100px;
36 | line-height: 100px;
37 | font-size: 65px;
38 | margin: 10px;
39 | }
40 |
41 | @media(max-width: 400px) {
42 | width: 78px;
43 | line-height: 78px;
44 | font-size: 55px;
45 | margin: 8px;
46 | }
47 |
48 | }
49 | }
50 | }
51 |
52 | @media(max-width: $tablet) {
53 |
54 | h2 {
55 | font-size: 24px;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/components/pagination/PaginationList.scss:
--------------------------------------------------------------------------------
1 | .pagination-list {
2 |
3 | ul + article {
4 | display: flex;
5 | flex-wrap: wrap;
6 | justify-content: center;
7 | align-items: center;
8 |
9 | span {
10 | cursor: pointer;
11 | margin: .4rem;
12 | background: var(--primary-color);
13 | color: var(--primary-color-contrast);
14 | font-size: .8rem;
15 | padding: .4rem .3rem;
16 | display: flex;
17 | justify-content: center;
18 | align-items: center;
19 | border-radius: var(--border-radius);
20 | min-width: 1.25rem;
21 |
22 | &[data-active="true"] {
23 | background: var(--primary-color-focus);
24 | }
25 |
26 | @include accessible-border-behavior;
27 | }
28 | }
29 |
30 | ul[variant="round"] + article span {
31 | //padding: .3rem .4rem;
32 | border-radius: var(--border-radius-round);
33 | @include accessible-border-behavior;
34 | }
35 | }
--------------------------------------------------------------------------------
/src/components/radiobutton/RadioButton.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import setClassName from 'utilities/setClassName';
4 | import styles from 'src/assets/scss/styles.module.scss';
5 |
6 | /**
7 | * @namespace RadioButton
8 | * @description Default styled radio button component.
9 | * @property {string} type - If provided, is discarded and "radio" is used.
10 | * @property {string} text - Radio button text.
11 | * @property {string} variant - Radio button variant to use (e.g., "alt-icons").
12 | * @tutorial `src\stories\Radio.stories.js`
13 | */
14 |
15 | export const RadioButton = (props) => {
16 | const {
17 | className,
18 | text,
19 | type,
20 | ...inputProps
21 | } = props;
22 |
23 | if (type && type !== 'radio') { return console.warn(
24 | `\`RadioButton\` can only accept a \`type\` prop of "radio". Received "${props.type}", which was discarded and replaced by "radio".`
25 | ); }
26 |
27 | return (
28 |
29 | { text || '' }
30 |
31 |
32 |
33 | );
34 | };
35 |
36 | RadioButton.propTypes = {
37 | className: PropTypes.string,
38 | text: PropTypes.string,
39 | type: PropTypes.string
40 | };
41 |
42 | RadioButton.defaultProps = {
43 | className: '',
44 | text: '',
45 | type: ''
46 | };
--------------------------------------------------------------------------------
/src/components/radiobutton/RadioButton.scss:
--------------------------------------------------------------------------------
1 | .radio-button {
2 | @include input-label;
3 |
4 | input {
5 | appearance: none;
6 | border-radius: var(--border-radius-round);
7 | width: var(--input-size);
8 | height: var(--input-size);
9 | border: solid var(--border-size) var(--grey-color-medium);
10 | transition: var(--transition-speed-quick) background-color var(--transition-animation-type);
11 | cursor: pointer;
12 | margin: .01rem;
13 | margin-right: .5rem;
14 |
15 |
16 | &:checked {
17 | cursor: default;
18 |
19 | + span {
20 | pointer-events: none;
21 | border-radius: var(--border-radius-round);
22 | position: absolute;
23 | margin: .325rem;
24 | background-color: var(--primary-color);
25 | width: calc(1.15rem - 10px);
26 | height: calc(1.15rem - 10px);
27 | }
28 | }
29 |
30 | &[variant="filled"] {
31 |
32 | &:checked {
33 | background-color: var(--primary-color);
34 |
35 | + span {
36 | background-color: var(--white-color);
37 | width: 5px;
38 | height: 5px;
39 | position: relative;
40 | margin-left: .425rem;
41 | }
42 | }
43 | }
44 |
45 | @include accessible-border-behavior;
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/src/components/select/Select.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import { ChevronDownAltIcon } from 'assets/icons/ChevronDownAltIcon';
4 | import { ChevronDownIcon } from 'assets/icons/ChevronDownIcon';
5 | import PropTypes from 'prop-types';
6 | import setClassName from 'utilities/setClassName';
7 | import styles from 'src/assets/scss/styles.module.scss';
8 |
9 | /**
10 | * @namespace Select
11 | * @description Default styled select drop down component.
12 | * @property {Array.} options - Array of strings that are select options.
13 | * @property {string} title - Placeholder title for select drop down.
14 | * @property {string} variant - Variant of select component to use (e.g., "alt-icons").
15 | * @tutorial `src\stories\Select.stories.js`
16 | */
17 | export class Select extends Component {
18 |
19 | state = {
20 | currentOption: this.props.title,
21 | showOptions: false
22 | };
23 |
24 | render() {
25 |
26 | const {
27 | props: {
28 | options,
29 | variant = ''
30 | },
31 | state: {
32 | currentOption,
33 | showOptions
34 | }
35 | } = this;
36 |
37 | // Helps determine the longest option which allows CSS
38 | // calculations to be made utilizing the "ch" (character) unit
39 | const longestOptionWidth = options.reduce((acc, option) => {
40 | if (option.length > acc) acc = option.length;
41 | return acc;
42 | }, 0);
43 |
44 | // Toggle displaying the options
45 | const handleDropdownClick = () => this.setState({ showOptions: !this.state.showOptions });
46 |
47 | // Switch selected option to current option
48 | const handleOptionClick = (option) => {
49 | this.setState({
50 | currentOption: option,
51 | showOptions: false
52 | });
53 | };
54 |
55 | // Configure option padding based on longest option width
56 | const setOptionStyles = (option) => {
57 | const paddingRight = `calc(${`${longestOptionWidth - option.length + 4}ch`} + 1.2rem)`;
58 | return { paddingRight };
59 | };
60 |
61 | // Unorganized List of options provided from props
62 | const optionList = (
63 |
64 | {
65 | options.map((option, index) => {
66 | const key = `${option.replace(/ /g, '-')}-${index}`;
67 |
68 | return (
69 | handleOptionClick(option) }
72 | style={ setOptionStyles(option) }
73 | title={ option }
74 | >
75 | { option }
76 |
77 | );
78 | })
79 | }
80 |
81 | );
82 |
83 | const ChevronDown = (props) => (variant.includes('alt-icons')
84 | ?
85 | : );
86 |
87 | return (
88 |
89 |
90 |
95 |
98 | { currentOption }
99 |
100 | |
101 |
102 |
103 |
104 | { showOptions ? optionList : undefined }
105 |
106 | );
107 | }
108 | }
109 |
110 | Select.propTypes = {
111 | options: PropTypes.array.isRequired,
112 | title: PropTypes.string.isRequired,
113 | variant: PropTypes.string
114 | };
115 |
116 | Select.defaultProps = {
117 | variant: ''
118 | };
--------------------------------------------------------------------------------
/src/components/select/Select.scss:
--------------------------------------------------------------------------------
1 | .select {
2 |
3 | border-radius: var(--border-radius);
4 | cursor: pointer;
5 | width: fit-content;
6 |
7 | div {
8 | border: var(--border);
9 | width: fit-content;
10 | padding: .25rem .85rem;
11 | border-radius: var(--border-radius);
12 | display: grid;
13 | grid-template-rows: 100%;
14 | grid-template-columns: 90% 5% 5%;
15 | min-height: 1.25rem;
16 | @include accessible-border-behavior;
17 |
18 | span {
19 | display: grid;
20 | align-items: center;
21 |
22 | + span {
23 | margin-left: -15px;
24 | color: var(--primary-color);
25 | font-size: 1.25rem;
26 | height: 1px;
27 | }
28 | }
29 |
30 | svg {
31 | width: 1.5rem;
32 | color: var(--primary-color);
33 | transition: transform var(--transition-speed-quick);
34 | margin-top: 1px;
35 | margin-left: -10px;
36 | }
37 | }
38 |
39 | ul {
40 | list-style: none;
41 | width: fit-content;
42 | border: var(--border);
43 | border-radius: var(--border-radius);
44 | margin-top: 8px;
45 | background-color: var(--white-color);
46 | color: var(--black-color);
47 | padding-left: 0;
48 | padding-top: 0;
49 | @include accessible-border-behavior;
50 |
51 | li {
52 | padding: .5rem 1.5rem .5rem .85rem;
53 | border-top: solid 1px var(--grey-color-medium);
54 | border-bottom: solid 1px var(--grey-color-medium);
55 | &:first-child {
56 | border-top: none;
57 | }
58 | &:last-child {
59 | border-bottom: none;
60 | }
61 | &:hover {
62 | background-color: var(--grey-color-light);
63 | }
64 | }
65 |
66 | }
67 | }
--------------------------------------------------------------------------------
/src/components/switch/Switch.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import PropTypes from 'prop-types';
4 | import setClassName from 'utilities/setClassName';
5 | import styles from 'src/assets/scss/styles.module.scss';
6 |
7 | /**
8 | * @namespace Switch
9 | * @description Default styled switch/toggle component.
10 | * @property {function} onClick - Parent onClick function.
11 | *
12 | * @tutorial `src\stories\Switch.stories.js`
13 | */
14 |
15 | export class Switch extends Component {
16 | state = { status: false };
17 |
18 | toggle = (callback) => this.setState({ status: !this.state.status }, () => callback || null);
19 |
20 | handleClick = () => this.toggle(this.props.onClick());
21 |
22 | render() {
23 |
24 | return (
25 |
31 |
32 |
33 | );
34 | }
35 | }
36 |
37 | Switch.propTypes = {
38 | onClick: PropTypes.func
39 | };
40 |
41 | Switch.defaultProps = {
42 | onClick: () => {}
43 | };
--------------------------------------------------------------------------------
/src/components/switch/Switch.scss:
--------------------------------------------------------------------------------
1 | .switch {
2 | display: block;
3 | width: 26px;
4 | height: 8px;
5 | border-radius: 25px;
6 | background-color: var(--grey-color-light);
7 | box-shadow: var(--box-shadow-light);
8 | transition: background-color var(--transition-speed-quick);
9 | cursor: pointer;
10 |
11 | span {
12 | height: 16px;
13 | width: 16px;
14 | margin-top: -4px;
15 | margin-left: -4px;
16 | background-color: var(--grey-color-medium);
17 | position: absolute;
18 | border-radius: 50px;
19 | box-shadow: var(--box-shadow-light);
20 | transition: background-color var(--transition-speed-quick), margin-left var(--transition-speed-quick);
21 | pointer-events: none;
22 | }
23 |
24 | &[data-active="true"] {
25 | span {
26 | background-color: var(--primary-color);
27 | margin-left: 14px;
28 | transition: background-color var(--transition-speed-quick), margin-left var(--transition-speed-quick);
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/components/totop/ToTop.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import { ArrowUpAltIcon } from 'src/assets/icons/ArrowUpAltIcon';
4 | import { ArrowUpIcon } from 'src/assets/icons/ArrowUpIcon';
5 | import PropTypes from 'prop-types';
6 | import setClassName from 'utilities/setClassName';
7 | import styles from 'src/assets/scss/styles.module.scss';
8 |
9 | /**
10 | * @namespace ToTop
11 | * @description Default styled to-top button component.
12 | * @property {string} variant Variant of to-top component to use (e.g., "alt-icons").
13 | * @tutorial `src\stories\ToTop.stories.js`
14 | */
15 |
16 | export class ToTop extends Component {
17 |
18 | state = {
19 | styles: {
20 | opacity: 0,
21 | pointerEvents: 'none'
22 | }
23 | }
24 |
25 | componentDidMount() {
26 | window.addEventListener('scroll', this.handleScroll);
27 | }
28 |
29 | componentWillUnmount() {
30 | window.removeEventListener('scroll', this.handleScroll);
31 | }
32 |
33 | handleScroll = () => {
34 | const scrolling = window.scrollY > 500;
35 |
36 | // If window is past 500px & icon is hidden
37 | if (scrolling && !this.state.styles.opacity) { this.setState({ styles: { opacity: 1, pointerEvents: 'auto' } }); }
38 |
39 | // If window is not past 500px and icon is showing
40 | else if (!scrolling && this.state.styles.opacity) { this.setState({ styles: { opacity: 0, pointerEvents: 'none' } }); }
41 |
42 | };
43 |
44 | handleClick = () => window.scrollTo({ top: 0, behavior: 'smooth' });
45 |
46 | render() {
47 | const {
48 | handleClick,
49 | props,
50 | props: { variant = '' }
51 | } = this;
52 |
53 | const ArrowUp = () => (variant.includes('alt-icons')
54 | ?
55 | : );
56 |
57 | return (
58 |
68 | );
69 | }
70 | }
71 |
72 | ToTop.propTypes = {
73 | variant: PropTypes.string
74 | };
--------------------------------------------------------------------------------
/src/components/totop/ToTop.scss:
--------------------------------------------------------------------------------
1 | .to-top {
2 | position: fixed;
3 | bottom: 2rem;
4 | right: 2.25rem;
5 | cursor: pointer;
6 | transition: opacity var(--transition-speed-medium);
7 | z-index: 9989;
8 |
9 | @media(max-width: $tablet) {
10 | bottom: 1rem;
11 | right: 1.25rem;
12 | }
13 |
14 | svg {
15 | all: unset;
16 | width: 1.5rem;
17 | border: var(--border);
18 | border-radius: var(--border-radius-round);
19 | padding: .5rem;
20 | box-shadow: var(--box-shadow-medium);
21 | color: var(--primary-color-contrast);
22 | background-color: var(--primary-color);
23 | }
24 | }
--------------------------------------------------------------------------------
/src/stories/0-Welcome.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | const Welcome = () => {
4 | return (
5 |
6 |
Default component Storybook
7 |
This is a UI component dev environment for Default component library.
8 |
9 |
10 | Component To-Do:
11 |
12 | Create loading component.
13 | Create card component.
14 | Create 404 page component.
15 | Update pagination component (for 10+ pages).
16 |
17 |
18 |
19 | );
20 | };
21 |
22 | export default {
23 | title: 'Welcome',
24 | component: Welcome
25 | };
26 |
27 | export const ToStorybook = () => ;
28 |
29 | ToStorybook.story = {
30 | name: 'to the Default Storybook'
31 | };
--------------------------------------------------------------------------------
/src/stories/Avatar.stories.js:
--------------------------------------------------------------------------------
1 | import { Avatar as DefaultAvatar } from 'components/avatar/Avatar';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'Avatar',
7 | component: DefaultAvatar
8 | };
9 |
10 | const image = `https://robohash.org/${Date.now()}?size=400x400`;
11 |
12 | export const Avatar_Small = () => (
13 |
14 |
15 |
16 | );
17 |
18 | export const Avatar_Medium = () => (
19 |
20 |
21 |
22 | );
23 |
24 | export const Avatar_Default = () => (
25 |
26 |
27 |
28 | );
29 |
30 | export const Avatar_Large = () => (
31 |
32 |
33 |
34 | );
--------------------------------------------------------------------------------
/src/stories/Button.stories.js:
--------------------------------------------------------------------------------
1 | import { Button as DefaultButton } from 'components/button/Button';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'Button',
7 | component: DefaultButton
8 | };
9 |
10 | export const Square = () => (
11 |
12 |
13 | Square Button
14 |
15 |
16 | );
17 |
18 | export const Round = () => (
19 |
20 |
21 | Round Button
22 |
23 |
24 | );
25 |
26 | export const Large = () => (
27 |
28 |
29 | Round Button
30 |
31 |
32 | );
33 |
34 | export const Large_Round = () => (
35 |
36 |
37 | Round Button
38 |
39 |
40 | );
--------------------------------------------------------------------------------
/src/stories/Checkbox.stories.js:
--------------------------------------------------------------------------------
1 | import { Checkbox as DefaultCheckbox } from 'components/checkbox/Checkbox';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'Checkbox',
7 | component: DefaultCheckbox
8 | };
9 |
10 | export const Checkbox = () => (
11 |
12 | );
13 |
14 | export const Checkbox_Alt_Icons = () => (
15 |
16 | );
--------------------------------------------------------------------------------
/src/stories/Container.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { action } from '@storybook/addon-actions';
3 | import { Container as DefaultContainer } from 'components/container/Container';
4 |
5 | export default {
6 | title: 'Container',
7 | component: DefaultContainer
8 | };
9 |
10 | export const Container = () => (
11 |
12 | This is the container contents
13 |
14 | );
--------------------------------------------------------------------------------
/src/stories/Footer.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { action } from '@storybook/addon-actions';
3 | import { Footer as DefaultFooter } from 'components/footer/Footer';
4 |
5 | export default {
6 | title: 'Footer',
7 | component: DefaultFooter
8 | };
9 |
10 | export const Footer = () => (
11 |
12 | By Default Services
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/src/stories/Input.stories.js:
--------------------------------------------------------------------------------
1 | import { Input as DefaultInput } from 'components/input/Input';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'Input',
7 | component: DefaultInput
8 | };
9 |
10 | export const Input = () => (
11 |
12 |
13 |
14 | );
15 |
16 | export const Input_Large = () => (
17 |
18 |
19 |
20 | );
--------------------------------------------------------------------------------
/src/stories/Loader.stories.js:
--------------------------------------------------------------------------------
1 | import { Loader as DefaultLoader } from 'components/loader/Loader';
2 | import React from 'react';
3 |
4 | export default {
5 | title: 'Loader',
6 | component: DefaultLoader
7 | };
8 |
9 | export const Atomic_Loader = () => (
10 |
11 | );
12 |
13 | export const Bouncy_Loader = () => (
14 |
15 | );
16 |
17 | export const Default_Loader = () => (
18 |
19 | );
--------------------------------------------------------------------------------
/src/stories/Navbar.mobile.stories.js:
--------------------------------------------------------------------------------
1 | import { Navbar as DefaultNavbar } from 'components/navbar/Navbar';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 | import defaultLogo from 'assets/images/default-logo.png';
5 |
6 | export default {
7 | title: 'Navbar (mobile)',
8 | component: DefaultNavbar,
9 | parameters: {
10 | viewport: {
11 | defaultViewport: 'iphone6'
12 | },
13 | }
14 | };
15 |
16 |
17 | const links = [
18 | {
19 | // `li` element props
20 | li: { key: 'link_one'},
21 |
22 | // `a` element props
23 | a: { href: '#one', title: 'link one' },
24 |
25 | // link text
26 | text: 'link one'
27 | },
28 | {
29 | li: { key: 'link_two' },
30 | a: { href: '#two' },
31 | text: 'link two'
32 | },
33 | {
34 | li: { key: 'link_three' },
35 | a: { href: '#three' },
36 | text: 'link three'
37 | }
38 | ];
39 |
40 | export const Navbar_On_Mobile = () => (
41 |
48 | );
49 |
50 | export const Navbar_On_Mobile_Alt_Icons = () => (
51 |
58 | );
59 |
60 | export const Navbar_On_Mobile_Arrow_Close = () => (
61 |
68 | );
69 |
70 | export const Navbar_On_Mobile_Arrow_Close_Alt_Icons = () => (
71 |
77 | );
--------------------------------------------------------------------------------
/src/stories/Navbar.stories.js:
--------------------------------------------------------------------------------
1 | import { Navbar as DefaultNavbar } from 'components/navbar/Navbar';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 | import defaultLogo from 'assets/images/default-logo.png';
5 |
6 | export default {
7 | title: 'Navbar',
8 | component: DefaultNavbar,
9 | };
10 |
11 |
12 | const links = [
13 | {
14 | // `li` element props
15 | li: { key: 'link_one'},
16 |
17 | // `a` element props
18 | a: { href: '#one', title: 'link one' },
19 |
20 | // link text
21 | text: 'link one'
22 | },
23 | {
24 | li: { key: 'link_two' },
25 | a: { href: '#two' },
26 | text: 'link two'
27 | },
28 | {
29 | li: { key: 'link_three' },
30 | a: { href: '#three' },
31 | text: 'link three'
32 | }
33 | ];
34 |
35 | export const Navbar = () => (
36 |
43 | );
44 |
45 | export const Navbar_Underline_On_Hover = () => (
46 |
53 | );
54 |
55 | export const Navbar_Right = () => (
56 |
64 | );
65 |
66 | export const Navbar_Right_Underline_On_Hover = () => (
67 |
75 | );
--------------------------------------------------------------------------------
/src/stories/Notice.stories.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 |
3 | import { Button } from 'components/button/Button';
4 | import { Notice as DefaultNotice } from 'components/notice/Notice';
5 | import { action } from '@storybook/addon-actions';
6 |
7 | export default {
8 | title: 'Notice',
9 | component: DefaultNotice
10 | };
11 |
12 | const margin = '1rem';
13 | const padding = '2rem';
14 |
15 | export const Notice = () => {
16 | const [ showAlert, setShowAlert ] = useState(false);
17 | const [ showConfirm, setShowConfirm ] = useState(false);
18 | const [ showPrompt, setShowPrompt ] = useState(false);
19 |
20 | const handleAlertClick = () => setShowAlert(true);
21 | const handleConfirmClick = () => setShowConfirm(true);
22 | const handlePromptClick = () => setShowPrompt(true);
23 | const handleOkPrompt = (inputValue) => console.log(inputValue);
24 |
25 |
26 | return (
27 |
28 |
29 | Alert
30 | Confirm
31 | Prompt
32 |
33 |
34 |
40 | Alert styled notice.
41 |
42 |
43 |
console.log('Confirm canceled.') }
45 | cancelText='Cancel'
46 | header='Confirm'
47 | okayFunc={ () => console.log('Confirm "Okay" button pressed.') }
48 | okayText='Okay'
49 | show={ showConfirm }
50 | setShow={ setShowConfirm }
51 | type='confirm'
52 | >
53 | Confirm styled notice.
54 |
55 |
56 |
console.log('Prompt canceled.') }
58 | cancelText='Cancel'
59 | header='Prompt'
60 | okayFunc={ handleOkPrompt }
61 | okayText='Okay'
62 | show={ showPrompt }
63 | setShow={ setShowPrompt }
64 | type='prompt'
65 | >
66 | Prompt styled notice.
67 |
68 |
69 | );
70 | };
71 |
72 |
73 | export const Notice_Alt_Icons = () => {
74 | const [ showAlert, setShowAlert ] = useState(false);
75 | const [ showConfirm, setShowConfirm ] = useState(false);
76 | const [ showPrompt, setShowPrompt ] = useState(false);
77 |
78 | const handleAlertClick = () => setShowAlert(true);
79 | const handleConfirmClick = () => setShowConfirm(true);
80 | const handlePromptClick = () => setShowPrompt(true);
81 | const handleOkPrompt = (inputValue) => console.log(inputValue);
82 |
83 | return (
84 |
85 |
86 | Alert
87 | Confirm
88 | Prompt
89 |
90 |
91 |
console.log('Prompt "Okay" button pressed.') }
94 | okayText='Okay'
95 | show={ showAlert }
96 | setShow={ setShowAlert }
97 | variant='alt-icons'
98 | >
99 | Alert styled notice.
100 |
101 |
102 |
console.log('Prompt "Okay" button pressed.') }
105 | okayText='Okay'
106 | show={ showConfirm }
107 | setShow={ setShowConfirm }
108 | variant='alt-icons'
109 | type='confirm'
110 | >
111 | Confirm styled notice.
112 |
113 |
114 |
123 | Prompt styled notice.
124 |
125 |
126 | );
127 |
128 | };
--------------------------------------------------------------------------------
/src/stories/Pages.stories.js:
--------------------------------------------------------------------------------
1 | import { FileNotFound as FileNotFoundPage } from 'components/pages/404/FileNotFound';
2 | import React from 'react';
3 |
4 | export default {
5 | title: 'Pages',
6 | component: 'Pages'
7 | };
8 |
9 | export const Page_404 = () => (
10 |
11 | );
--------------------------------------------------------------------------------
/src/stories/Pagination.stories.js:
--------------------------------------------------------------------------------
1 | import { PaginationList as DefaultPaginationList } from 'components/pagination/PaginationList';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'Pagination',
7 | component: DefaultPaginationList,
8 | };
9 |
10 |
11 | const links = [
12 | {
13 | li: { key: 'link_one'},
14 | a: { href: '#one', title: 'link one' },
15 | text: 'link one'
16 | },
17 | {
18 | li: { key: 'link_two' },
19 | a: { href: '#two' },
20 | text: 'link two'
21 | },
22 | {
23 | li: { key: 'link_three' },
24 | a: { href: '#three' },
25 | text: 'link three'
26 | },
27 | {
28 | li: { key: 'link_four'},
29 | a: { href: '#four', title: 'link four' },
30 | text: 'link four'
31 | },
32 | {
33 | li: { key: 'link_five' },
34 | a: { href: '#five' },
35 | text: 'link five'
36 | },
37 | {
38 | li: { key: 'link_six' },
39 | a: { href: '#six' },
40 | text: 'link six'
41 | },
42 | {
43 | li: { key: 'link_seven'},
44 | a: { href: '#seven', title: 'link seven' },
45 | text: 'link seven'
46 | }
47 | ];
48 |
49 | const linkMap = links.map( link => {
50 | return { link.text }
51 | });
52 |
53 | export const Pagination_List = () => (
54 |
55 | { linkMap }
56 |
57 | );
58 |
59 | export const Pagination_List_Round = () => (
60 |
61 | { linkMap }
62 |
63 | );
--------------------------------------------------------------------------------
/src/stories/Radio.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { action } from '@storybook/addon-actions';
3 | import { RadioButton as DefaultRadioButton } from 'components/radiobutton/RadioButton';
4 |
5 | export default {
6 | title: 'Radio Button',
7 | component: DefaultRadioButton
8 | };
9 |
10 | export const Radio = () => (
11 |
12 | );
13 |
14 | export const Radio_Filled = () => (
15 |
20 | );
--------------------------------------------------------------------------------
/src/stories/Select.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { action } from '@storybook/addon-actions';
3 | import { Select as DefaultSelect } from 'components/select/Select';
4 |
5 | export default {
6 | title: 'Select',
7 | component: DefaultSelect
8 | };
9 |
10 | const options = [
11 | 'first option',
12 | 'second option',
13 | 'third option',
14 | 'fourth option'
15 | ];
16 |
17 | export const Select = () => (
18 |
19 |
20 |
21 | );
22 |
23 | export const Select_Alt_Icons = () => (
24 |
25 |
26 |
27 | );
--------------------------------------------------------------------------------
/src/stories/Switch.stories.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { action } from '@storybook/addon-actions';
3 | import { Switch as DefaultSwitch } from 'components/switch/Switch';
4 |
5 | export default {
6 | title: 'Switch',
7 | component: DefaultSwitch
8 | };
9 |
10 | export const Switch = () => (
11 |
12 |
13 |
14 | );
--------------------------------------------------------------------------------
/src/stories/ToTop.stories.js:
--------------------------------------------------------------------------------
1 | import { ToTop as DefaultToTop } from 'components/totop/ToTop';
2 | import React from 'react';
3 | import { action } from '@storybook/addon-actions';
4 |
5 | export default {
6 | title: 'To-top',
7 | component: DefaultToTop
8 | };
9 |
10 | const styles = `
11 | div[class*="to-top"][role="button"] {
12 | opacity: 1 !important;
13 | pointer-events: auto !important;
14 | }
15 | `;
16 |
17 | export const ToTop = () => (
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export const ToTop_Alt_Icons = () => (
25 |
26 |
27 |
28 |
29 | );
--------------------------------------------------------------------------------
/src/utilities/setClassName.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @description - Allow for variants, and additional user-specified classes.
3 | * @property {Object} props - Component props.
4 | * @property {string} props.className - User defined class name.
5 | * @property {string} defaultClassName - Default's class name.
6 | */
7 | const setClassName = (props, defaultClassName) => {
8 | const { className: userClassName } = props;
9 |
10 | return userClassName
11 | ? `${defaultClassName} ${userClassName}`
12 | : defaultClassName;
13 | };
14 |
15 | export default setClassName;
--------------------------------------------------------------------------------