New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms won't import at the root #76

Closed
cereallarceny opened this Issue Sep 6, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@cereallarceny

cereallarceny commented Sep 6, 2018

I'm forced to import the Field, Control, and Input (and likely other modules) at react-bulma-components/lib/components/form rather than at react-bulma-components.

This works:

import {
  Columns,
  Heading,
  Box,
  Container,
  Section,
  Button,
  Level,
  Card,
  Media,
  Image,
  Content,
  Tag,
  Message,
  Hero
} from 'react-bulma-components';

import {
  Field,
  Control,
  Input
} from 'react-bulma-components/lib/components/form';

This does not work:

import {
  Columns,
  Heading,
  Box,
  Container,
  Section,
  Button,
  Level,
  Card,
  Media,
  Image,
  Content,
  Tag,
  Message,
  Hero,
  Field,
  Control,
  Input
} from 'react-bulma-components';
@couds

This comment has been minimized.

Show comment
Hide comment
@couds

couds Sep 6, 2018

Owner

Hi @cereallarceny all the form components are inside the Form component,

you can do this

import { Form } from 'react-bulma-components';

const { Input, Field, Control } = Form;

Also I think I this this should work (didn't tested yet)

import { Form: { Input, Control } } from 'react-bulma-components'
Owner

couds commented Sep 6, 2018

Hi @cereallarceny all the form components are inside the Form component,

you can do this

import { Form } from 'react-bulma-components';

const { Input, Field, Control } = Form;

Also I think I this this should work (didn't tested yet)

import { Form: { Input, Control } } from 'react-bulma-components'
@cereallarceny

This comment has been minimized.

Show comment
Hide comment
@cereallarceny

cereallarceny Sep 6, 2018

Oh wow, that's awesome. Is there any reason that shouldn't just import directly from the root package like all the other elements?

Also, I'd love to help with documentation on this project. It seems like there's a lot of props that either aren't in the Storybook or that I've found by accident in reading the source code. Do you have any timeline, issues, or roadmap associated with this? Of course, the storybook and Bulma docs are helpful, but the classes don't always match up perfectly with the React props, so there's sometimes some ambiguity in how they should be spelled.

Any pointers in the right direction? It would be great to not have to read the source code to see what props are available for specific elements.

cereallarceny commented Sep 6, 2018

Oh wow, that's awesome. Is there any reason that shouldn't just import directly from the root package like all the other elements?

Also, I'd love to help with documentation on this project. It seems like there's a lot of props that either aren't in the Storybook or that I've found by accident in reading the source code. Do you have any timeline, issues, or roadmap associated with this? Of course, the storybook and Bulma docs are helpful, but the classes don't always match up perfectly with the React props, so there's sometimes some ambiguity in how they should be spelled.

Any pointers in the right direction? It would be great to not have to read the source code to see what props are available for specific elements.

@couds

This comment has been minimized.

Show comment
Hide comment
@couds

couds Sep 7, 2018

Owner

Yes the idea it to not overpopulate the root namespace, normally you will use the form components together so make sense to group then all.

Right now My hands are full with other projects I do not have a timeline for improve the docs, but mostly all props are showed on each component storybook, with the exception of the common props that are only on the Element component.

If you can contribute improving the docs that will be a huge help.

Thanks

Owner

couds commented Sep 7, 2018

Yes the idea it to not overpopulate the root namespace, normally you will use the form components together so make sense to group then all.

Right now My hands are full with other projects I do not have a timeline for improve the docs, but mostly all props are showed on each component storybook, with the exception of the common props that are only on the Element component.

If you can contribute improving the docs that will be a huge help.

Thanks

@couds

This comment has been minimized.

Show comment
Hide comment
@couds

couds Sep 17, 2018

Owner

Closing this due inactivity

Owner

couds commented Sep 17, 2018

Closing this due inactivity

@couds couds closed this Sep 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment