import * as React from "react"; import * as SVG from "~/common/svg"; import * as Constants from "~/common/constants"; import { P1 } from "~/components/system/components/Typography"; import { Slider } from "~/components/system/components/Slider"; import { css } from "@emotion/react"; import Select from "~/components/core/FontFrame/Settings/Select"; const STYLES_LABEL = (theme) => css` font-size: 0.875rem; color: ${theme.fontPreviewDarkMode ? theme.system.grayDark3 : theme.semantic.textGrayLight}; margin-bottom: 4px; `; export const Controller = ({ value, options, onChange, selectSuffix = "", //NOTE(Amine): minWidth will remove junk when Select value change selectMinWidth, label, min, max, step, disabled, }) => { return (
{label}
); }; const STYLES_ALIGNEMENT_BUTTON = (theme) => css` display: flex; border-radius: 4px; border: 1px solid ${theme.fontPreviewDarkMode ? theme.semantic.textGrayDark : theme.system.grayLight5}; margin-left: 16px; button { display: block; box-sizing: border-box; cursor: pointer; padding: 8px 12px; margin: 0; border: none; } button:focus { outline: none; } svg { display: block; } `; const getIconColor = (isActive, theme) => { const darkMode = isActive ? theme.system.white : theme.semantic.textGray; const lightMode = isActive ? theme.system.grayDark4 : theme.semantic.textGray; return theme.fontPreviewDarkMode ? darkMode : lightMode; }; const getBackgroundColor = (isActive, theme) => { if (!isActive) return "transparent"; return theme.fontPreviewDarkMode ? theme.system.grayDark4 : theme.system.grayLight5; }; const STYLES_ALIGN_BUTTON = (isActive) => (theme) => css` background-color: ${getBackgroundColor(isActive, theme)}; path { stroke: ${getIconColor(isActive, theme)}; } `; export const AlignmentControl = ({ vAlign, textAlign, options, onChange, updateTextAlign, disabled, }) => { return (
Alignment