Skip to content

Commit d4cb8e8

Browse files
fix(@clayui/color-picker): remove last-row classes and API that was added on accident
1 parent 828fb77 commit d4cb8e8

File tree

4 files changed

+73
-91
lines changed

4 files changed

+73
-91
lines changed

packages/clay-color-picker/src/Basic.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6-
import classNames from 'classnames';
76
import React from 'react';
87

98
import Splotch from './Splotch';
@@ -42,12 +41,7 @@ const ClayColorPickerBasic: React.FunctionComponent<IProps> = ({
4241

4342
<div className="clay-color-swatch">
4443
{colors.map((hex, i) => (
45-
<div
46-
className={classNames('clay-color-swatch-item', {
47-
'clay-color-swatch-item-last-row': i >= 20,
48-
})}
49-
key={i}
50-
>
44+
<div className="clay-color-swatch-item" key={i}>
5145
<Splotch onClick={() => onChange(hex)} value={hex} />
5246
</div>
5347
))}

packages/clay-color-picker/src/Custom.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import ClayForm, {ClayInput} from '@clayui/form';
77
import Icon from '@clayui/icon';
88
import {TInternalStateOnChange, useInternalState} from '@clayui/shared';
9-
import classNames from 'classnames';
109
import React from 'react';
1110
import tinycolor from 'tinycolor2';
1211

@@ -197,12 +196,7 @@ const ClayColorPickerCustom: React.FunctionComponent<IProps> = ({
197196
{showPalette && (
198197
<div className="clay-color-swatch">
199198
{colors.map((hex, i) => (
200-
<div
201-
className={classNames('clay-color-swatch-item', {
202-
'clay-color-swatch-item-last-row': i >= 6,
203-
})}
204-
key={i}
205-
>
199+
<div className="clay-color-swatch-item" key={i}>
206200
<Splotch
207201
active={i === activeSplotchIndex}
208202
onClick={() => {

packages/clay-color-picker/src/Splotch.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,13 @@ interface IProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
2323
* The hex value of the splotch color
2424
*/
2525
value: string;
26-
27-
/**
28-
* Adds class `clay-color-swatch-item-last-row`
29-
*/
30-
last?: boolean;
3126
}
3227

3328
/**
3429
* Renders component that displays a color
3530
*/
3631
const ClayColorPickerSplotch = React.forwardRef<HTMLButtonElement, IProps>(
37-
({active, className, last, size, value, ...otherProps}, ref) => {
32+
({active, className, size, value, ...otherProps}, ref) => {
3833
const color = tinycolor(value);
3934

4035
const isHex = (color.getFormat() || '').match('hex');
@@ -48,7 +43,6 @@ const ClayColorPickerSplotch = React.forwardRef<HTMLButtonElement, IProps>(
4843
className={classNames('clay-color-btn', className, {
4944
active,
5045
'clay-color-btn-bordered': requireBorder,
51-
'clay-color-swatch-item-last-row': last,
5246
})}
5347
displayType={null}
5448
ref={ref}

0 commit comments

Comments
 (0)