diff --git a/src/collections/Breadcrumb/BreadcrumbSection.js b/src/collections/Breadcrumb/BreadcrumbSection.js index b48f3eaf49..6982902fee 100644 --- a/src/collections/Breadcrumb/BreadcrumbSection.js +++ b/src/collections/Breadcrumb/BreadcrumbSection.js @@ -9,7 +9,7 @@ import { customPropTypes, getUnhandledProps, getComponentType, - useKeyOnly, + getKeyOnly, useEventCallback, } from '../../lib' @@ -19,7 +19,7 @@ import { const BreadcrumbSection = React.forwardRef(function (props, ref) { const { active, children, className, content, href, link, onClick } = props - const classes = cx(useKeyOnly(active, 'active'), 'section', className) + const classes = cx(getKeyOnly(active, 'active'), 'section', className) const rest = getUnhandledProps(BreadcrumbSection, props) const ElementType = getComponentType(props, { getDefault: () => { diff --git a/src/collections/Form/Form.js b/src/collections/Form/Form.js index 8da9b9cd65..f383e5def7 100644 --- a/src/collections/Form/Form.js +++ b/src/collections/Form/Form.js @@ -3,7 +3,7 @@ import _ from 'lodash' import PropTypes from 'prop-types' import * as React from 'react' -import { getComponentType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib' +import { getComponentType, getUnhandledProps, SUI, getKeyOnly, getWidthProp } from '../../lib' import FormButton from './FormButton' import FormCheckbox from './FormCheckbox' import FormDropdown from './FormDropdown' @@ -50,14 +50,14 @@ const Form = React.forwardRef(function (props, ref) { const classes = cx( 'ui', size, - useKeyOnly(error, 'error'), - useKeyOnly(inverted, 'inverted'), - useKeyOnly(loading, 'loading'), - useKeyOnly(reply, 'reply'), - useKeyOnly(success, 'success'), - useKeyOnly(unstackable, 'unstackable'), - useKeyOnly(warning, 'warning'), - useWidthProp(widths, null, true), + getKeyOnly(error, 'error'), + getKeyOnly(inverted, 'inverted'), + getKeyOnly(loading, 'loading'), + getKeyOnly(reply, 'reply'), + getKeyOnly(success, 'success'), + getKeyOnly(unstackable, 'unstackable'), + getKeyOnly(warning, 'warning'), + getWidthProp(widths, null, true), 'form', className, ) diff --git a/src/collections/Form/FormField.js b/src/collections/Form/FormField.js index ae5c613b0d..c89c2a311d 100644 --- a/src/collections/Form/FormField.js +++ b/src/collections/Form/FormField.js @@ -10,8 +10,8 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useWidthProp, + getKeyOnly, + getWidthProp, } from '../../lib' import Label from '../../elements/Label' import Checkbox from '../../modules/Checkbox' @@ -44,11 +44,11 @@ const FormField = React.forwardRef(function (props, ref) { } = props const classes = cx( - useKeyOnly(disabled, 'disabled'), - useKeyOnly(error, 'error'), - useKeyOnly(inline, 'inline'), - useKeyOnly(required, 'required'), - useWidthProp(width, 'wide'), + getKeyOnly(disabled, 'disabled'), + getKeyOnly(error, 'error'), + getKeyOnly(inline, 'inline'), + getKeyOnly(required, 'required'), + getWidthProp(width, 'wide'), 'field', className, ) diff --git a/src/collections/Form/FormGroup.js b/src/collections/Form/FormGroup.js index 11220ef3c4..90375d6080 100644 --- a/src/collections/Form/FormGroup.js +++ b/src/collections/Form/FormGroup.js @@ -7,8 +7,8 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useWidthProp, + getKeyOnly, + getWidthProp, } from '../../lib' /** @@ -19,12 +19,12 @@ const FormGroup = React.forwardRef((props, ref) => { const { children, className, disabled, error, grouped, inline, unstackable, widths } = props const classes = cx( - useKeyOnly(error, 'error'), - useKeyOnly(disabled, 'disabled'), - useKeyOnly(grouped, 'grouped'), - useKeyOnly(inline, 'inline'), - useKeyOnly(unstackable, 'unstackable'), - useWidthProp(widths, null, true), + getKeyOnly(error, 'error'), + getKeyOnly(disabled, 'disabled'), + getKeyOnly(grouped, 'grouped'), + getKeyOnly(inline, 'inline'), + getKeyOnly(unstackable, 'unstackable'), + getWidthProp(widths, null, true), 'fields', className, ) diff --git a/src/collections/Grid/Grid.js b/src/collections/Grid/Grid.js index bd912ca028..e3d16d7b1b 100644 --- a/src/collections/Grid/Grid.js +++ b/src/collections/Grid/Grid.js @@ -7,12 +7,12 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useKeyOrValueAndKey, - useMultipleProp, - useTextAlignProp, - useVerticalAlignProp, - useWidthProp, + getKeyOnly, + getKeyOrValueAndKey, + getMultipleProp, + getTextAlignProp, + getVerticalAlignProp, + getWidthProp, } from '../../lib' import GridColumn from './GridColumn' import GridRow from './GridRow' @@ -42,20 +42,20 @@ const Grid = React.forwardRef(function (props, ref) { const classes = cx( 'ui', - useKeyOnly(centered, 'centered'), - useKeyOnly(container, 'container'), - useKeyOnly(doubling, 'doubling'), - useKeyOnly(inverted, 'inverted'), - useKeyOnly(stackable, 'stackable'), - useKeyOnly(stretched, 'stretched'), - useKeyOrValueAndKey(celled, 'celled'), - useKeyOrValueAndKey(divided, 'divided'), - useKeyOrValueAndKey(padded, 'padded'), - useKeyOrValueAndKey(relaxed, 'relaxed'), - useMultipleProp(reversed, 'reversed'), - useTextAlignProp(textAlign), - useVerticalAlignProp(verticalAlign), - useWidthProp(columns, 'column', true), + getKeyOnly(centered, 'centered'), + getKeyOnly(container, 'container'), + getKeyOnly(doubling, 'doubling'), + getKeyOnly(inverted, 'inverted'), + getKeyOnly(stackable, 'stackable'), + getKeyOnly(stretched, 'stretched'), + getKeyOrValueAndKey(celled, 'celled'), + getKeyOrValueAndKey(divided, 'divided'), + getKeyOrValueAndKey(padded, 'padded'), + getKeyOrValueAndKey(relaxed, 'relaxed'), + getMultipleProp(reversed, 'reversed'), + getTextAlignProp(textAlign), + getVerticalAlignProp(verticalAlign), + getWidthProp(columns, 'column', true), 'grid', className, ) diff --git a/src/collections/Grid/GridColumn.js b/src/collections/Grid/GridColumn.js index 248e9c2321..8d2326d02c 100644 --- a/src/collections/Grid/GridColumn.js +++ b/src/collections/Grid/GridColumn.js @@ -8,12 +8,12 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useMultipleProp, - useTextAlignProp, - useValueAndKey, - useVerticalAlignProp, - useWidthProp, + getKeyOnly, + getMultipleProp, + getTextAlignProp, + getValueAndKey, + getVerticalAlignProp, + getWidthProp, } from '../../lib' /** @@ -39,17 +39,17 @@ const GridColumn = React.forwardRef(function (props, ref) { const classes = cx( color, - useKeyOnly(stretched, 'stretched'), - useMultipleProp(only, 'only'), - useTextAlignProp(textAlign), - useValueAndKey(floated, 'floated'), - useVerticalAlignProp(verticalAlign), - useWidthProp(computer, 'wide computer'), - useWidthProp(largeScreen, 'wide large screen'), - useWidthProp(mobile, 'wide mobile'), - useWidthProp(tablet, 'wide tablet'), - useWidthProp(widescreen, 'wide widescreen'), - useWidthProp(width, 'wide'), + getKeyOnly(stretched, 'stretched'), + getMultipleProp(only, 'only'), + getTextAlignProp(textAlign), + getValueAndKey(floated, 'floated'), + getVerticalAlignProp(verticalAlign), + getWidthProp(computer, 'wide computer'), + getWidthProp(largeScreen, 'wide large screen'), + getWidthProp(mobile, 'wide mobile'), + getWidthProp(tablet, 'wide tablet'), + getWidthProp(widescreen, 'wide widescreen'), + getWidthProp(width, 'wide'), 'column', className, ) diff --git a/src/collections/Grid/GridRow.js b/src/collections/Grid/GridRow.js index bd26b13afd..f6c15d9c78 100644 --- a/src/collections/Grid/GridRow.js +++ b/src/collections/Grid/GridRow.js @@ -7,11 +7,11 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useMultipleProp, - useTextAlignProp, - useVerticalAlignProp, - useWidthProp, + getKeyOnly, + getMultipleProp, + getTextAlignProp, + getVerticalAlignProp, + getWidthProp, } from '../../lib' /** @@ -34,14 +34,14 @@ const GridRow = React.forwardRef(function (props, ref) { const classes = cx( color, - useKeyOnly(centered, 'centered'), - useKeyOnly(divided, 'divided'), - useKeyOnly(stretched, 'stretched'), - useMultipleProp(only, 'only'), - useMultipleProp(reversed, 'reversed'), - useTextAlignProp(textAlign), - useVerticalAlignProp(verticalAlign), - useWidthProp(columns, 'column', true), + getKeyOnly(centered, 'centered'), + getKeyOnly(divided, 'divided'), + getKeyOnly(stretched, 'stretched'), + getMultipleProp(only, 'only'), + getMultipleProp(reversed, 'reversed'), + getTextAlignProp(textAlign), + getVerticalAlignProp(verticalAlign), + getWidthProp(columns, 'column', true), 'row', className, ) diff --git a/src/collections/Menu/Menu.js b/src/collections/Menu/Menu.js index 149383557d..456f8eceaf 100644 --- a/src/collections/Menu/Menu.js +++ b/src/collections/Menu/Menu.js @@ -10,10 +10,10 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useKeyOrValueAndKey, - useValueAndKey, - useWidthProp, + getKeyOnly, + getKeyOrValueAndKey, + getValueAndKey, + getWidthProp, useAutoControlledValue, } from '../../lib' import MenuHeader from './MenuHeader' @@ -58,22 +58,22 @@ const Menu = React.forwardRef(function (props, ref) { 'ui', color, size, - useKeyOnly(borderless, 'borderless'), - useKeyOnly(compact, 'compact'), - useKeyOnly(fluid, 'fluid'), - useKeyOnly(inverted, 'inverted'), - useKeyOnly(pagination, 'pagination'), - useKeyOnly(pointing, 'pointing'), - useKeyOnly(secondary, 'secondary'), - useKeyOnly(stackable, 'stackable'), - useKeyOnly(text, 'text'), - useKeyOnly(vertical, 'vertical'), - useKeyOrValueAndKey(attached, 'attached'), - useKeyOrValueAndKey(floated, 'floated'), - useKeyOrValueAndKey(icon, 'icon'), - useKeyOrValueAndKey(tabular, 'tabular'), - useValueAndKey(fixed, 'fixed'), - useWidthProp(widths, 'item'), + getKeyOnly(borderless, 'borderless'), + getKeyOnly(compact, 'compact'), + getKeyOnly(fluid, 'fluid'), + getKeyOnly(inverted, 'inverted'), + getKeyOnly(pagination, 'pagination'), + getKeyOnly(pointing, 'pointing'), + getKeyOnly(secondary, 'secondary'), + getKeyOnly(stackable, 'stackable'), + getKeyOnly(text, 'text'), + getKeyOnly(vertical, 'vertical'), + getKeyOrValueAndKey(attached, 'attached'), + getKeyOrValueAndKey(floated, 'floated'), + getKeyOrValueAndKey(icon, 'icon'), + getKeyOrValueAndKey(tabular, 'tabular'), + getValueAndKey(fixed, 'fixed'), + getWidthProp(widths, 'item'), className, 'menu', ) diff --git a/src/collections/Menu/MenuItem.js b/src/collections/Menu/MenuItem.js index 6420541536..bbd2e22573 100644 --- a/src/collections/Menu/MenuItem.js +++ b/src/collections/Menu/MenuItem.js @@ -10,8 +10,8 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useKeyOrValueAndKey, + getKeyOnly, + getKeyOrValueAndKey, useEventCallback, } from '../../lib' import Icon from '../../elements/Icon' @@ -39,12 +39,12 @@ const MenuItem = React.forwardRef(function (props, ref) { const classes = cx( color, position, - useKeyOnly(active, 'active'), - useKeyOnly(disabled, 'disabled'), - useKeyOnly(icon === true || (icon && !(name || content)), 'icon'), - useKeyOnly(header, 'header'), - useKeyOnly(link, 'link'), - useKeyOrValueAndKey(fitted, 'fitted'), + getKeyOnly(active, 'active'), + getKeyOnly(disabled, 'disabled'), + getKeyOnly(icon === true || (icon && !(name || content)), 'icon'), + getKeyOnly(header, 'header'), + getKeyOnly(link, 'link'), + getKeyOrValueAndKey(fitted, 'fitted'), 'item', className, ) diff --git a/src/collections/Message/Message.js b/src/collections/Message/Message.js index c3b940151d..d1ef2a52aa 100644 --- a/src/collections/Message/Message.js +++ b/src/collections/Message/Message.js @@ -10,8 +10,8 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useKeyOrValueAndKey, + getKeyOnly, + getKeyOrValueAndKey, useEventCallback, } from '../../lib' import Icon from '../../elements/Icon' @@ -52,18 +52,18 @@ const Message = React.forwardRef(function (props, ref) { 'ui', color, size, - useKeyOnly(compact, 'compact'), - useKeyOnly(error, 'error'), - useKeyOnly(floating, 'floating'), - useKeyOnly(hidden, 'hidden'), - useKeyOnly(icon, 'icon'), - useKeyOnly(info, 'info'), - useKeyOnly(negative, 'negative'), - useKeyOnly(positive, 'positive'), - useKeyOnly(success, 'success'), - useKeyOnly(visible, 'visible'), - useKeyOnly(warning, 'warning'), - useKeyOrValueAndKey(attached, 'attached'), + getKeyOnly(compact, 'compact'), + getKeyOnly(error, 'error'), + getKeyOnly(floating, 'floating'), + getKeyOnly(hidden, 'hidden'), + getKeyOnly(icon, 'icon'), + getKeyOnly(info, 'info'), + getKeyOnly(negative, 'negative'), + getKeyOnly(positive, 'positive'), + getKeyOnly(success, 'success'), + getKeyOnly(visible, 'visible'), + getKeyOnly(warning, 'warning'), + getKeyOrValueAndKey(attached, 'attached'), 'message', className, ) diff --git a/src/collections/Table/Table.js b/src/collections/Table/Table.js index 80d6367920..e16d8b70ee 100644 --- a/src/collections/Table/Table.js +++ b/src/collections/Table/Table.js @@ -9,11 +9,11 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useKeyOrValueAndKey, - useTextAlignProp, - useVerticalAlignProp, - useWidthProp, + getKeyOnly, + getKeyOrValueAndKey, + getTextAlignProp, + getVerticalAlignProp, + getWidthProp, } from '../../lib' import TableBody from './TableBody' import TableCell from './TableCell' @@ -61,25 +61,25 @@ const Table = React.forwardRef(function (props, ref) { 'ui', color, size, - useKeyOnly(celled, 'celled'), - useKeyOnly(collapsing, 'collapsing'), - useKeyOnly(definition, 'definition'), - useKeyOnly(fixed, 'fixed'), - useKeyOnly(inverted, 'inverted'), - useKeyOnly(selectable, 'selectable'), - useKeyOnly(singleLine, 'single line'), - useKeyOnly(sortable, 'sortable'), - useKeyOnly(stackable, 'stackable'), - useKeyOnly(striped, 'striped'), - useKeyOnly(structured, 'structured'), - useKeyOnly(unstackable, 'unstackable'), - useKeyOrValueAndKey(attached, 'attached'), - useKeyOrValueAndKey(basic, 'basic'), - useKeyOrValueAndKey(compact, 'compact'), - useKeyOrValueAndKey(padded, 'padded'), - useTextAlignProp(textAlign), - useVerticalAlignProp(verticalAlign), - useWidthProp(columns, 'column'), + getKeyOnly(celled, 'celled'), + getKeyOnly(collapsing, 'collapsing'), + getKeyOnly(definition, 'definition'), + getKeyOnly(fixed, 'fixed'), + getKeyOnly(inverted, 'inverted'), + getKeyOnly(selectable, 'selectable'), + getKeyOnly(singleLine, 'single line'), + getKeyOnly(sortable, 'sortable'), + getKeyOnly(stackable, 'stackable'), + getKeyOnly(striped, 'striped'), + getKeyOnly(structured, 'structured'), + getKeyOnly(unstackable, 'unstackable'), + getKeyOrValueAndKey(attached, 'attached'), + getKeyOrValueAndKey(basic, 'basic'), + getKeyOrValueAndKey(compact, 'compact'), + getKeyOrValueAndKey(padded, 'padded'), + getTextAlignProp(textAlign), + getVerticalAlignProp(verticalAlign), + getWidthProp(columns, 'column'), 'table', className, ) diff --git a/src/collections/Table/TableCell.js b/src/collections/Table/TableCell.js index 48cd38d27d..b7217fd921 100644 --- a/src/collections/Table/TableCell.js +++ b/src/collections/Table/TableCell.js @@ -10,10 +10,10 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useTextAlignProp, - useVerticalAlignProp, - useWidthProp, + getKeyOnly, + getTextAlignProp, + getVerticalAlignProp, + getWidthProp, } from '../../lib' import Icon from '../../elements/Icon' @@ -41,18 +41,18 @@ const TableCell = React.forwardRef(function (props, ref) { } = props const classes = cx( - useKeyOnly(active, 'active'), - useKeyOnly(collapsing, 'collapsing'), - useKeyOnly(disabled, 'disabled'), - useKeyOnly(error, 'error'), - useKeyOnly(negative, 'negative'), - useKeyOnly(positive, 'positive'), - useKeyOnly(selectable, 'selectable'), - useKeyOnly(singleLine, 'single line'), - useKeyOnly(warning, 'warning'), - useTextAlignProp(textAlign), - useVerticalAlignProp(verticalAlign), - useWidthProp(width, 'wide'), + getKeyOnly(active, 'active'), + getKeyOnly(collapsing, 'collapsing'), + getKeyOnly(disabled, 'disabled'), + getKeyOnly(error, 'error'), + getKeyOnly(negative, 'negative'), + getKeyOnly(positive, 'positive'), + getKeyOnly(selectable, 'selectable'), + getKeyOnly(singleLine, 'single line'), + getKeyOnly(warning, 'warning'), + getTextAlignProp(textAlign), + getVerticalAlignProp(verticalAlign), + getWidthProp(width, 'wide'), className, ) const rest = getUnhandledProps(TableCell, props) diff --git a/src/collections/Table/TableHeader.js b/src/collections/Table/TableHeader.js index 99a5471ad0..e597d0140e 100644 --- a/src/collections/Table/TableHeader.js +++ b/src/collections/Table/TableHeader.js @@ -7,7 +7,7 @@ import { customPropTypes, getComponentType, getUnhandledProps, - useKeyOnly, + getKeyOnly, } from '../../lib' /** @@ -16,7 +16,7 @@ import { const TableHeader = React.forwardRef(function (props, ref) { const { children, className, content, fullWidth } = props - const classes = cx(useKeyOnly(fullWidth, 'full-width'), className) + const classes = cx(getKeyOnly(fullWidth, 'full-width'), className) const rest = getUnhandledProps(TableHeader, props) const ElementType = getComponentType(props, { defaultAs: 'thead' }) diff --git a/src/collections/Table/TableHeaderCell.js b/src/collections/Table/TableHeaderCell.js index efc1417829..c39fe06faf 100644 --- a/src/collections/Table/TableHeaderCell.js +++ b/src/collections/Table/TableHeaderCell.js @@ -2,7 +2,7 @@ import cx from 'clsx' import PropTypes from 'prop-types' import * as React from 'react' -import { getUnhandledProps, useValueAndKey } from '../../lib' +import { getUnhandledProps, getValueAndKey } from '../../lib' import TableCell from './TableCell' /** @@ -11,7 +11,7 @@ import TableCell from './TableCell' const TableHeaderCell = React.forwardRef(function (props, ref) { const { as = 'th', className, sorted } = props - const classes = cx(useValueAndKey(sorted, 'sorted'), className) + const classes = cx(getValueAndKey(sorted, 'sorted'), className) const rest = getUnhandledProps(TableHeaderCell, props) return diff --git a/src/collections/Table/TableRow.js b/src/collections/Table/TableRow.js index 0f0f9baa42..bd94de7eec 100644 --- a/src/collections/Table/TableRow.js +++ b/src/collections/Table/TableRow.js @@ -10,9 +10,9 @@ import { getComponentType, getUnhandledProps, SUI, - useKeyOnly, - useTextAlignProp, - useVerticalAlignProp, + getKeyOnly, + getTextAlignProp, + getVerticalAlignProp, } from '../../lib' import TableCell from './TableCell' @@ -36,14 +36,14 @@ const TableRow = React.forwardRef(function (props, ref) { } = props const classes = cx( - useKeyOnly(active, 'active'), - useKeyOnly(disabled, 'disabled'), - useKeyOnly(error, 'error'), - useKeyOnly(negative, 'negative'), - useKeyOnly(positive, 'positive'), - useKeyOnly(warning, 'warning'), - useTextAlignProp(textAlign), - useVerticalAlignProp(verticalAlign), + getKeyOnly(active, 'active'), + getKeyOnly(disabled, 'disabled'), + getKeyOnly(error, 'error'), + getKeyOnly(negative, 'negative'), + getKeyOnly(positive, 'positive'), + getKeyOnly(warning, 'warning'), + getTextAlignProp(textAlign), + getVerticalAlignProp(verticalAlign), className, ) const rest = getUnhandledProps(TableRow, props)