@nurl/panda-preset
Version:
Official Panda-CSS preset for the Ganglion Design System.
126 lines (125 loc) • 3.26 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/recipes/switch.ts
var switch_exports = {};
__export(switch_exports, {
switchInput: () => switchInput
});
module.exports = __toCommonJS(switch_exports);
var import_dev = require("@pandacss/dev");
var import_states = require("./shared/states.cjs");
var switchInput = (0, import_dev.defineSlotRecipe)({
className: "switch-input",
description: "The styles for the SwitchInput component",
slots: ["root", "track", "control", "thumb"],
base: {
root: {
// just use the hstack recipe
userSelect: "none",
_invalid: {
color: "danger.text.200"
},
_disabled: {
opacity: 0.5,
cursor: "not-allowed"
}
},
track: {
alignItems: "center",
bgColor: "inherit",
display: "flex",
justifyContent: "flex-start",
rounded: "full",
outline: "1px solid",
outlineColor: "action.border.initial",
overflow: "hidden",
transition: "all 200ms ease-in-out",
_groupChecked: {
bgColor: "action.bg.initial"
},
_groupInvalid: {
outlineColor: "danger.border.initial",
_groupChecked: {
bgColor: "danger.bg.initial"
}
}
},
control: {
display: "none",
h: "full",
w: "full",
rounded: "full",
...import_states.focusStates
},
thumb: {
bgColor: "action.text.100",
rounded: "full",
shadow: "sm",
scale: 0.6,
transformOrigin: "center",
transition: "all 150ms ease-in-out",
willChange: "transform, scale, background-color",
_peerInvalid: {
bgColor: "danger.bg.initial",
_groupChecked: {
bgColor: "danger.text.inverse"
}
},
_peerChecked: {
bgColor: "action.text.initial",
scale: 1,
transform: "translate3d(130%, 0, 0)"
}
}
},
variants: {
size: {
sm: {
track: {
h: "1rem",
pxi: "2px",
w: "2rem"
},
thumb: {
h: "0.75rem",
w: "0.75rem"
}
},
lg: {
track: {
h: "1.5rem",
pxi: "3px",
w: "3rem"
},
thumb: {
h: "1.125rem",
w: "1.125rem"
}
}
}
},
defaultVariants: {
size: "lg"
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
switchInput
});
//# sourceMappingURL=switch.cjs.map