UNPKG

fui-fancyui

Version:
60 lines (56 loc) 1.48 kB
import { styled as o, css as i } from "styled-components"; import r from "../../../design/designFunctions/arrayToCssValues/arrayToCssValues.js"; import s from "../../../design/designFunctions/simpleColorTransition/simpleTransition.js"; import c from "../../../design/theme/themeStore/themeStore.js"; import { sizeSettings as l } from "./sizeSettings.js"; const a = (e) => { const { $iconAlign: n } = e, t = c.getState().theme.spacing; return i` ${(() => { switch (n) { case "right": return i` gap: ${t.xs}; order: 1; `; default: case "left": return i` gap: ${t.xs}; `; } })()} i { display: flex; justify-content: center; } `; }, u = o.div` list-style: none; height: 100%; width: 100%; display: flex; justify-content: center; label { width: 100%; display: flex; flex-direction: row; justify-content: center; box-sizing: border-box; align-items: center; text-align: center; cursor: pointer; user-select: none; padding: ${({ $sizeC: e }) => r(l[e].padding, "spacing")}; ${({ $hasIcon: e, $hasLabel: n, $iconAlign: t }) => e && n && a({ $iconAlign: t })} will-change: transform; // ís needed for safari to prevent icons jumping tested on the iphone 18.12.23 newest versions ${s} } input { display: none; } ${({ $externalStyle: e }) => e}; `; export { u as SwitchButtonStyle };