@magic-modules/messages

0.0.4 • Public • Published

@magic-modules/messages

shows messages with arbitrary types. supports info, success, warning and error messages out of the box, and it's easy to add new message types.

NPM version Linux Build Status Windows Build Status Coverage Status Greenkeeper badge Known Vulnerabilities

install:

npm install --save-exact @magic-modules/messages

usage:

HOIST in config.mjs

export default {
  // ...other config
  HOIST: ['Messages'],
}

add message type:

export const View = () => {
  const msg = {
    type: 'newType',
    title: 'newType title',
    content: 'newType content',
    duration: 5,
  }

  return button({ onclick: [actions.messages.add, msg] })
}

// needed in the ssr step for now,
// gets overwritten by @magic-modules/messages with the correct actions.
export const actions = {
  messages: {},
}

export const style = vars => ({
  '.Messages': {
      '.Message.newType': {
        h3: {
          color: vars.colors.pink[900],
        },
      },
    },
  }
})

changelog

0.0.1 - unreleased

first release

0.0.2

bump required node version to 14.15.4

0.0.3

update dependencies (@magic-libraries/db)

0.0.4

update dependencies (@magic-libraries/db)

0.0.5 - unreleased

...

Package Sidebar

Install

npm i @magic-modules/messages

Weekly Downloads

0

Version

0.0.4

License

AGPL-3.0

Unpacked Size

41.5 kB

Total Files

4

Last publish

Collaborators

  • jascha