diff --git a/plugins/renamer/src/App.css b/plugins/renamer/src/App.css index 35a373caa..83d124ff6 100644 --- a/plugins/renamer/src/App.css +++ b/plugins/renamer/src/App.css @@ -49,6 +49,10 @@ position: relative; } +[data-framer-styles="prerelease"] .tabs { + padding: 0 15px; +} + .tabs:before { content: ""; position: absolute; @@ -60,6 +64,10 @@ z-index: 1; } +[data-framer-styles="prerelease"] .tabs:before { + display: none; +} + .tabs-container { position: relative; display: flex; @@ -73,6 +81,16 @@ height: 30px; } +[data-framer-styles="prerelease"] .tabs-container { + justify-content: start; + background-color: transparent; + border-radius: 0; + padding: 10px 0; + height: auto; + border-top: 1px solid var(--framer-color-divider); + border-bottom: 1px solid var(--framer-color-divider); +} + .tab { position: relative; background: none !important; @@ -85,15 +103,33 @@ transition: color 200ms ease; } +[data-framer-styles="prerelease"] .tab { + flex: none; + width: fit-content; + height: 30px; + padding: 0 11px; + transition: + color 100ms ease, + background-color 100ms ease; +} + .tab:not(.active):hover { color: var(--framer-color-text-secondary); } +[data-framer-styles="prerelease"] .tab:not(.active):hover { + color: #999999; +} + .tab.active { color: var(--framer-color-text); font-weight: 600; } +[data-framer-styles="prerelease"] .tab.active { + background-color: var(--framer-color-bg-tertiary) !important; +} + .tab-bg-container { position: absolute; inset: 2px; @@ -221,7 +257,7 @@ inset: 0; } -.results-container:before { +body:not([data-framer-styles="prerelease"]) .results-container:before { content: ""; position: absolute; top: 0; @@ -250,6 +286,10 @@ padding: 15px; } +[data-framer-styles="prerelease"] .container { + padding: 10px 15px; +} + .results-list { position: relative; } @@ -364,6 +404,8 @@ .icon { flex-shrink: 0; + width: 12px; + height: 12px; } .before .icon { diff --git a/plugins/renamer/src/components/LayerIcon.tsx b/plugins/renamer/src/components/LayerIcon.tsx index 746462381..9d73e6abe 100644 --- a/plugins/renamer/src/components/LayerIcon.tsx +++ b/plugins/renamer/src/components/LayerIcon.tsx @@ -1,65 +1,197 @@ +import { useMemo } from "react" import type { IndexNodeType } from "../search/types" interface Props { type: IndexNodeType + isBreakpoint: boolean } -export default function LayerIcon({ type }: Props) { - const width = 12 - const height = 12 +export default function LayerIcon({ type, isBreakpoint }: Props) { + const isPrerelease = useMemo(() => document.body.getAttribute("data-framer-styles") === "prerelease", []) let icon = null - switch (type) { - case "TextNode": - icon = ( - - - - ) - break + if (isPrerelease) { + switch (type) { + case "TextNode": + icon = ( + + + + + + ) + break + case "FrameNode": + icon = isBreakpoint ? ( + + + + + + + + + + ) : ( + + + + ) + break - case "FrameNode": - icon = ( - - - - ) - break + case "ComponentInstanceNode": + icon = ( + + ) + break - case "ComponentInstanceNode": - icon = ( - - - - ) - break + default: + icon = null + } + } else { + switch (type) { + case "TextNode": + icon = ( + + + + ) + break - default: - icon = null + case "FrameNode": + icon = isBreakpoint ? ( + + + + + ) : ( + + + + ) + break + + case "ComponentInstanceNode": + icon = ( + + + + ) + break + + default: + icon = null + } } - return ( -
- {icon} -
- ) + return
{icon}
} diff --git a/plugins/renamer/src/components/Results.tsx b/plugins/renamer/src/components/Results.tsx index 624a93a4f..38929f052 100644 --- a/plugins/renamer/src/components/Results.tsx +++ b/plugins/renamer/src/components/Results.tsx @@ -119,7 +119,7 @@ export default function Results({ query, indexing, results, selectedNodeIds, get void focusResult(result) }} > - + ))} diff --git a/plugins/renamer/src/components/SearchIcon.tsx b/plugins/renamer/src/components/SearchIcon.tsx index 52720f5cf..3b89f25fc 100644 --- a/plugins/renamer/src/components/SearchIcon.tsx +++ b/plugins/renamer/src/components/SearchIcon.tsx @@ -1,10 +1,10 @@ export default function SearchIcon() { return ( - + + /> ) } diff --git a/plugins/renamer/src/components/Tabs.tsx b/plugins/renamer/src/components/Tabs.tsx index 789ed0c55..52d05ca97 100644 --- a/plugins/renamer/src/components/Tabs.tsx +++ b/plugins/renamer/src/components/Tabs.tsx @@ -1,4 +1,5 @@ import cx from "classnames" +import { useMemo } from "react" interface TabItem { label: string @@ -11,22 +12,25 @@ interface Props { } export default function Tabs({ items }: Props) { + const isPrerelease = useMemo(() => document.body.getAttribute("data-framer-styles") === "prerelease", []) const activeIndex = items.findIndex(item => item.active) return (
-
- {activeIndex !== -1 && ( -
- )} -
+ {!isPrerelease && ( +
+ {activeIndex !== -1 && ( +
+ )} +
+ )} {items.map((item, index) => (