Skip to content

Commit 74cbda4

Browse files
chore: rename classNameBuilder functions in "collections" (#4502)
* chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Table * chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Menu * chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Grid * chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Form * chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Breadcrumb * chore: replace deprecated classNameBuilder functions (replace prefix 'use' with 'get') in collections/Message --------- Co-authored-by: Oleksandr Fediashov <[email protected]>
1 parent 791e232 commit 74cbda4

File tree

15 files changed

+173
-173
lines changed

15 files changed

+173
-173
lines changed

src/collections/Breadcrumb/BreadcrumbSection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
customPropTypes,
1010
getUnhandledProps,
1111
getComponentType,
12-
useKeyOnly,
12+
getKeyOnly,
1313
useEventCallback,
1414
} from '../../lib'
1515

@@ -19,7 +19,7 @@ import {
1919
const BreadcrumbSection = React.forwardRef(function (props, ref) {
2020
const { active, children, className, content, href, link, onClick } = props
2121

22-
const classes = cx(useKeyOnly(active, 'active'), 'section', className)
22+
const classes = cx(getKeyOnly(active, 'active'), 'section', className)
2323
const rest = getUnhandledProps(BreadcrumbSection, props)
2424
const ElementType = getComponentType(props, {
2525
getDefault: () => {

src/collections/Form/Form.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import _ from 'lodash'
33
import PropTypes from 'prop-types'
44
import * as React from 'react'
55

6-
import { getComponentType, getUnhandledProps, SUI, useKeyOnly, useWidthProp } from '../../lib'
6+
import { getComponentType, getUnhandledProps, SUI, getKeyOnly, getWidthProp } from '../../lib'
77
import FormButton from './FormButton'
88
import FormCheckbox from './FormCheckbox'
99
import FormDropdown from './FormDropdown'
@@ -50,14 +50,14 @@ const Form = React.forwardRef(function (props, ref) {
5050
const classes = cx(
5151
'ui',
5252
size,
53-
useKeyOnly(error, 'error'),
54-
useKeyOnly(inverted, 'inverted'),
55-
useKeyOnly(loading, 'loading'),
56-
useKeyOnly(reply, 'reply'),
57-
useKeyOnly(success, 'success'),
58-
useKeyOnly(unstackable, 'unstackable'),
59-
useKeyOnly(warning, 'warning'),
60-
useWidthProp(widths, null, true),
53+
getKeyOnly(error, 'error'),
54+
getKeyOnly(inverted, 'inverted'),
55+
getKeyOnly(loading, 'loading'),
56+
getKeyOnly(reply, 'reply'),
57+
getKeyOnly(success, 'success'),
58+
getKeyOnly(unstackable, 'unstackable'),
59+
getKeyOnly(warning, 'warning'),
60+
getWidthProp(widths, null, true),
6161
'form',
6262
className,
6363
)

src/collections/Form/FormField.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
getComponentType,
1111
getUnhandledProps,
1212
SUI,
13-
useKeyOnly,
14-
useWidthProp,
13+
getKeyOnly,
14+
getWidthProp,
1515
} from '../../lib'
1616
import Label from '../../elements/Label'
1717
import Checkbox from '../../modules/Checkbox'
@@ -44,11 +44,11 @@ const FormField = React.forwardRef(function (props, ref) {
4444
} = props
4545

4646
const classes = cx(
47-
useKeyOnly(disabled, 'disabled'),
48-
useKeyOnly(error, 'error'),
49-
useKeyOnly(inline, 'inline'),
50-
useKeyOnly(required, 'required'),
51-
useWidthProp(width, 'wide'),
47+
getKeyOnly(disabled, 'disabled'),
48+
getKeyOnly(error, 'error'),
49+
getKeyOnly(inline, 'inline'),
50+
getKeyOnly(required, 'required'),
51+
getWidthProp(width, 'wide'),
5252
'field',
5353
className,
5454
)

src/collections/Form/FormGroup.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
getComponentType,
88
getUnhandledProps,
99
SUI,
10-
useKeyOnly,
11-
useWidthProp,
10+
getKeyOnly,
11+
getWidthProp,
1212
} from '../../lib'
1313

1414
/**
@@ -19,12 +19,12 @@ const FormGroup = React.forwardRef((props, ref) => {
1919
const { children, className, disabled, error, grouped, inline, unstackable, widths } = props
2020

2121
const classes = cx(
22-
useKeyOnly(error, 'error'),
23-
useKeyOnly(disabled, 'disabled'),
24-
useKeyOnly(grouped, 'grouped'),
25-
useKeyOnly(inline, 'inline'),
26-
useKeyOnly(unstackable, 'unstackable'),
27-
useWidthProp(widths, null, true),
22+
getKeyOnly(error, 'error'),
23+
getKeyOnly(disabled, 'disabled'),
24+
getKeyOnly(grouped, 'grouped'),
25+
getKeyOnly(inline, 'inline'),
26+
getKeyOnly(unstackable, 'unstackable'),
27+
getWidthProp(widths, null, true),
2828
'fields',
2929
className,
3030
)

src/collections/Grid/Grid.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import {
77
getComponentType,
88
getUnhandledProps,
99
SUI,
10-
useKeyOnly,
11-
useKeyOrValueAndKey,
12-
useMultipleProp,
13-
useTextAlignProp,
14-
useVerticalAlignProp,
15-
useWidthProp,
10+
getKeyOnly,
11+
getKeyOrValueAndKey,
12+
getMultipleProp,
13+
getTextAlignProp,
14+
getVerticalAlignProp,
15+
getWidthProp,
1616
} from '../../lib'
1717
import GridColumn from './GridColumn'
1818
import GridRow from './GridRow'
@@ -42,20 +42,20 @@ const Grid = React.forwardRef(function (props, ref) {
4242

4343
const classes = cx(
4444
'ui',
45-
useKeyOnly(centered, 'centered'),
46-
useKeyOnly(container, 'container'),
47-
useKeyOnly(doubling, 'doubling'),
48-
useKeyOnly(inverted, 'inverted'),
49-
useKeyOnly(stackable, 'stackable'),
50-
useKeyOnly(stretched, 'stretched'),
51-
useKeyOrValueAndKey(celled, 'celled'),
52-
useKeyOrValueAndKey(divided, 'divided'),
53-
useKeyOrValueAndKey(padded, 'padded'),
54-
useKeyOrValueAndKey(relaxed, 'relaxed'),
55-
useMultipleProp(reversed, 'reversed'),
56-
useTextAlignProp(textAlign),
57-
useVerticalAlignProp(verticalAlign),
58-
useWidthProp(columns, 'column', true),
45+
getKeyOnly(centered, 'centered'),
46+
getKeyOnly(container, 'container'),
47+
getKeyOnly(doubling, 'doubling'),
48+
getKeyOnly(inverted, 'inverted'),
49+
getKeyOnly(stackable, 'stackable'),
50+
getKeyOnly(stretched, 'stretched'),
51+
getKeyOrValueAndKey(celled, 'celled'),
52+
getKeyOrValueAndKey(divided, 'divided'),
53+
getKeyOrValueAndKey(padded, 'padded'),
54+
getKeyOrValueAndKey(relaxed, 'relaxed'),
55+
getMultipleProp(reversed, 'reversed'),
56+
getTextAlignProp(textAlign),
57+
getVerticalAlignProp(verticalAlign),
58+
getWidthProp(columns, 'column', true),
5959
'grid',
6060
className,
6161
)

src/collections/Grid/GridColumn.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
getComponentType,
99
getUnhandledProps,
1010
SUI,
11-
useKeyOnly,
12-
useMultipleProp,
13-
useTextAlignProp,
14-
useValueAndKey,
15-
useVerticalAlignProp,
16-
useWidthProp,
11+
getKeyOnly,
12+
getMultipleProp,
13+
getTextAlignProp,
14+
getValueAndKey,
15+
getVerticalAlignProp,
16+
getWidthProp,
1717
} from '../../lib'
1818

1919
/**
@@ -39,17 +39,17 @@ const GridColumn = React.forwardRef(function (props, ref) {
3939

4040
const classes = cx(
4141
color,
42-
useKeyOnly(stretched, 'stretched'),
43-
useMultipleProp(only, 'only'),
44-
useTextAlignProp(textAlign),
45-
useValueAndKey(floated, 'floated'),
46-
useVerticalAlignProp(verticalAlign),
47-
useWidthProp(computer, 'wide computer'),
48-
useWidthProp(largeScreen, 'wide large screen'),
49-
useWidthProp(mobile, 'wide mobile'),
50-
useWidthProp(tablet, 'wide tablet'),
51-
useWidthProp(widescreen, 'wide widescreen'),
52-
useWidthProp(width, 'wide'),
42+
getKeyOnly(stretched, 'stretched'),
43+
getMultipleProp(only, 'only'),
44+
getTextAlignProp(textAlign),
45+
getValueAndKey(floated, 'floated'),
46+
getVerticalAlignProp(verticalAlign),
47+
getWidthProp(computer, 'wide computer'),
48+
getWidthProp(largeScreen, 'wide large screen'),
49+
getWidthProp(mobile, 'wide mobile'),
50+
getWidthProp(tablet, 'wide tablet'),
51+
getWidthProp(widescreen, 'wide widescreen'),
52+
getWidthProp(width, 'wide'),
5353
'column',
5454
className,
5555
)

src/collections/Grid/GridRow.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {
77
getComponentType,
88
getUnhandledProps,
99
SUI,
10-
useKeyOnly,
11-
useMultipleProp,
12-
useTextAlignProp,
13-
useVerticalAlignProp,
14-
useWidthProp,
10+
getKeyOnly,
11+
getMultipleProp,
12+
getTextAlignProp,
13+
getVerticalAlignProp,
14+
getWidthProp,
1515
} from '../../lib'
1616

1717
/**
@@ -34,14 +34,14 @@ const GridRow = React.forwardRef(function (props, ref) {
3434

3535
const classes = cx(
3636
color,
37-
useKeyOnly(centered, 'centered'),
38-
useKeyOnly(divided, 'divided'),
39-
useKeyOnly(stretched, 'stretched'),
40-
useMultipleProp(only, 'only'),
41-
useMultipleProp(reversed, 'reversed'),
42-
useTextAlignProp(textAlign),
43-
useVerticalAlignProp(verticalAlign),
44-
useWidthProp(columns, 'column', true),
37+
getKeyOnly(centered, 'centered'),
38+
getKeyOnly(divided, 'divided'),
39+
getKeyOnly(stretched, 'stretched'),
40+
getMultipleProp(only, 'only'),
41+
getMultipleProp(reversed, 'reversed'),
42+
getTextAlignProp(textAlign),
43+
getVerticalAlignProp(verticalAlign),
44+
getWidthProp(columns, 'column', true),
4545
'row',
4646
className,
4747
)

src/collections/Menu/Menu.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {
1010
getComponentType,
1111
getUnhandledProps,
1212
SUI,
13-
useKeyOnly,
14-
useKeyOrValueAndKey,
15-
useValueAndKey,
16-
useWidthProp,
13+
getKeyOnly,
14+
getKeyOrValueAndKey,
15+
getValueAndKey,
16+
getWidthProp,
1717
useAutoControlledValue,
1818
} from '../../lib'
1919
import MenuHeader from './MenuHeader'
@@ -58,22 +58,22 @@ const Menu = React.forwardRef(function (props, ref) {
5858
'ui',
5959
color,
6060
size,
61-
useKeyOnly(borderless, 'borderless'),
62-
useKeyOnly(compact, 'compact'),
63-
useKeyOnly(fluid, 'fluid'),
64-
useKeyOnly(inverted, 'inverted'),
65-
useKeyOnly(pagination, 'pagination'),
66-
useKeyOnly(pointing, 'pointing'),
67-
useKeyOnly(secondary, 'secondary'),
68-
useKeyOnly(stackable, 'stackable'),
69-
useKeyOnly(text, 'text'),
70-
useKeyOnly(vertical, 'vertical'),
71-
useKeyOrValueAndKey(attached, 'attached'),
72-
useKeyOrValueAndKey(floated, 'floated'),
73-
useKeyOrValueAndKey(icon, 'icon'),
74-
useKeyOrValueAndKey(tabular, 'tabular'),
75-
useValueAndKey(fixed, 'fixed'),
76-
useWidthProp(widths, 'item'),
61+
getKeyOnly(borderless, 'borderless'),
62+
getKeyOnly(compact, 'compact'),
63+
getKeyOnly(fluid, 'fluid'),
64+
getKeyOnly(inverted, 'inverted'),
65+
getKeyOnly(pagination, 'pagination'),
66+
getKeyOnly(pointing, 'pointing'),
67+
getKeyOnly(secondary, 'secondary'),
68+
getKeyOnly(stackable, 'stackable'),
69+
getKeyOnly(text, 'text'),
70+
getKeyOnly(vertical, 'vertical'),
71+
getKeyOrValueAndKey(attached, 'attached'),
72+
getKeyOrValueAndKey(floated, 'floated'),
73+
getKeyOrValueAndKey(icon, 'icon'),
74+
getKeyOrValueAndKey(tabular, 'tabular'),
75+
getValueAndKey(fixed, 'fixed'),
76+
getWidthProp(widths, 'item'),
7777
className,
7878
'menu',
7979
)

src/collections/Menu/MenuItem.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
getComponentType,
1111
getUnhandledProps,
1212
SUI,
13-
useKeyOnly,
14-
useKeyOrValueAndKey,
13+
getKeyOnly,
14+
getKeyOrValueAndKey,
1515
useEventCallback,
1616
} from '../../lib'
1717
import Icon from '../../elements/Icon'
@@ -39,12 +39,12 @@ const MenuItem = React.forwardRef(function (props, ref) {
3939
const classes = cx(
4040
color,
4141
position,
42-
useKeyOnly(active, 'active'),
43-
useKeyOnly(disabled, 'disabled'),
44-
useKeyOnly(icon === true || (icon && !(name || content)), 'icon'),
45-
useKeyOnly(header, 'header'),
46-
useKeyOnly(link, 'link'),
47-
useKeyOrValueAndKey(fitted, 'fitted'),
42+
getKeyOnly(active, 'active'),
43+
getKeyOnly(disabled, 'disabled'),
44+
getKeyOnly(icon === true || (icon && !(name || content)), 'icon'),
45+
getKeyOnly(header, 'header'),
46+
getKeyOnly(link, 'link'),
47+
getKeyOrValueAndKey(fitted, 'fitted'),
4848
'item',
4949
className,
5050
)

src/collections/Message/Message.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
getComponentType,
1111
getUnhandledProps,
1212
SUI,
13-
useKeyOnly,
14-
useKeyOrValueAndKey,
13+
getKeyOnly,
14+
getKeyOrValueAndKey,
1515
useEventCallback,
1616
} from '../../lib'
1717
import Icon from '../../elements/Icon'
@@ -52,18 +52,18 @@ const Message = React.forwardRef(function (props, ref) {
5252
'ui',
5353
color,
5454
size,
55-
useKeyOnly(compact, 'compact'),
56-
useKeyOnly(error, 'error'),
57-
useKeyOnly(floating, 'floating'),
58-
useKeyOnly(hidden, 'hidden'),
59-
useKeyOnly(icon, 'icon'),
60-
useKeyOnly(info, 'info'),
61-
useKeyOnly(negative, 'negative'),
62-
useKeyOnly(positive, 'positive'),
63-
useKeyOnly(success, 'success'),
64-
useKeyOnly(visible, 'visible'),
65-
useKeyOnly(warning, 'warning'),
66-
useKeyOrValueAndKey(attached, 'attached'),
55+
getKeyOnly(compact, 'compact'),
56+
getKeyOnly(error, 'error'),
57+
getKeyOnly(floating, 'floating'),
58+
getKeyOnly(hidden, 'hidden'),
59+
getKeyOnly(icon, 'icon'),
60+
getKeyOnly(info, 'info'),
61+
getKeyOnly(negative, 'negative'),
62+
getKeyOnly(positive, 'positive'),
63+
getKeyOnly(success, 'success'),
64+
getKeyOnly(visible, 'visible'),
65+
getKeyOnly(warning, 'warning'),
66+
getKeyOrValueAndKey(attached, 'attached'),
6767
'message',
6868
className,
6969
)

0 commit comments

Comments
 (0)