diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 75cbdee2c7..f7e98bd815 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -85,5 +85,4 @@ export { Modal } from './Modal/Modal.js' export { MultiSelectField } from './MultiSelectField/MultiSelectField.js' export { SingleSelectField } from './SingleSelectField/SingleSelectField.js' export { SwitchField } from './SwitchField/SwitchField.js' -export { ToggleGroupField } from './ToggleGroupField/ToggleGroupField.js' export { TextAreaField } from './TextAreaField/TextAreaField.js' diff --git a/packages/core/src/ToggleGroupField/ToggleGroupField.js b/packages/widgets/src/ToggleGroupField/ToggleGroupField.js similarity index 85% rename from packages/core/src/ToggleGroupField/ToggleGroupField.js rename to packages/widgets/src/ToggleGroupField/ToggleGroupField.js index 7909222ce4..9139cf1671 100644 --- a/packages/core/src/ToggleGroupField/ToggleGroupField.js +++ b/packages/widgets/src/ToggleGroupField/ToggleGroupField.js @@ -1,21 +1,21 @@ import propTypes from '@dhis2/prop-types' import React from 'react' -import { ToggleGroup } from '../ToggleGroup/ToggleGroup.js' -import { Field } from '../Field/Field.js' -import { FieldSet } from '../FieldSet/FieldSet.js' -import { Legend } from '../Legend/Legend.js' -import { Help } from '../Help/Help.js' -import { statusPropType } from '../common-prop-types.js' +import { ToggleGroup, Field, FieldSet, Legend, Help } from '@dhis2/ui-core' + +export const statusPropType = propTypes.mutuallyExclusive( + ['valid', 'warning', 'error'], + propTypes.bool +) /** * @module * @param {ToggleGroupField.PropTypes} props * @returns {React.Component} * - * @example import { ToggleGroupField } from '@dhis2/ui-core' + * @example import { ToggleGroupField } from '@dhis2/ui' * - * @see Live demo: {@link /demo/?path=/story/togglegroupfield--default|Storybook} + * @example import { ToggleGroupField } from '@dhis2/ui-widgets' */ const ToggleGroupField = ({ children, diff --git a/packages/core/src/ToggleGroupField/ToggleGroupField.stories.e2e.js b/packages/widgets/src/ToggleGroupField/ToggleGroupField.stories.e2e.js similarity index 92% rename from packages/core/src/ToggleGroupField/ToggleGroupField.stories.e2e.js rename to packages/widgets/src/ToggleGroupField/ToggleGroupField.stories.e2e.js index b053975264..8813a33e6c 100644 --- a/packages/core/src/ToggleGroupField/ToggleGroupField.stories.e2e.js +++ b/packages/widgets/src/ToggleGroupField/ToggleGroupField.stories.e2e.js @@ -1,7 +1,9 @@ -import { storiesOf } from '@storybook/react' import React from 'react' +import { storiesOf } from '@storybook/react' + +import { Checkbox } from '@dhis2/ui-core' + import { ToggleGroupField } from './ToggleGroupField.js' -import { Checkbox } from '../index.js' storiesOf('ToggleGroupField', module).add('With label and required', () => ( console.info(`name: ${name}, value: ${value}, checked: ${checked}`) diff --git a/packages/widgets/src/index.js b/packages/widgets/src/index.js index 0f1fe2244f..ac3ef6a2a0 100755 --- a/packages/widgets/src/index.js +++ b/packages/widgets/src/index.js @@ -1,2 +1,4 @@ export { HeaderBar } from './HeaderBar' export { OrganisationUnitTree } from './OrganisationUnitTree' + +export { ToggleGroupField } from './ToggleGroupField/ToggleGroupField.js'