├── .babelrc
├── .eslintrc
├── .gitignore
├── .npmignore
├── LICENSE.md
├── README.md
├── build
└── index.html
├── package.json
├── src
└── scripts
│ ├── .app.jsx.swp
│ ├── app.jsx
│ ├── components
│ ├── DropdownMenu.jsx
│ ├── NavItem.jsx
│ ├── Navbar.jsx
│ ├── NavbarDropdown.jsx
│ ├── NavbarHeader.jsx
│ └── NavbarItems.jsx
│ └── index.js
├── webpack.config.js
└── webpack.development.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "stage": 0
3 | }
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "env": {
4 | "browser": true,
5 | "node": true
6 | },
7 | "settings": {
8 | "ecmascript": 6,
9 | "jsx": true
10 | },
11 | "plugins": [
12 | "react"
13 | ],
14 | "rules": {
15 | "strict": 0,
16 | "quotes": 0,
17 | "no-unused-vars": 0,
18 | "camelcase": 0,
19 | "no-underscore-dangle": 0,
20 | "comma-dangle": 2, // disallow or enforce trailing commas
21 | "no-cond-assign": 2, // disallow assignment in conditional expressions
22 | "no-console": 1, // disallow use of console (off by default in the node environment)
23 | "no-constant-condition": 2, // disallow use of constant expressions in conditions
24 | "no-control-regex": 2, // disallow control characters in regular expressions
25 | "no-debugger": 2, // disallow use of debugger
26 | "no-dupe-args": 2, // disallow duplicate arguments in functions
27 | "no-dupe-keys": 2, // disallow duplicate keys when creating object literals
28 | "no-duplicate-case": 2, // disallow a duplicate case label.
29 | "no-empty": 2, // disallow empty statements
30 | "no-empty-class": 2, // disallow the use of empty character classes in regular expressions
31 | "no-ex-assign": 2, // disallow assigning to the exception in a catch block
32 | "no-extra-boolean-cast": 2, // disallow double-negation boolean casts in a boolean context
33 | "no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
34 | "no-extra-semi": 2, // disallow unnecessary semicolons
35 | "no-func-assign": 2, // disallow overwriting functions written as function declarations
36 | "no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
37 | "no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
38 | "no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
39 | "no-negated-in-lhs": 2, // disallow negation of the left operand of an in expression
40 | "no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
41 | "no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
42 | "no-reserved-keys": 2, // disallow reserved words being used as object literal keys (off by default)
43 | "no-sparse-arrays": 2, // disallow sparse arrays
44 | "no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
45 | "use-isnan": 2, // disallow comparisons with the value NaN
46 | "valid-jsdoc": 2, // Ensure JSDoc comments are valid (off by default)
47 | "valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
48 |
49 | //
50 | // Best Practices
51 | //
52 | // These are rules designed to prevent you from making mistakes.
53 | // They either prescribe a better way of doing something or help you avoid footguns.
54 | //
55 | "block-scoped-var": 0, // treat var statements as if they were block scoped (off by default). 0: deep destructuring is not compatible https://github.com/eslint/eslint/issues/1863
56 | "complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
57 | "consistent-return": 2, // require return statements to either always or never specify values
58 | "curly": 2, // specify curly brace conventions for all control statements
59 | "default-case": 2, // require default case in switch statements (off by default)
60 | "dot-notation": 2, // encourages use of dot notation whenever possible
61 | "eqeqeq": 2, // require the use of === and !==
62 | "guard-for-in": 0, // make sure for-in loops have an if statement (off by default)
63 | "no-alert": 2, // disallow the use of alert, confirm, and prompt
64 | "no-caller": 2, // disallow use of arguments.caller or arguments.callee
65 | "no-div-regex": 2, // disallow division operators explicitly at beginning of regular expression (off by default)
66 | "no-else-return": 2, // disallow else after a return in an if (off by default)
67 | "no-empty-label": 2, // disallow use of labels for anything other then loops and switches
68 | "no-eq-null": 2, // disallow comparisons to null without a type-checking operator (off by default)
69 | "no-eval": 2, // disallow use of eval()
70 | "no-extend-native": 2, // disallow adding to native types
71 | "no-extra-bind": 2, // disallow unnecessary function binding
72 | "no-fallthrough": 2, // disallow fallthrough of case statements
73 | "no-floating-decimal": 2, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
74 | "no-implied-eval": 2, // disallow use of eval()-like methods
75 | "no-iterator": 2, // disallow usage of __iterator__ property
76 | "no-labels": 2, // disallow use of labeled statements
77 | "no-lone-blocks": 2, // disallow unnecessary nested blocks
78 | "no-loop-func": 2, // disallow creation of functions within loops
79 | "no-multi-spaces": 2, // disallow use of multiple spaces
80 | "no-multi-str": 2, // disallow use of multiline strings
81 | "no-native-reassign": 2, // disallow reassignments of native objects
82 | "no-new": 2, // disallow use of new operator when not part of the assignment or comparison
83 | "no-new-func": 2, // disallow use of new operator for Function object
84 | "no-new-wrappers": 2, // disallows creating new instances of String,Number, and Boolean
85 | "no-octal": 2, // disallow use of octal literals
86 | "no-octal-escape": 2, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
87 | "no-param-reassign": 2, // disallow reassignment of function parameters (off by default)
88 | "no-process-env": 2, // disallow use of process.env (off by default)
89 | "no-proto": 2, // disallow usage of __proto__ property
90 | "no-redeclare": 2, // disallow declaring the same variable more then once
91 | "no-return-assign": 2, // disallow use of assignment in return statement
92 | "no-script-url": 2, // disallow use of javascript: urls.
93 | "no-self-compare": 2, // disallow comparisons where both sides are exactly the same (off by default)
94 | "no-sequences": 2, // disallow use of comma operator
95 | "no-throw-literal": 2, // restrict what can be thrown as an exception (off by default)
96 | "no-unused-expressions": 2, // disallow usage of expressions in statement position
97 | "no-void": 2, // disallow use of void operator (off by default)
98 | "no-warning-comments": [0, {"terms": ["todo", "fixme"], "location": "start"}], // disallow usage of configurable warning terms in comments": 2, // e.g. TODO or FIXME (off by default)
99 | "no-with": 2, // disallow use of the with statement
100 | "radix": 2, // require use of the second argument for parseInt() (off by default)
101 | "vars-on-top": 2, // requires to declare all vars on top of their containing scope (off by default)
102 | "wrap-iife": 2, // require immediate function invocation to be wrapped in parentheses (off by default)
103 | "yoda": 2, // require or disallow Yoda conditions
104 |
105 |
106 | //
107 | // Variables
108 | //
109 | // These rules have to do with variable declarations.
110 | //
111 | "no-catch-shadow": 2, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
112 | "no-delete-var": 2, // disallow deletion of variables
113 | "no-label-var": 2, // disallow labels that share a name with a variable
114 | "no-shadow": 2, // disallow declaration of variables already declared in the outer scope
115 | "no-shadow-restricted-names": 2, // disallow shadowing of names such as arguments
116 | "no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
117 | "no-undef-init": 2, // disallow use of undefined when initializing variables
118 | "no-undefined": 2, // disallow use of undefined variable (off by default)
119 | "no-unused-vars": 2, // disallow declaration of variables that are not used in the code
120 | "no-use-before-define": 2, // disallow use of variables before they are defined
121 |
122 | //
123 | //Stylistic Issues
124 | //
125 | // These rules are purely matters of style and are quite subjective.
126 | //
127 | "indent": [1, 2], // this option sets a specific tab width for your code (off by default)
128 | "brace-style": 1, // enforce one true brace style (off by default)
129 | "camelcase": 1, // require camel case names
130 | "comma-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after comma
131 | "comma-style": [1, "last"], // enforce one true comma style (off by default)
132 | "consistent-this": [1, "_this"], // enforces consistent naming when capturing the current execution context (off by default)
133 | "eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
134 | "func-names": 0, // require function expressions to have a name (off by default)
135 | "func-style": 0, // enforces use of function declarations or expressions (off by default)
136 | "key-spacing": [1, {"beforeColon": false, "afterColon": true}], // enforces spacing between keys and values in object literal properties
137 | "max-nested-callbacks": [1, 3], // specify the maximum depth callbacks can be nested (off by default)
138 | "new-cap": [1, {newIsCap: true, capIsNew: false}], // require a capital letter for constructors
139 | "new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
140 | "newline-after-var": 0, // allow/disallow an empty newline after var statement (off by default)
141 | "no-array-constructor": 1, // disallow use of the Array constructor
142 | "no-inline-comments": 1, // disallow comments inline after code (off by default)
143 | "no-lonely-if": 1, // disallow if as the only statement in an else block (off by default)
144 | "no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation
145 | "no-multiple-empty-lines": [1, {"max": 2}], // disallow multiple empty lines (off by default)
146 | "no-nested-ternary": 1, // disallow nested ternary expressions (off by default)
147 | "no-new-object": 1, // disallow use of the Object constructor
148 | "no-spaced-func": 1, // disallow space between function identifier and application
149 | "no-ternary": 0, // disallow the use of ternary operators (off by default)
150 | "no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
151 | "no-underscore-dangle": 1, // disallow dangling underscores in identifiers
152 | "no-wrap-func": 1, // disallow wrapping of non-IIFE statements in parens
153 | "one-var": [1, "never"], // allow just one var statement per function (off by default)
154 | "operator-assignment": [1, "never"], // require assignment operator shorthand where possible or prohibit it entirely (off by default)
155 | "padded-blocks": [1, "never"], // enforce padding within blocks (off by default)
156 | "quote-props": [1, "as-needed"], // require quotes around object literal property names (off by default)
157 | "quotes": [1, "single"], // specify whether double or single quotes should be used
158 | "semi": [1, "always"], // require or disallow use of semicolons instead of ASI
159 | "semi-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after semicolons
160 | "sort-vars": 0, // sort variables within the same declaration block (off by default)
161 | "space-unary-ops": [1, {"words": true, "nonwords": false}], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
162 | "spaced-line-comment": [1, "always"], // require or disallow a space immediately following the // in a line comment (off by default)
163 | "wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
164 | "space-after-keywords": [1, "always"], // require a space after certain keywords (off by default)
165 | "space-before-blocks": [1, "always"], // require or disallow space before blocks (off by default)
166 | "space-before-function-paren": [1, {"anonymous": "always", "named": "never"}], // require or disallow space before function opening parenthesis (off by default)
167 | "space-in-brackets": [1, "never"], // require or disallow spaces inside brackets (off by default)
168 | "space-in-parens": [1, "never"], // require or disallow spaces inside parentheses (off by default)
169 |
170 | //
171 | // ECMAScript 6
172 | //
173 | // These rules are only relevant to ES6 environments and are off by default.
174 | //
175 | "no-var": 2, // require let or const instead of var (off by default)
176 | "generator-star-spacing": [2, "before"], // enforce the spacing around the * in generator functions (off by default)
177 | //
178 | // Legacy
179 | //
180 | // The following rules are included for compatibility with JSHint and JSLint.
181 | // While the names of the rules may not match up with the JSHint/JSLint counterpart,
182 | // the functionality is the same.
183 | //
184 | "max-depth": [2, 3], // specify the maximum depth that blocks can be nested (off by default)
185 | "max-len": [2, 100, 2], // specify the maximum length of a line in your program (off by default)
186 | "max-params": [2, 5], // limits the number of parameters that can be used in the function declaration. (off by default)
187 | "max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
188 | "no-bitwise": 0, // disallow use of bitwise operators (off by default)
189 | "no-plusplus": 2, // disallow use of unary operators, ++ and -- (off by default)
190 |
191 | //
192 | // eslint-plugin-react
193 | //
194 | // React specific linting rules for ESLint
195 | //
196 | "react/display-name": 1, // Prevent missing displayName in a React component definition
197 | "react/jsx-quotes": [2, "double", "avoid-escape"], // Enforce quote style for JSX attributes
198 | "react/jsx-no-undef": 2, // Disallow undeclared variables in JSX
199 | "react/jsx-sort-props": 0, // Enforce props alphabetical sorting
200 | "react/jsx-uses-react": 2, // Prevent React to be incorrectly marked as unused
201 | "react/jsx-uses-vars": 2, // Prevent variables used in JSX to be incorrectly marked as unused
202 | "react/no-did-mount-set-state": 2, // Prevent usage of setState in componentDidMount
203 | "react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
204 | "react/no-multi-comp": 0, // Prevent multiple component definition per file
205 | "react/no-unknown-property": 2, // Prevent usage of unknown DOM property
206 | "react/prop-types": 0, // Prevent missing props validation in a React component definition
207 | "react/react-in-jsx-scope": 2, // Prevent missing React when using JSX
208 | "react/self-closing-comp": 2, // Prevent extra closing tags for components without children
209 | "react/wrap-multilines": 2, // Prevent missing parentheses around multilines JSX
210 | }
211 | }
212 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Directories #
2 | ###########
3 | /node_modules/
4 | /lib/
5 |
6 | # Compiled source #
7 | ###################
8 | *.com
9 | *.class
10 | *.dll
11 | *.exe
12 | *.o
13 | *.so
14 |
15 | # Packages #
16 | ############
17 | # it's better to unpack these files and commit the raw source
18 | # git has its own built in compression methods
19 | *.7z
20 | *.dmg
21 | *.gz
22 | *.iso
23 | *.jar
24 | *.rar
25 | *.tar
26 | *.zip
27 |
28 | # Logs and databases #
29 | ######################
30 | *.log
31 | *.sql
32 | *.sqlite
33 |
34 | # OS generated files #
35 | ######################
36 | .DS_Store
37 | .DS_Store?
38 | ._*
39 | .Spotlight-V100
40 | .Trashes
41 | ehthumbs.db
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | /src/
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Haridu Senadeera
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.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Dynamic ReactJS Navigation Bar
3 | Bootstrap Navigation bar rebuilt with React components. Written in ECMAScript 6 (ES6).
4 | No external stylesheets! This navigation bar is built with [Radium](http://projects.formidablelabs.com/radium/) inline styling.
5 |
6 | ### Desktop View
7 |
8 | 
9 |
10 | ### Mobile View
11 |
12 |
13 |
14 | ## Tree Structure
15 |
16 | 
17 |
18 | ## Components
19 | ```js
20 | const dropdownItems = [
21 | {href: '#', name: 'Overview'},
22 | {href: '#', name: 'Setup'},
23 | {href: '#', name: 'Usage'},
24 | ];
25 |
26 | const navbar = (
27 |