Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@mmb-digital/ui-components-lamder
Advanced tools
UI components used in development of MONETA's web applications. See the project vision in the ROADMAP.md file and a more detailed description on [Confluence](https://monetamoneybank.atlassian.net/wiki/spaces/RD/pages/42900394/ui-components).
UI components used in development of MONETA's web applications. See the project vision in the ROADMAP.md file and a more detailed description on Confluence.
Click here to see the components!
Install dependencies:
yarn
Start the development environment:
yarn start
Generate a new component:
yarn run generate
Message
propBecause we use react-intl
in all of our projects, you can pass a message descriptor to any component for convenience as the message
(or messages
) prop.
const message = {
id: 'react.intl.example.id',
defaultMessage: 'Hi!'
}
<BButton message={message}>
// alternatively, you may pass a string!
// this is convenient for debugging
<BButton message="Hi!">
// if you can pass more messages to the component,
// use the plural version
<BSelect messages={{ error: message, label: message }}>
Theme
propBecause ui-components
are supposed to be used primarily with CSS modules, all components feature the theme
prop. The theme
prop allows you to pass a prioritised CSS module (or an array of CSS modules) or a string, which will be used in addition to all other class names.
A CSS Module is an object, where the keys specify the source class and the values the hashed/minified class.
/* styles.css file in a React app */
.btn {
composes: btn from '<business>';
color: salmon;
}
// part of a component file in a React app
import styles from './styles.css'
// ...
<BButton theme={styles} />
// `btn` would otherwise be applied from `ui-styles`
// instead, it is applied from the theme.
// this is how the `styles` import looks:
// { btn: 'styles__btn___3idho' }
You can also create your own CSS modules of sorts! This is useful if you want to use predefined global class names throughout your application.
const styles = {
btn: 'button',
'btn-primary': 'button-primary',
// ...
}
export default styles
And in your application root:
import React from 'react'
import { BButton, injectTheme, ThemeProvider } from '@prague-digi/ui-components'
import styles from './styles'
const Button = injectTheme(BButton)
// ...
<ThemeProvider theme={styles}>
<Button message="I look pretty!" />
</ThemeProvider>
You can even pass the theme
prop to the Button itself! Everything will work just fine. The priority is right-to-left, meaning that if you choose to pass an array of CSS modules, the rightmost one will have priority.
This is the priority list for almost all use cases (from highest to lowest priority). Remember that the resolution is not chained! Once the class name is found in a CSS module, the search STOPS.
theme
prop<ThemeProvider />
@mmb-digital/ui-styles-lamder
or a styles.css
fileFAQs
UI components used in development of MONETA's web applications. See the project vision in the ROADMAP.md file and a more detailed description on [Confluence](https://monetamoneybank.atlassian.net/wiki/spaces/RD/pages/42900394/ui-components).
We found that @mmb-digital/ui-components-lamder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.