mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-22 03:24:20 +00:00
⬆ Update bluelib to the latest version
This commit is contained in:
parent
6c3139fe4b
commit
949fa112e4
8 changed files with 117 additions and 13 deletions
87
.idea/codeStyles/Project.xml
Normal file
87
.idea/codeStyles/Project.xml
Normal file
|
@ -0,0 +1,87 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<option name="RIGHT_MARGIN" value="160" />
|
||||
<HTMLCodeStyleSettings>
|
||||
<option name="HTML_UNIFORM_INDENT" value="true" />
|
||||
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
|
||||
<option name="HTML_TEXT_WRAP" value="0" />
|
||||
<option name="HTML_ALIGN_ATTRIBUTES" value="false" />
|
||||
<option name="HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE" value="address,article,aside,blockquote,details,dialog,dd,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,main,nav,ol,p,pre,section,table,ul" />
|
||||
<option name="HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE" value="a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var" />
|
||||
<option name="HTML_DO_NOT_INDENT_CHILDREN_OF" value="" />
|
||||
<option name="HTML_DONT_ADD_BREAKS_IF_INLINE_CONTENT" value="" />
|
||||
<option name="HTML_ENFORCE_QUOTES" value="true" />
|
||||
<option name="HTML_NEWLINE_BEFORE_FIRST_ATTRIBUTE" value="When multiline" />
|
||||
<option name="HTML_NEWLINE_AFTER_LAST_ATTRIBUTE" value="When multiline" />
|
||||
</HTMLCodeStyleSettings>
|
||||
<JSCodeStyleSettings version="0">
|
||||
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
|
||||
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
||||
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
||||
<option name="REFORMAT_C_STYLE_COMMENTS" value="true" />
|
||||
<option name="FORCE_QUOTE_STYlE" value="true" />
|
||||
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
||||
<option name="VAR_DECLARATION_WRAP" value="5" />
|
||||
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
||||
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
||||
<option name="INDENT_CHAINED_CALLS" value="false" />
|
||||
</JSCodeStyleSettings>
|
||||
<RsCodeStyleSettings>
|
||||
<option name="ALIGN_RET_TYPE" value="false" />
|
||||
</RsCodeStyleSettings>
|
||||
<ScalaCodeStyleSettings>
|
||||
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
|
||||
</ScalaCodeStyleSettings>
|
||||
<codeStyleSettings language="HTML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSON">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JavaScript">
|
||||
<option name="RIGHT_MARGIN" value="999" />
|
||||
<option name="BLANK_LINES_AFTER_IMPORTS" value="2" />
|
||||
<option name="BLANK_LINES_AROUND_CLASS" value="2" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
|
||||
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_CATCH_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
|
||||
<option name="PARENTHESES_EXPRESSION_LPAREN_WRAP" value="true" />
|
||||
<option name="PARENTHESES_EXPRESSION_RPAREN_WRAP" value="true" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
|
||||
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="LESS">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Rust">
|
||||
<option name="RIGHT_MARGIN" value="120" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="false" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
9
.idea/runConfigurations/start.xml
Normal file
9
.idea/runConfigurations/start.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="start" type="js.build_tools.npm" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="start" />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "bluelib",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.7",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bluelib",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.7",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
|
@ -12225,7 +12225,6 @@
|
|||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
|
||||
"integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1"
|
||||
|
@ -27421,7 +27420,6 @@
|
|||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
|
||||
"integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit ccff439a77b1acd3d9b60ad842412f47c98e0224
|
||||
Subproject commit a47f83b53638e503b0740e6b9a6350ed0c7275be
|
|
@ -4,4 +4,5 @@ A skin can be selected by passing either a CSS module or a string to the `skin`
|
|||
|
||||
Valid strings are:
|
||||
|
||||
- `"rygblue"`
|
||||
- `"paper"`
|
||||
- `"royalblue"`
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import React from "react"
|
||||
|
||||
import skinRygblue from "../../../bluelib/src/targets/rygblue.module.css"
|
||||
import skinPaper from "../../../bluelib/src/targets/paper.module.css"
|
||||
import skinRygblue from "../../../bluelib/src/targets/royalblue.module.css"
|
||||
import ContextBluelibSkin from "../../../contexts/ContextBluelibSkin"
|
||||
import isString from "../../../utils/isString"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
|
||||
const builtinSkins = {
|
||||
"rygblue": skinRygblue
|
||||
"paper": skinPaper,
|
||||
"royalblue": skinRygblue,
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,6 +18,9 @@ export default function BluelibProvider({skin, children}) {
|
|||
if (isString(skin)) {
|
||||
skin = builtinSkins[skin]
|
||||
}
|
||||
else {
|
||||
skin = builtinSkins["paper"]
|
||||
}
|
||||
|
||||
return (
|
||||
<ContextBluelibSkin.Provider value={skin}>
|
||||
|
|
|
@ -7,10 +7,11 @@ A skin can be selected by passing either a CSS module or a string to the `skin`
|
|||
|
||||
Valid strings are:
|
||||
|
||||
- `"rygblue"`
|
||||
- `"paper"`
|
||||
- `"royalblue"`
|
||||
|
||||
```jsx
|
||||
<Bluelib skin={"rygblue"}>
|
||||
<Bluelib skin={"royalblue"}>
|
||||
Ciao!
|
||||
</Bluelib>
|
||||
```
|
||||
|
|
|
@ -2,8 +2,6 @@ import {useContext} from "react";
|
|||
import contextBluelibSkin from "../contexts/ContextBluelibSkin";
|
||||
import classNames from "classnames";
|
||||
|
||||
import skeleton from "../bluelib/src/targets/skeleton.module.css";
|
||||
|
||||
|
||||
export default function useBluelibClassNames(cn, extra) {
|
||||
const bluelibSkin = useContext(contextBluelibSkin);
|
||||
|
@ -19,7 +17,12 @@ export default function useBluelibClassNames(cn, extra) {
|
|||
return null;
|
||||
}
|
||||
|
||||
return classNames(skeleton[c], bluelibSkin ? bluelibSkin[c] : null)
|
||||
if(!bluelibSkin) {
|
||||
console.warn("bluelibSkin is invalid: ", bluelibSkin)
|
||||
return null
|
||||
}
|
||||
|
||||
return classNames(bluelibSkin[c])
|
||||
});
|
||||
|
||||
// Return all the class names
|
||||
|
|
Loading…
Reference in a new issue