UNPKG

@wener/console

Version:
84 lines (83 loc) 3.05 kB
function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } import { HiCog, HiHome, HiInformationCircle, HiUser } from "react-icons/hi2"; import { IconSidebarLayout } from "./IconSidebarLayout.js"; var meta = { title: "components/LeftSideMenuBarLayout", component: IconSidebarLayout.Layout, parameters: { layout: "fullscreen" } }; export default meta; var sampleItems = [ { title: "\u9996\u9875", href: "/", icon: /*#__PURE__*/ React.createElement(HiHome, null) }, { title: "\u7528\u6237", href: "/users", icon: /*#__PURE__*/ React.createElement(HiUser, null) }, { title: "\u8BBE\u7F6E", href: "/settings", icon: /*#__PURE__*/ React.createElement(HiCog, null) }, { title: "\u5E2E\u52A9", href: "/help", icon: /*#__PURE__*/ React.createElement(HiInformationCircle, null) } ]; export var Default = { args: { top: sampleItems.slice(0, 1), center: _to_consumable_array(sampleItems).concat(_to_consumable_array(sampleItems), _to_consumable_array(sampleItems)), bottom: sampleItems.slice(3), className: "h-screen", children: /*#__PURE__*/ React.createElement("div", { className: "bg-base-100 flex h-full items-center justify-center p-8" }, /*#__PURE__*/ React.createElement("div", { className: "text-center" }, /*#__PURE__*/ React.createElement("h1", { className: "mb-4 text-2xl font-bold" }, "IconSidebarLayout Demo"), /*#__PURE__*/ React.createElement("p", { className: "text-base-content/70" }, "This is the main content area. The left sidebar contains navigation icons."))) } };