mirror of
https://github.com/wassname/talk.git
synced 2026-07-28 11:27:05 +08:00
[CORL-550] More stable css classes (#2515)
* feat: more stable css classes * chore: renamee ValidationMessageHelper to FormValidationMessage * chore: Rename FormValidationMessage to FieldValidationMessage * feat: more css classes, icons use <i> tag * feat: stable classnames for gdpr features * feat: more css stable classnames
This commit is contained in:
@@ -110,6 +110,7 @@ export class Button extends React.Component<Props> {
|
||||
type={type}
|
||||
data-variant={variant}
|
||||
data-color={color}
|
||||
data-active={active}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -26,6 +26,7 @@ exports[`renders active state 1`] = `
|
||||
<ForwardRef(forwardRef)
|
||||
className="active"
|
||||
classes={Object {}}
|
||||
data-active={true}
|
||||
data-color="regular"
|
||||
data-variant="regular"
|
||||
>
|
||||
|
||||
@@ -41,7 +41,7 @@ const Icon: FunctionComponent<Props> = props => {
|
||||
className
|
||||
);
|
||||
return (
|
||||
<span
|
||||
<i
|
||||
className={rootClassName}
|
||||
aria-hidden="true"
|
||||
{...rest}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders correctly 1`] = `
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm"
|
||||
>
|
||||
face
|
||||
</span>
|
||||
</i>
|
||||
`;
|
||||
|
||||
exports[`renders correctly with specified size 1`] = `
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg"
|
||||
>
|
||||
bookmark
|
||||
</span>
|
||||
</i>
|
||||
`;
|
||||
|
||||
@@ -12,12 +12,12 @@ exports[`renders icon 1`] = `
|
||||
<div
|
||||
className="Message-root Message-colorGrey"
|
||||
>
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm MessageIcon-root"
|
||||
>
|
||||
alert
|
||||
</span>
|
||||
</i>
|
||||
Alert Message
|
||||
</div>
|
||||
`;
|
||||
|
||||
+4
-4
@@ -24,12 +24,12 @@ exports[`renders correctly 1`] = `
|
||||
tabIndex={0}
|
||||
title="Hide password"
|
||||
>
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm"
|
||||
>
|
||||
visibility
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,12 +59,12 @@ exports[`renders correctly 2`] = `
|
||||
tabIndex={0}
|
||||
title="Show password"
|
||||
>
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm"
|
||||
>
|
||||
visibility_off
|
||||
</span>
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,12 +19,12 @@ exports[`renders correctly 1`] = `
|
||||
aria-hidden={true}
|
||||
className="SelectField-afterWrapper SelectField-afterWrapperDisabled"
|
||||
>
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm"
|
||||
>
|
||||
expand_more
|
||||
</span>
|
||||
</i>
|
||||
</span>
|
||||
</span>
|
||||
`;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import cn from "classnames";
|
||||
import React, { FunctionComponent } from "react";
|
||||
|
||||
export interface TabContentProps {
|
||||
@@ -22,7 +23,7 @@ const TabContent: FunctionComponent<TabContentProps> = props => {
|
||||
.map((child: React.ReactElement<any>, i) =>
|
||||
React.cloneElement(child, {
|
||||
tabID: child.props.tabID ? child.props.tabID : i,
|
||||
className,
|
||||
className: cn(className, child.props.className),
|
||||
})
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`renders correctly 1`] = `
|
||||
<section
|
||||
aria-labelledby="tab-one"
|
||||
className=""
|
||||
id="tabPane-one"
|
||||
role="tabpanel"
|
||||
>
|
||||
|
||||
+2
-2
@@ -4,12 +4,12 @@ exports[`renders correctly 1`] = `
|
||||
<div
|
||||
className="Message-root Message-colorError custom"
|
||||
>
|
||||
<span
|
||||
<i
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm MessageIcon-root"
|
||||
>
|
||||
warning
|
||||
</span>
|
||||
</i>
|
||||
Hello World
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user