bernova 1.7.5 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +45 -0
- package/dist/interfaces/componentsType.ts +633 -173
- package/dist/src/lib/generateCss/helpers/classnames/handlerRegister.utils.js +1 -1
- package/dist/src/lib/generateCss/helpers/generateCssStyles.utils.js +1 -1
- package/dist/src/lib/generateCss/helpers/rulename/formatRuleName.utils.js +1 -1
- package/dist/src/lib/generateProvider/template/providerTemplate-link.js +170 -1
- package/dist/src/lib/generateProvider/template/providerTemplate-style.js +155 -1
- package/dist/src/lib/typingStyles/typingStyles.utils.js +1 -1
- package/dist/types/lib/generateCss/helpers/rulename/formatRuleName.utils.d.ts +2 -1
- package/package.json +1 -1
- package/src/lib/generateCss/helpers/classnames/handlerRegister.utils.js +48 -8
- package/src/lib/generateCss/helpers/generateCssStyles.utils.js +5 -2
- package/src/lib/generateCss/helpers/rulename/formatRuleName.utils.js +25 -0
- package/src/lib/generateProvider/template/providerTemplate-link.js +9 -3
- package/src/lib/generateProvider/template/providerTemplate-style.js +9 -3
- package/src/lib/typingStyles/typingStyles.utils.js +12 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
- [Complex Styles](#Complex-Styles)
|
|
46
46
|
- [Foreign Feature](#Foreign-Feature)
|
|
47
47
|
- [Dynamic Values Feature](#Dynamic-Values-Feature)
|
|
48
|
+
- [Literals Values Feature](#Literals-Values-Feature)
|
|
48
49
|
- [Fonts](#setting-text-fonts)
|
|
49
50
|
- [Reset CSS](#enable-reset-css)
|
|
50
51
|
- [Typescript helps](#typescript-helps)
|
|
@@ -1108,6 +1109,50 @@ export const Container = ({ bgColor, borderColor, children }) => {
|
|
|
1108
1109
|
|
|
1109
1110
|
In this case, only the styles for the header will be generated, and in the development tools, for _nav_item_ and _login_button_, the existing classes for BUTTON and LINK will be returned.
|
|
1110
1111
|
|
|
1112
|
+
### Literals Values Feature
|
|
1113
|
+
|
|
1114
|
+
You might need to set a literal value in the component's styles object for Bernova. By default, it would be processed as a CSS class with its respective values. However, if that value is within the _$literals_ key, these values can be retrieved by the provider or set in the **cssClassNames** object.
|
|
1115
|
+
|
|
1116
|
+
```js
|
|
1117
|
+
const BUTTON = {
|
|
1118
|
+
padding: '4px',
|
|
1119
|
+
border_radius: '8px',
|
|
1120
|
+
PRIMARY: {
|
|
1121
|
+
color: 'white',
|
|
1122
|
+
background: 'red',
|
|
1123
|
+
$literals: {
|
|
1124
|
+
loader_variant: 'loader-primary.json',
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
SECONDARY: {
|
|
1128
|
+
color: 'black',
|
|
1129
|
+
background: 'gray',
|
|
1130
|
+
$literals: {
|
|
1131
|
+
loader_variant: 'loader-secondary.json',
|
|
1132
|
+
},
|
|
1133
|
+
},
|
|
1134
|
+
};
|
|
1135
|
+
```
|
|
1136
|
+
|
|
1137
|
+
Example of implementation:
|
|
1138
|
+
|
|
1139
|
+
```jsx
|
|
1140
|
+
import { useClassNames } from '@/hooks';
|
|
1141
|
+
|
|
1142
|
+
const Button = (props) => {
|
|
1143
|
+
const styles = useClassNames({ component: 'BUTTON', variant: 'PRIMARY' });
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* styles = {
|
|
1147
|
+
* button: 'button button--primary',
|
|
1148
|
+
* loader_variant: 'loader-primary.json'
|
|
1149
|
+
* }
|
|
1150
|
+
*/
|
|
1151
|
+
};
|
|
1152
|
+
```
|
|
1153
|
+
|
|
1154
|
+
**Important**: Within literals, values can be of different primitive types: numbers, booleans, etc.
|
|
1155
|
+
|
|
1111
1156
|
## Access to classNames
|
|
1112
1157
|
|
|
1113
1158
|
To use the generated CSS classes, you can use the name directly on the HTML element, as the library will return a valid CSS file.
|