"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var colors_stories_exports = {};
__export(colors_stories_exports, {
  Colors: () => Colors,
  default: () => colors_stories_default
});
module.exports = __toCommonJS(colors_stories_exports);
var import_react = __toESM(require("react"));
var import_styled_components = __toESM(require("styled-components"));
var import_Text = __toESM(require("../../components/asorted/Text"));
var import_Flex = __toESM(require("../../components/layout/Flex"));
var import_ui_shared = require("@ledgerhq/ui-shared");
var colors_stories_default = { title: "Particles" };
const ColorArea = import_styled_components.default.div`
  width: 200px;
  aspect-ratio: 1;
  background-color: ${(p) => {
  return p.theme.colors[p.type][p.shade];
}};
  cursor: pointer;
  border-radius: 2px;
`;
const CardColor = ({ shade, type, value }) => {
  const [isHovered, setIsHovered] = (0, import_react.useState)(false);
  const onClick = (type2, shade2) => {
    navigator.clipboard.writeText(`p.theme.colors.${type2}.${shade2}`);
  };
  return /* @__PURE__ */ import_react.default.createElement(
    import_Flex.default,
    {
      flexDirection: "column",
      alignItems: "center",
      onMouseEnter: () => setIsHovered(true),
      onMouseLeave: () => setIsHovered(false)
    },
    /* @__PURE__ */ import_react.default.createElement(
      ColorArea,
      {
        type,
        shade,
        onClick: () => onClick(type, shade)
      }
    ),
    /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "tiny" }, isHovered ? value : shade)
  );
};
const { type: _, ...palette } = import_ui_shared.palettes.light;
const Colors = () => /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flexDirection: "column", rowGap: "2rem" }, Object.entries(palette).map(([type, shades]) => /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { flexDirection: "column", rowGap: "1rem" }, /* @__PURE__ */ import_react.default.createElement(import_Text.default, { variant: "h2", textTransform: "uppercase" }, type), /* @__PURE__ */ import_react.default.createElement(import_Flex.default, { columnGap: "0.5rem", rowGap: "0.5rem", flexWrap: "wrap" }, Object.entries(shades).map(([shade, value]) => /* @__PURE__ */ import_react.default.createElement(CardColor, { key: shade, shade, type, value }))))));
//# sourceMappingURL=colors.stories.js.map
