// Rôle : expose en développement un catalogue vivant et interactif des contrôles NDS. import { useState } from "react"; import { Icon } from "../components/Icon.jsx"; import { MixTagsInput } from "../components/MixTagsInput.jsx"; const SIZE_VALUES = { field: ["xs", "sm", "md"], button: ["xs", "sm", "md"], iconButton: ["micro", "xxs", "xs", "sm", "md"], group: ["xs", "sm", "md"], switch: ["xs", "sm", "md", "lg"], none: ["default"] }; const VARIANT_VALUES = { button: ["secondary", "primary", "ghost", "dashed", "danger"], iconButton: ["secondary", "primary", "ghost", "panel-toggle", "danger"], selectTrigger: ["default", "icon-picker"], textarea: ["default", "ghost"], swatch: ["color", "rainbow"], event: ["default", "dark"], surface: ["default", "interactive", "tool", "filter", "modal"], badge: ["primary", "neutral", "gold", "success", "warning", "danger"], feedback: ["info", "success", "warning", "danger"], position: ["left", "right"], none: ["default"] }; const EDGE_VALUES = ["none", "left", "middle", "right", "top", "center", "bottom", "top-left", "top-right", "bottom-right", "bottom-left"]; const BORDER_VALUES = ["default", "joined", "none"]; const SCROLL_AXIS_VALUES = ["horizontal", "vertical"]; const EVENT_COLOR_VALUES = ["#8b5cf6", "#f6c453", "#22d3ee", "#d946ef", "#22c55e", "#7d879f"]; const STATE_VALUES = ["normal", "active", "disabled"]; const FIELD_STATE_VALUES = ["normal", "disabled"]; const DEFAULT_STATE_VALUES = ["normal"]; const CONTENT_VALUES = ["text", "icon", "mixed"]; const MIX_TAG_TOKENS = [ { value: "base", label: "Base", title: "Valeur base" }, { value: "bonus", label: "Bonus", title: "Valeur bonus" } ]; const COLOR_TOKENS = [ ["Page", "var(--color-bg-page)"], ["Surface", "var(--color-bg-surface)"], ["Primary", "var(--color-primary)"], ["Gold", "var(--color-accent-gold)"], ["Cyan", "var(--color-accent-cyan)"], ["Danger", "var(--color-danger)"] ]; const RADIO_OPTIONS = { text: [ { value: "a", label: "A" }, { value: "b", label: "B" }, { value: "c", label: "C" } ], icon: [ { value: "rows", label: "Rows", icon: "rows" }, { value: "columns", label: "Columns", icon: "columns" } ], mixed: [ { value: "one", label: "One", icon: "eye-open" }, { value: "two", label: "Two", icon: "home" }, { value: "three", label: "Three", icon: "close" } ] }; const COMPONENTS = [ { id: "nds-input", name: "Input", className: "nds-input", sizes: SIZE_VALUES.field, variants: VARIANT_VALUES.none, attributes: { "data-size": SIZE_VALUES.field, "data-state": FIELD_STATE_VALUES }, render: ({ attributes, state, label, size }) => }, { id: "nds-select", name: "Select", className: "nds-select", sizes: SIZE_VALUES.field, variants: VARIANT_VALUES.none, attributes: { "data-size": SIZE_VALUES.field, "data-state": FIELD_STATE_VALUES }, render: ({ attributes, state, label }) => ( ) }, { id: "nds-select-trigger", name: "Select Trigger", className: "nds-select-trigger", sizes: SIZE_VALUES.field, variants: VARIANT_VALUES.selectTrigger, attributes: { "data-size": SIZE_VALUES.field, "data-variant": VARIANT_VALUES.selectTrigger, "data-state": STATE_VALUES }, render: ({ attributes, state, variant }) => ( ) }, { id: "nds-time", name: "Time Input", className: "nds-time", sizes: SIZE_VALUES.field, variants: VARIANT_VALUES.none, attributes: { "data-size": SIZE_VALUES.field, "data-state": FIELD_STATE_VALUES }, render: ({ attributes, state, label }) => }, { id: "nds-textarea", name: "Textarea", className: "nds-textarea", sizes: SIZE_VALUES.field, variants: VARIANT_VALUES.textarea, attributes: { "data-size": SIZE_VALUES.field, "data-variant": VARIANT_VALUES.textarea, "data-state": FIELD_STATE_VALUES }, render: ({ attributes, state, variant, label }) =>