}) => (
+
+);
diff --git a/frontend/src/js/editor-v2/TreeNode.tsx b/frontend/src/js/editor-v2/TreeNode.tsx
index 985f5504ef..cde8a0d0fe 100644
--- a/frontend/src/js/editor-v2/TreeNode.tsx
+++ b/frontend/src/js/editor-v2/TreeNode.tsx
@@ -5,7 +5,7 @@ import { type DOMAttributes, memo } from "react";
import { useTranslation } from "react-i18next";
import { DNDType } from "../common/constants/dndTypes";
-import { Icon } from "../icon/FaIcon";
+import FaIcon from "../icon/FaIcon";
import { nodeIsConceptQueryNode, useActiveState } from "../model/node";
import { getRootNodeLabel } from "../standard-query-editor/helper";
import type {
@@ -296,7 +296,7 @@ export function TreeNode({
)}
{tree.dates?.excluded && (
-
+
{t("editorV2.datesExcluded")}
)}
diff --git a/frontend/src/js/editor-v2/date-restriction/DateModal.tsx b/frontend/src/js/editor-v2/date-restriction/DateModal.tsx
index 6ae1ad9f65..eb20c96827 100644
--- a/frontend/src/js/editor-v2/date-restriction/DateModal.tsx
+++ b/frontend/src/js/editor-v2/date-restriction/DateModal.tsx
@@ -8,7 +8,7 @@ import { useTranslation } from "react-i18next";
import type { DateRangeT } from "../../api/types";
import IconButton from "../../button/IconButton";
import type { DateStringMinMax } from "../../common/helpers/dateHelper";
-import { Icon } from "../../icon/FaIcon";
+import FaIcon from "../../icon/FaIcon";
import Modal from "../../modal/Modal";
import InputCheckbox from "../../ui-components/InputCheckbox";
import InputDateRange from "../../ui-components/InputDateRange";
@@ -101,7 +101,7 @@ export const DateModal = ({
/>
-
+
{t("queryNodeEditor.excludeTimestamps")}
["style"];
}
export interface FaIconPropsT extends IconStyleProps {
@@ -28,61 +26,72 @@ export interface FaIconPropsT extends IconStyleProps {
className?: string;
}
-const spin = keyframes`
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
-`;
-
-const shouldForwardProp = (prop: keyof FaIconPropsT) =>
- isPropValid(prop) || prop === "icon" || prop === "className";
+const icon = tv({
+ base: [
+ "w-[initial]!",
+ "text-sm",
+ "text-gray-800",
+ "[&.fa-spinner]:animate-spin-fast",
+ ],
+ variants: {
+ left: { true: "pr-[10px]" },
+ right: { true: "pl-[10px]" },
+ center: { true: "text-center" },
+ // later wins when both are set
+ tiny: { true: "text-[11px]" },
+ large: { true: "text-base" },
+ disabled: { true: "cursor-not-allowed" },
+ },
+});
// First matching flag wins, in this order
-const iconColor = (theme: Theme, props: IconStyleProps) => {
- if (props.disabled) return theme.col.grayMediumLight;
- if (props.red) return theme.col.red;
- if (props.gray) return theme.col.gray;
- if (props.active) return theme.col.blueGrayDark;
- if (props.white) return "#fff";
- if (props.light) return theme.col.blueGrayLight;
- if (props.main) return theme.col.blueGray;
- return theme.col.black;
+const colorClass = (p: IconStyleProps) => {
+ if (p.disabled) return "text-gray-400";
+ if (p.red) return "text-red";
+ if (p.gray) return "text-gray-500";
+ if (p.active) return "text-primary-500";
+ if (p.white) return "text-white";
+ if (p.light) return "text-primary-100";
+ if (p.main) return "text-primary-200";
+ return undefined;
};
-// @ts-ignore TODO: Figure out how to avoid a type error with styled here
-export const Icon = styled(FontAwesomeIcon, {
- shouldForwardProp,
-})`
- padding-right: ${({ left }) => (left ? "10px" : "0")};
- padding-left: ${({ right }) => (right ? "10px" : "0")};
- text-align: ${({ center }) => (center ? "center" : "left")};
- font-size: ${({ theme, large, tiny }) =>
- large ? theme.font.md : tiny ? theme.font.tiny : theme.font.sm};
- color: ${({ theme, ...props }) => iconColor(theme, props)};
- cursor: ${({ disabled }) => (disabled ? "not-allowed" : "inherit")};
- width: initial !important;
-
- &.fa-spinner {
- animation: ${spin} 0.5s linear 0s infinite;
- }
-`;
-
const FaIcon = ({
ref,
- icon,
+ icon: iconProp,
className,
- ...restProps
+ left,
+ center,
+ right,
+ white,
+ red,
+ light,
+ gray,
+ main,
+ active,
+ disabled,
+ tiny,
+ large,
+ small: _small, // only meaningful to IconButton
+ style,
}: FaIconPropsT & { ref?: Ref }) => {
return (
-
);
};
diff --git a/frontend/src/js/pane/TabNavigation.tsx b/frontend/src/js/pane/TabNavigation.tsx
index c2ac05ac21..a576b0a35d 100644
--- a/frontend/src/js/pane/TabNavigation.tsx
+++ b/frontend/src/js/pane/TabNavigation.tsx
@@ -1,6 +1,5 @@
import styled from "@emotion/styled";
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
-
import { tv } from "tailwind-variants";
import FaIcon from "../icon/FaIcon";
import { HoverNavigatable } from "../small-tab-navigation/HoverNavigatable";
diff --git a/frontend/src/js/previous-queries/upload/CSVColumnPicker.tsx b/frontend/src/js/previous-queries/upload/CSVColumnPicker.tsx
index 50550167e6..8c8d4af716 100644
--- a/frontend/src/js/previous-queries/upload/CSVColumnPicker.tsx
+++ b/frontend/src/js/previous-queries/upload/CSVColumnPicker.tsx
@@ -13,7 +13,6 @@ import type { TFunction } from "i18next";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { tv } from "tailwind-variants";
-
import type { QueryUploadConfigT, UploadQueryResponseT } from "../../api/types";
import IconButton from "../../button/IconButton";
import PrimaryButton from "../../button/PrimaryButton";
diff --git a/frontend/src/js/ui-components/DropzoneWithFileInput.tsx b/frontend/src/js/ui-components/DropzoneWithFileInput.tsx
index 883e89fd85..46d7622a86 100644
--- a/frontend/src/js/ui-components/DropzoneWithFileInput.tsx
+++ b/frontend/src/js/ui-components/DropzoneWithFileInput.tsx
@@ -39,7 +39,9 @@ const SxDropzone = styled(Dropzone)<{ isInitial?: boolean; tight?: boolean }>`
}
`;
-const SxSelectFileButton = styled(SelectFileButton)<{ outside?: boolean }>`
+const SxSelectFileButton = styled(SelectFileButton, {
+ shouldForwardProp: (prop) => prop !== "outside",
+})<{ outside?: boolean }>`
position: absolute;
top: ${({ outside }) => (outside ? "-26px" : "3px")};
right: ${({ outside }) => (outside ? "-12px" : "0")};
diff --git a/frontend/src/js/ui-components/InputDateRange.tsx b/frontend/src/js/ui-components/InputDateRange.tsx
index fd2266f306..a5a4bba947 100644
--- a/frontend/src/js/ui-components/InputDateRange.tsx
+++ b/frontend/src/js/ui-components/InputDateRange.tsx
@@ -14,7 +14,7 @@ import {
parseDateToState,
} from "../common/helpers/dateHelper";
import { exists } from "../common/helpers/exists";
-import { Icon } from "../icon/FaIcon";
+import FaIcon from "../icon/FaIcon";
import InfoTooltip from "../tooltip/InfoTooltip";
import InputDate from "./InputDate/InputDate";
@@ -172,7 +172,7 @@ const InputDateRange = ({
return (
-
+
{exists(indexPrefix) && # {indexPrefix}}
{label}
# {filterIdx}
) : (
-