Skip to content

Commit

Permalink
chore: fix tailwind lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Dec 1, 2023
1 parent 2f0dfea commit 97a2772
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 35 deletions.
1 change: 0 additions & 1 deletion docs/src/components/BrandedTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export default function BrandedTile({

return (
<StyledWrapper
className="BrandedTile"
href={href}
target="_blank"
rel="noopener noreferrer"
Expand Down
2 changes: 2 additions & 0 deletions docs/src/components/Head/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export default function Head({ title, hasSiteName, description, path }: Props) {

return (
<Helmet>
{/* eslint-disable-next-line tailwindcss/no-custom-classname */}
<html lang="en" className={hasJs ? "js" : "no-js"} />
<script
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
document.documentElement.classList.remove("no-js");
Expand Down
1 change: 1 addition & 0 deletions docs/src/components/VisualList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const Visual = ({
<CardSection>
<Stack>
<H3 noId>{visualName}</H3>
{/* eslint-disable-next-line tailwindcss/no-custom-classname */}
<CodeBlock className="language-jsx">{exampleCode(visualName)}</CodeBlock>
{actions(visualObject, copied, copy)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const VerticalBadge = ({
return (
<div
className={cx(
"me-xs h-icon-large w-icon-large rounded-circle flex flex-shrink-0 items-center justify-center",
"me-xs h-icon-large w-icon-large rounded-circle flex shrink-0 items-center justify-center",
"[&_svg]:h-icon-small [&_svg]:w-icon-small",
type && BACKGROUND[type],
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Checkbox = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
</div>,
)}
{(label || info) && (
<div className={cx("ms-xs flex flex-1 flex-col", disabled ? "opacity-50" : "opacity-1")}>
<div className={cx("ms-xs flex flex-1 flex-col", disabled ? "opacity-50" : "opacity-100")}>
{label && (
<span className="font-base text-form-element-normal text-form-element-label-foreground [&_.orbit-text]:text-form-element-normal [&_.orbit-text]:text-form-element-label-foreground [&_.orbit-text]:leading-small font-medium leading-normal [&_.orbit-text]:font-medium">
{label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const FormFeedback = (props: Props) => {
className={cx(
"orbit-choice-group-feedback",
"text-critical-foreground font-base leading-small text-small font-medium",
"mt-xxxs relative top-full max-h-[--max-height] w-full overflow-hidden overflow-ellipsis whitespace-nowrap",
"mt-xxxs relative top-full max-h-[--max-height] w-full truncate",
"[&_a]:cursor-pointer [&_a]:underline",
"[&_strong]:text-ink-dark [&_b]:text-ink-dark [&_b]:font-medium [&_strong]:font-medium",
)}
Expand Down
7 changes: 3 additions & 4 deletions packages/orbit-components/src/Drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Drawer = ({
"z-drawer",
"duration-fast transition-colors ease-in-out",
overlayShown ? "visible" : "invisible",
shown ? "bg-drawer-overlay-background" : "transparent",
shown ? "bg-drawer-overlay-background" : "bg-transparent",
)}
onClick={handleOnClose}
data-test={dataTest}
Expand All @@ -113,7 +113,7 @@ const Drawer = ({
<aside
className={cx(
"box-border block",
"absolute bottom-0 top-0",
"absolute inset-y-0",
"h-full w-full",
"font-base",
"overflow-y-auto",
Expand All @@ -139,8 +139,7 @@ const Drawer = ({
suppressed && !bordered ? "bg-cloud-light" : "bg-white-normal",
fixedHeader && "z-sticky sticky top-0",
onlyIcon ? "justify-end" : "justify-between",
bordered &&
"border-cloud-normal border-b border-l-0 border-r-0 border-t-0 border-solid",
bordered && "border-cloud-normal border-x-0 border-b border-t-0 border-solid",
!noPadding && "px-md lm:ps-xl lm:pe-lg py-0",
)}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/orbit-components/src/InputField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const FakeInput = ({
<div
className={cx(
"orbit-input-field-fake-input",
"h-form-box-normal text-form-element-normal-font-size z-[1]",
"h-form-box-normal text-form-element-normal z-[1]",
"absolute left-0 top-0",
"duration-fast transition-all ease-in-out",
"rounded-large tb:rounded-normal box-border w-full",
Expand Down Expand Up @@ -211,7 +211,7 @@ const InputField = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
"flex items-center justify-center",
"pointer-events-none h-full",
"[&>.orbit-form-label]:mb-0",
"[&>.orbit-form-label]:text-form-box-normal [&>.orbit-form-label]:whitespace-nowrap [&>.orbit-form-label]:leading-normal",
"[&>.orbit-form-label]:text-form-element-normal [&>.orbit-form-label]:whitespace-nowrap [&>.orbit-form-label]:leading-normal",
"[&>.orbit-form-label]:z-[3]",
!tags && (error || help) ? "ps-xxs" : "ps-sm",
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/ListChoice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ListChoice = React.forwardRef<HTMLDivElement, Props>(
className={cx(
"orbit-list-choice",
"py-sm px-md box-border flex w-full items-center",
"border-b-cloud-normal bg-white-normal border-b-solid border-b",
"border-b-cloud-normal bg-white-normal border-b border-solid",
"duration-fast transition-[background-color] ease-in-out",
disabled ? "cursor-not-allowed" : "hover:bg-cloud-light cursor-pointer",
"hover:outline-none [&_button]:hover:bg-transparent",
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Loading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Loading = ({
"overflow-hidden",
"box-border",
type === TYPE_OPTIONS.BUTTON_LOADER &&
"t-0 absolute start-0 h-full w-full justify-center",
"absolute start-0 top-0 h-full w-full justify-center",
type === TYPE_OPTIONS.SEARCH_LOADER && "h-[40px] justify-start",
type === TYPE_OPTIONS.INLINE_LOADER
? "inline-flex min-h-[19px] justify-center"
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Modal/ModalHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ModalHeaderWrapper = ({
suppressed
? [
"bg-cloud-light py-xl px-md lm:p-xl",
"[&_~_.orbit-modal-section:first-of-type]:border-t-solid [&_~_.orbit-modal-section:first-of-type]:border-t-elevation-flat-border-color [&_~_.orbit-modal-section:first-of-type]:!mt-0 [&_~_.orbit-modal-section:first-of-type]:border-t",
"[&_~_.orbit-modal-section:first-of-type]:border-t-elevation-flat-border-color [&_~_.orbit-modal-section:first-of-type]:!mt-0 [&_~_.orbit-modal-section:first-of-type]:border-t [&_~_.orbit-modal-section:first-of-type]:border-solid",
]
: ["bg-white-normal pt-lg px-md lm:pt-xl lm:px-xl lm:pb-0 pb-0"],
!isMobileFullPage && "rounded-t-modal-mobile",
Expand Down
6 changes: 3 additions & 3 deletions packages/orbit-components/src/Modal/ModalSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export const ModalSectionWrapper = ({
className,
"orbit-modal-section",
"py-lg px-md lm:p-xl box-border w-full",
"border-b-solid border-b-elevation-flat-border-color border-b",
"border-b-elevation-flat-border-color border-b border-solid",
"last-of-type:[&:not(:last-child)]:rounded-b-none",
suppressed
? [
"bg-cloud-light",
"first-of-type:border-t-solid first-of-type:border-t-elevation-flat-border-color lm:first-of-type:mt-xxl first-of-type:border-t",
"last-of-type:border-b-solid last-of-type:border-b-elevation-flat-border-color [&_~_.orbit-modal-footer]:last-of-type:mt-md last-of-type:border-b",
"first-of-type:border-t-elevation-flat-border-color lm:first-of-type:mt-xxl first-of-type:border-t first-of-type:border-solid",
"last-of-type:border-b-elevation-flat-border-color [&_~_.orbit-modal-footer]:last-of-type:mt-md last-of-type:border-b last-of-type:border-solid",
closable && "first-of-type:mt-lg",
]
: [
Expand Down
12 changes: 6 additions & 6 deletions packages/orbit-components/src/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ const Modal = React.forwardRef<Instance, Props>(
className={cx(
"orbit-modal-body",
"z-overlay font-base fixed inset-0 box-border h-full w-full overflow-x-hidden outline-none",
!isMobileFullPage && "bg-[black] bg-opacity-50",
"lm:overflow-y-auto lm:p-xxl lm:bg-[black] lm:bg-opacity-50",
!isMobileFullPage && "bg-[black]/50",
"lm:overflow-y-auto lm:p-xxl lm:bg-[black]/50",
)}
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex={0}
Expand Down Expand Up @@ -463,7 +463,7 @@ const Modal = React.forwardRef<Instance, Props>(
"lm:[&_.orbit-modal-footer]:!p-xl",
fullyScrolled && "lm:[&_.orbit-modal-footer]:absolute",
]
: "lm[&_.orbit-modal-footer]:p-xl]",
: "lm:[&_.orbit-modal-footer]:p-xl",
fullyScrolled && "lm:[&_.orbit-modal-footer]:shadow-none",
scrolled
? [
Expand All @@ -484,17 +484,17 @@ const Modal = React.forwardRef<Instance, Props>(
{hasCloseContainer && (
<div
className={cx(
"z-modal-overlay h-form-box-large pointer-events-none right-0 box-border flex w-full items-center justify-end",
"z-overlay h-form-box-large pointer-events-none right-0 box-border flex w-full items-center justify-end",
"duration-fast transition-[shadow,_background-color] ease-in-out",
"lm:rounded-none",
fixedClose || scrolled ? "lm:top-0 lm:right-auto fixed" : "absolute",
!isMobileFullPage && (fixedClose || scrolled) ? "top-[32px]" : "top-0",
!isMobileFullPage && "rounded-t-modal-mobile",
modalWidth ? "max-w-[var(--orbit-modal-width)]" : maxWidthClasses[size],
scrolled && "shadow-fixed bg-white-normal",
"[&_+_.orbit-modal-section:first-of-type]:pt-xxxl [&_+_.orbit-modal-section:first-of-type]:bt-0 [&_+_.orbit-modal-section:first-of-type]:m-0",
"[&_+_.orbit-modal-section:first-of-type]:pt-xxxl [&_+_.orbit-modal-section:first-of-type]:m-0 [&_+_.orbit-modal-section:first-of-type]:border-t-0",
"[&_.orbit-button-primitive]:me-xxs [&_.orbit-button-primitive]:pointer-events-auto",
"[&_.orbit-button-primitive_svg]:transition-color [&_.orbit-button-primitive_svg]:duration-fast [&_.orbit-button-primitive_svg]:text-ink-normal [&_.orbit-button-primitive_svg]:ease-in-out",
"[&_.orbit-button-primitive_svg]:duration-fast [&_.orbit-button-primitive_svg]:text-ink-normal [&_.orbit-button-primitive_svg]:transition-[color] [&_.orbit-button-primitive_svg]:ease-in-out",
"[&_.orbit-button-primitive:hover_svg]:text-ink-light-hover [&_.orbit-button-primitive:active_svg]:text-ink-light-active",
)}
data-test="CloseContainer"
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/NavigationBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const NavigationBar = ({
data-test={dataTest}
id={id}
className={cx(
"bg-white-normal shadow-fixed p-sm z-navigation-bar fixed left-0 right-0 top-0 box-border flex w-full translate-x-0 items-center",
"bg-white-normal shadow-fixed p-sm z-navigation-bar fixed inset-x-0 top-0 box-border flex w-full translate-x-0 items-center",
"duration-normal transform-gpu transition-transform ease-in-out",
"tb:h-[64px] h-[52px]", // As defined on the const above
shown ? "translate-y-0" : "tb:translate-y-[-64px] translate-y-[-52px]", // As defined on the const above
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const PopoverContentWrapper = ({
className={cx(
"block",
"fixed",
"left-0 right-0 top-0",
"inset-x-0 top-0",
"h-full w-full",
// TODO: use bg-ink-dark/60 tw class
"bg-[rgba(37,42,49,.6)]",
Expand All @@ -159,7 +159,7 @@ const PopoverContentWrapper = ({
id={id}
className={cx(
"fixed",
"bottom-0 left-0 right-0",
"inset-x-0 bottom-0",
"h-auto w-full",
"z-[1000]",
"box-border",
Expand Down Expand Up @@ -190,7 +190,7 @@ const PopoverContentWrapper = ({
"will-change-transform",
"duration-fast transition-[opacity,transform] ease-in-out",
"lm:transform-none",
"lm-transition-none",
"lm:transition-none",
)}
>
<div
Expand Down
4 changes: 2 additions & 2 deletions packages/orbit-components/src/Radio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
<label
htmlFor={id}
className={cx(
"font-base items-self-start text-form-element-label-foreground relative flex w-full",
"font-base text-form-element-label-foreground relative flex w-full [align-items:self-start]",
disabled ? "cursor-not-allowed" : "cursor-pointer",
!disabled && [
!checked &&
Expand Down Expand Up @@ -85,7 +85,7 @@ const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
<div
className={cx(
"ms-xs flex flex-1 flex-col font-medium",
disabled ? "opacity-50" : "opacity-1",
disabled ? "opacity-50" : "opacity-100",
)}
>
{label && (
Expand Down
4 changes: 2 additions & 2 deletions packages/orbit-components/src/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const Select = React.forwardRef<HTMLSelectElement, Props>((props, ref) => {
className={cx(
"pointer-events-none z-[3] flex h-full items-center justify-center",
error || help ? "ps-xxs" : "ps-sm",
"[&_.orbit-form-label]:text-normal [&_.orbit-form-label]:mb-0 [&_.orbit-form-label]:inline-block [&_.orbit-form-label]:max-w-[20ch] [&_.orbit-form-label]:overflow-hidden [&_.orbit-form-label]:text-ellipsis [&_.orbit-form-label]:whitespace-nowrap [&_.orbit-form-label]:leading-normal",
"[&_.orbit-form-label]:text-normal [&_.orbit-form-label]:mb-0 [&_.orbit-form-label]:inline-block [&_.orbit-form-label]:max-w-[20ch] [&_.orbit-form-label]:truncate [&_.orbit-form-label]:leading-normal",
)}
ref={labelRef}
>
Expand Down Expand Up @@ -143,7 +143,7 @@ const Select = React.forwardRef<HTMLSelectElement, Props>((props, ref) => {
(disabled && "text-form-element-disabled-foreground") || filled
? "text-form-element-filled-foreground"
: "text-form-element-foreground",
"text-form-element-normal font-base pointer-events-none absolute bottom-0 top-0 z-[3] flex items-center",
"text-form-element-normal font-base pointer-events-none absolute inset-y-0 z-[3] flex items-center",
prefix ? "ps-[48px]" : "ps-sm",
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Tab = ({
data-test={dataTest}
className={cx(
"flex flex-1 flex-row items-center justify-between",
"appearance-none flex-row border-0",
"appearance-none border-0",
"min-w-fit",
"relative box-border",
"font-base font-medium",
Expand Down
3 changes: 1 addition & 2 deletions packages/orbit-components/src/Textarea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, Props>((props, ref) => {
"border border-transparent",
// TODO: remove when will be migrated from tmp-folder
resize === RESIZE_OPTIONS.VERTICAL ? "resize-y" : "resize-none",
"text-normal p-sm leading-normal",
error ? "shadow-form-element-error" : "shadow-form-element",
disabled ? "cursor-not-allowed" : "cursor-text",
fullHeight && "h-full flex-1",
disabled || readOnly
? "bg-form-element-disabled-background"
: [
"bg-form-element-background",
error ? "hover:shadow-form-element-error-hover" : "hover:bg-form-element-hover",
error ? "hover:shadow-form-element-error-hover" : "hover:shadow-form-element-hover",
],
"[&::placeholder]:text-form-element-foreground",
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Toast/ToastMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ToastMessage = ({
aria-live={ariaLive}
role="status"
className={cx(
"z-onTop duration-normal absolute left-0 right-0 flex cursor-grab transition-all ease-in-out will-change-transform",
"z-onTop duration-normal absolute inset-x-0 flex cursor-grab transition-all ease-in-out will-change-transform",
"translate-x-[var(--toast-message-offset-x)] translate-y-[var(--toast-message-offset-y)] opacity-[var(--toast-message-opacity)]",
placements[placement],
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ const ButtonPrimitive = React.forwardRef<HTMLButtonElement | HTMLAnchorElement,
className,
"orbit-button-primitive font-base duration-fast group relative max-w-full items-center border-none text-center leading-none transition-all [&>*]:align-middle [&_.orbit-loading-spinner]:stroke-[currentColor]",
fullWidth && "w-full",
centered || children == null ? "justify-center" : "justify-[var(--button-content-align)]",
centered || children == null
? "justify-center"
: "[justify-content:var(--button-content-align)]",
circled !== true && "rounded-large tb:rounded-normal",
isDisabled
? "cursor-not-allowed opacity-30"
Expand Down

0 comments on commit 97a2772

Please sign in to comment.