@aiquants/menu-bar 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -3
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/styles/menu-bar.css +1 -1
- package/dist/styles/menu-bar.standalone.css +3 -0
- package/package.json +6 -4
- package/src/MenuBar.tsx +202 -0
- package/src/components/SessionInfo.tsx +79 -0
- package/src/contents/MenuContent.tsx +83 -0
- package/src/contents/MenuList.tsx +393 -0
- package/src/contents/OverlayShadow.tsx +30 -0
- package/src/elements/MenuSwitch.tsx +118 -0
- package/src/index.ts +6 -0
- package/src/styles/components.entry.css +9 -0
- package/src/styles/menu-bar.css +233 -0
- package/src/styles/standalone.entry.css +12 -0
- package/src/types/user.ts +12 -0
- package/src/types.ts +1 -0
- package/dist/menu-bar.css +0 -1
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@ export type { Theme } from '@aiquants/menu-bar';
|
|
|
33
33
|
export type { SessionInfoProps, LinkProps } from '@aiquants/menu-bar';
|
|
34
34
|
export type { UserProfile } from '@aiquants/menu-bar';
|
|
35
35
|
|
|
36
|
-
// CSS (
|
|
37
|
-
import '@aiquants/menu-bar/styles/menu-bar.css';
|
|
36
|
+
// CSS — non-Tailwind hosts load the self-contained standalone build once (Tailwind hosts: see "Styling (CSS)")
|
|
37
|
+
import '@aiquants/menu-bar/styles/menu-bar.standalone.css';
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Basic Usage
|
|
@@ -42,7 +42,7 @@ import '@aiquants/menu-bar/styles/menu-bar.css';
|
|
|
42
42
|
```tsx
|
|
43
43
|
import React, { useState } from 'react';
|
|
44
44
|
import { MenuBar } from '@aiquants/menu-bar';
|
|
45
|
-
import '@aiquants/menu-bar/styles/menu-bar.css';
|
|
45
|
+
import '@aiquants/menu-bar/styles/menu-bar.standalone.css';
|
|
46
46
|
|
|
47
47
|
function App() {
|
|
48
48
|
const [theme, setTheme] = useState('light');
|
|
@@ -163,6 +163,31 @@ interface LinkProps {
|
|
|
163
163
|
}
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
## Styling (CSS)
|
|
167
|
+
|
|
168
|
+
The package ships **two CSS artifacts** — pick the one that matches your host.
|
|
169
|
+
|
|
170
|
+
- **Tailwind v4 host** — import the components-only build into the `components` layer, and let your own Tailwind build generate the JSX utility classes by scanning the package source:
|
|
171
|
+
|
|
172
|
+
```css
|
|
173
|
+
/* app tailwind.css */
|
|
174
|
+
@import "@aiquants/menu-bar/styles/menu-bar.css" layer(components);
|
|
175
|
+
@source "../node_modules/@aiquants/menu-bar/src/**/*.{ts,tsx}";
|
|
176
|
+
/* monorepo: @source "../../../../packages/menu-bar/src/**/*.{ts,tsx}"; */
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`menu-bar.css` (Artifact A) carries only the hand-written `.aiquants-*` component classes — no `:root` theme variables, no Tailwind utilities, no preflight — so it drops into `layer(components)` safely.
|
|
180
|
+
The one `:root` rule it emits is menu-bar's own runtime variable `--aiquants-menu-pinned-width`, which the component sets inline at runtime (a runtime input, not a theme override).
|
|
181
|
+
Do **not** also `@import` the standalone build in a Tailwind host: it re-emits the same utilities your build produces, and two concatenated builds cannot reproduce the single-build canonical order (base → variants), so base/variant cascade winners flip.
|
|
182
|
+
|
|
183
|
+
- **Non-Tailwind host** — load the single self-contained standalone build (via `<link>` or a plain `@import`); it bundles the component classes plus every JSX utility:
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
@import "@aiquants/menu-bar/styles/menu-bar.standalone.css";
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Dark mode keys off the `.dark` class — add `.dark` to `<html>` to enable the dark styles.
|
|
190
|
+
|
|
166
191
|
## Theming
|
|
167
192
|
|
|
168
193
|
The menu bar supports both light and dark themes. All styles are scoped with the `.aiquants-menu-bar` class to prevent conflicts with your application's styles.
|
package/dist/index.es.js
CHANGED
|
@@ -481,7 +481,7 @@ const Se = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
|
|
|
481
481
|
}, []);
|
|
482
482
|
return M(() => {
|
|
483
483
|
r ? y() : j();
|
|
484
|
-
}, [r, y, j]), /* @__PURE__ */ n.jsxs("button", { type: "button", className: "aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden", onClick: s, onFocus: m, onMouseDown: S, tabIndex: -1, children: [
|
|
484
|
+
}, [r, y, j]), /* @__PURE__ */ n.jsxs("button", { type: "button", "data-aqmb-menu-switch": !0, className: "aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden", onClick: s, onFocus: m, onMouseDown: S, tabIndex: -1, children: [
|
|
485
485
|
/* @__PURE__ */ n.jsx("span", { className: "absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none", ref: u }),
|
|
486
486
|
/* @__PURE__ */ n.jsx("span", { className: "absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none", ref: h }),
|
|
487
487
|
/* @__PURE__ */ n.jsx("span", { className: "absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none", ref: v }),
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(T,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],o):(T=typeof globalThis<"u"?globalThis:T||self,o(T["@aiquants/menu-bar"]={},T.React,T["lucide-react"],T.ReactRouterDOM))})(this,(function(T,o,C,z){"use strict";var L={exports:{}},A={};var Q;function ue(){if(Q)return A;Q=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(i,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var b in u)b!=="key"&&(c[b]=u[b])}else c=u;return u=c.ref,{$$typeof:t,type:i,key:d,ref:u!==void 0?u:null,props:c}}return A.Fragment=r,A.jsx=l,A.jsxs=l,A}var M={};var X;function de(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===w?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case O:return"Suspense";case J:return"SuspenseList";case D:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case s:return"Portal";case U:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case H:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return a=e.displayName||null,a!==null?a:t(e.type)||"Memo";case R:a=e._payload,e=e._init;try{return t(e(a))}catch{}}return null}function r(e){return""+e}function l(e){try{r(e);var a=!1}catch{a=!0}if(a){a=console;var h=a.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),r(e)}}function i(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===R)return"<...>";try{var a=t(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function d(e){if(P.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function b(e,a){function h(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}function v(){var e=t(this.type);return ae[e]||(ae[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,a,h,g,Y,
|
|
1
|
+
(function(T,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("lucide-react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","react-router-dom"],o):(T=typeof globalThis<"u"?globalThis:T||self,o(T["@aiquants/menu-bar"]={},T.React,T["lucide-react"],T.ReactRouterDOM))})(this,(function(T,o,C,z){"use strict";var L={exports:{}},A={};var Q;function ue(){if(Q)return A;Q=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(i,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var b in u)b!=="key"&&(c[b]=u[b])}else c=u;return u=c.ref,{$$typeof:t,type:i,key:d,ref:u!==void 0?u:null,props:c}}return A.Fragment=r,A.jsx=l,A.jsxs=l,A}var M={};var X;function de(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===w?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case O:return"Suspense";case J:return"SuspenseList";case D:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case s:return"Portal";case U:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case H:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return a=e.displayName||null,a!==null?a:t(e.type)||"Memo";case R:a=e._payload,e=e._init;try{return t(e(a))}catch{}}return null}function r(e){return""+e}function l(e){try{r(e);var a=!1}catch{a=!0}if(a){a=console;var h=a.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return h.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),r(e)}}function i(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===R)return"<...>";try{var a=t(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function d(e){if(P.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function b(e,a){function h(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}h.isReactWarning=!0,Object.defineProperty(e,"key",{get:h,configurable:!0})}function v(){var e=t(this.type);return ae[e]||(ae[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,a,h,g,Y,q){var y=h.ref;return e={$$typeof:_,type:e,key:a,props:h,_owner:g},(y!==void 0?y:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e,a,h,g,Y,q){var y=a.children;if(y!==void 0)if(g)if(V(y)){for(g=0;g<y.length;g++)k(y[g]);Object.freeze&&Object.freeze(y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(y);if(P.call(a,"key")){y=t(e);var I=Object.keys(a).filter(function(Ee){return Ee!=="key"});g=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",ce[y+g]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,g,y,I,y),ce[y+g]=!0)}if(y=null,h!==void 0&&(l(h),y=""+h),d(a)&&(l(a.key),y=""+a.key),"key"in a){h={};for(var q in a)q!=="key"&&(h[q]=a[q])}else h=a;return y&&b(h,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,y,h,u(),Y,B)}function k(e){j(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===R&&(e._payload.status==="fulfilled"?j(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function j(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}var x=o,_=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),S=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,Z=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(e){return e()}};var oe,ae={},le=x.react_stack_bottom_frame.bind(x,c)(),ie=Z(i(c)),ce={};M.Fragment=p,M.jsx=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!1,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)},M.jsxs=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!0,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)}})()),M}var K;function fe(){return K||(K=1,process.env.NODE_ENV==="production"?L.exports=ue():L.exports=de()),L.exports}var n=fe();const me="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",$=({to:t,className:r,children:l})=>n.jsx("a",{href:t,className:r,children:l}),pe=t=>{const{user:r,LinkComponent:l=$}=t;return n.jsx("div",{className:"max-h-20 max-w-52",children:n.jsx("div",{className:"flex grow flex-col",children:r?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-row",children:[n.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:n.jsx("img",{className:"object-contain",src:r.photo||me,"aria-label":"profile photo"})}),n.jsxs("div",{className:"mx-1 flex flex-col",children:[n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),n.jsx(l,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs",children:r.displayName})]}):n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs",children:"ログインはこちら"})})})},he=typeof window<"u"?o.useLayoutEffect:o.useEffect,ee="aiquants-menu-scroll",ne=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),be={report:C.FileText,slip:C.FileText,table:C.Table,chart:C.BarChart,download:C.Download,lock:C.Lock,href:C.Link},xe=({mark:t,children:r})=>{const l=t?be[t]:void 0;return l?n.jsxs("div",{className:"flex flex-nowrap items-center",children:[n.jsx(l,{className:"h-4 w-4"}),n.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:r})]}):n.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:r})},F=(t,r)=>r?{menu:{id:t.id,title:t.title,href:t.href},submenu:{subid:r.subid,title:r.title,href:r.href,mark:r.mark,new:r.new}}:{menu:{id:t.id,title:t.title,href:t.href}},ge=({item:t,parentMenu:r,onMenuSelected:l})=>{if(t.href==="separator")return n.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const i=n.jsx(xe,{mark:t.mark,children:t.title}),u={onClick:()=>{l&&l(F(r,t))}};return t.new?n.jsx("a",{href:t.href,rel:"noopener noreferrer",target:"_blank",...u,children:i}):ne.test(t.href)?n.jsx("a",{href:t.href,...u,children:i}):n.jsx(z.Link,{to:t.href,...u,children:i})},te=t=>t?t.split(/[?#]/)[0].replace(/(?!^\/)\/$/,""):"",re=(t,r)=>{const l=r!=="/"&&r.endsWith("/")?r.slice(0,-1):r;for(const i of t){if(te(i.href)===l)return i.id;if(i.submenu){for(const u of i.submenu)if(te(u.href)===l)return i.id}}return null},ye=t=>{const{menuList:r,onMenuSelected:l,pinnedSubmenuIds:i=[],onToggleSubmenuPin:u}=t;let c="";try{c=z.useLocation().pathname}catch{typeof window<"u"&&(c=window.location.pathname)}const d=o.useMemo(()=>re(r,c),[r,c]),[b,v]=o.useState(d),f=o.useRef(c),m=o.useRef(d!==null);o.useEffect(()=>{if(f.current!==c&&(f.current=c,m.current=!1),!m.current){const s=re(r,c);s!==null&&(v(s),m.current=!0)}},[c,r]);const k=o.useCallback(s=>{i.includes(s)||v(N=>N===s?null:s)},[i]),j=o.useRef(null);he(()=>{const s=j.current;if(s)try{const p=sessionStorage.getItem(ee);if(p!==null){const N=Number.parseFloat(p);Number.isNaN(N)||(s.scrollTop=N)}}catch{}},[]);const x=o.useCallback(()=>{const s=j.current;if(s)try{sessionStorage.setItem(ee,String(s.scrollTop))}catch{}},[]),_=o.useMemo(()=>n.jsx(n.Fragment,{children:r.map(s=>n.jsx("div",{children:s.href?n.jsx("div",{className:"aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",children:ne.test(s.href)?n.jsx("a",{href:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})}):n.jsx(z.Link,{to:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})})}):n.jsxs("details",{className:"aiquants-menu-accordion-details",open:s.id===b||i.includes(s.id),children:[n.jsxs("summary",{className:"aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 text-sm outline-none before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:content-['']",onClick:p=>{p.preventDefault(),k(s.id)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),k(s.id))},children:[n.jsx("span",{children:s.title}),n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),p.preventDefault(),u&&u(s.id)},className:`aiquants-submenu-pin-button ${i.includes(s.id)?"pinned":""}`,title:i.includes(s.id)?"ピン留め解除":"ピン留め",children:i.includes(s.id)?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})})]}),n.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:s.submenu.map(p=>n.jsx("div",{className:"aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm",children:n.jsx(ge,{item:p,parentMenu:s,onMenuSelected:l})},p.subid))})]})},s.id))}),[r,l,b,k,i]);return n.jsx("div",{ref:j,onScroll:x,className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:_})},ve=t=>{const{menuList:r,menuHeader:l,open:i,onMenuSelected:u,onClickSignout:c,theme:d,toggleTheme:b,isPinned:v,onTogglePin:f,pinnedSubmenuIds:m,onToggleSubmenuPin:k}=t;return n.jsxs("div",{className:`aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[250px] select-none flex-col transition-transform duration-500 ${i?"aiquants-menu-translate-x-0":"aiquants-menu-translate-x-250"}`,children:[n.jsx("div",{className:"flex h-[100px] flex-col",children:l}),n.jsx("div",{className:"flex grow flex-col",children:n.jsx(ye,{menuList:r,onMenuSelected:u,pinnedSubmenuIds:m,onToggleSubmenuPin:k})}),n.jsx("div",{className:"px-4 pt-2 pb-4",children:n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("button",{type:"button",onClick:f,className:`flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${v?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:v?"ピン留め解除":"ピン留め",children:v?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})}),n.jsxs("button",{type:"button",onClick:b,className:"group relative flex flex-1 items-center gap-2 rounded-lg border border-white/15 bg-white/10 px-3 py-2 font-medium text-white text-xs shadow-sm backdrop-blur-sm transition-all duration-300 hover:border-white/25 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-offset-0 dark:border-gray-600/40 dark:bg-gray-800/80 dark:hover:border-gray-500/60 dark:hover:bg-gray-700",children:[n.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white/20 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-white/30 dark:bg-gray-600/60 dark:group-hover:bg-gray-500/70",children:n.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),n.jsx("span",{className:"text-white transition-colors duration-300 group-hover:text-white/90 dark:text-gray-200 dark:group-hover:text-white",children:d==="dark"?"Light":"Dark"}),n.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 dark:via-gray-400/10"})]}),n.jsx("button",{type:"button",className:"aiquants-signout-button flex items-center justify-center rounded-md bg-red-500/90 px-3 py-2 font-medium text-white text-xs shadow-sm transition-colors duration-300 hover:bg-red-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300/60",onClick:c,children:"サインアウト"})]})})]})},ke=t=>{const{isOverlay:r,onOverlayClick:l}=t;return n.jsx("button",{type:"button",className:`fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${r?"opacity-100":"pointer-events-none opacity-0"}`,onClick:l})},we=t=>{const{open:r,onMenuOpen:l,onMenuClose:i,theme:u}=t,c=o.useRef(r),d=o.useRef(null),b=o.useRef(null),v=o.useRef(null),f=o.useRef(null),m=o.useRef(null),k=o.useCallback(()=>{if(d.current&&b.current&&v.current&&f.current&&m.current){const E=u==="dark"?"#fff":"#000";d.current.style.backgroundColor=E,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",b.current.style.opacity="1",b.current.style.backgroundColor=E,v.current.style.opacity="1",v.current.style.backgroundColor=E,f.current.style.backgroundColor=E,f.current.style.width="100%",f.current.style.height="3px",f.current.style.transform="",m.current.style.color=E,m.current.classList.remove("after:content-['close']"),m.current.classList.remove("after:ml-0.5"),m.current.classList.add("after:content-['menu']"),m.current.classList.add("after:-ml-0.5"),c.current=!0}},[u]),j=o.useCallback(()=>{d.current&&b.current&&v.current&&f.current&&m.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",b.current.style.opacity="0",v.current.style.opacity="0",f.current.style.backgroundColor="#fff",f.current.style.width="32px",f.current.style.height="4px",f.current.style.transform="translateY(-9px) rotate(45deg)",m.current.style.color="#fff",m.current.classList.remove("after:content-['menu']"),m.current.classList.remove("after:-ml-0.5"),m.current.classList.add("after:content-['close']"),m.current.classList.add("after:ml-0.5"),c.current=!1)},[]),x=o.useCallback(()=>{k(),i&&i()},[k,i]),_=o.useCallback(()=>{j(),l&&l()},[j,l]),s=o.useCallback(()=>{c.current?_():x()},[x,_]),p=o.useCallback(E=>{E.currentTarget.blur()},[]),N=o.useCallback(E=>{E.preventDefault()},[]);return o.useEffect(()=>{r?k():j()},[r,k,j]),n.jsxs("button",{type:"button",className:"aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden",onClick:s,onFocus:p,onMouseDown:N,tabIndex:-1,children:[n.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),n.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:b}),n.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:v}),n.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:f}),n.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:m})]})},se=typeof window<"u"?o.useLayoutEffect:o.useEffect,je=t=>{const{menuList:r,menuHeader:l,onClickSignout:i,isMenuhide:u,theme:c,toggleTheme:d,onMenuNavigate:b,onPinChange:v,pinnedSubmenuIds:f,initialPinnedSubmenuIds:m,onSubmenuPinChange:k,closeOnEscape:j="auto"}=t,[x,_]=o.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[s,p]=o.useState(x),[N,E]=o.useState(()=>{if(m)return m;try{const w=localStorage.getItem("aiquants-submenu-pinned");if(w){const S=JSON.parse(w);if(Array.isArray(S))return S.filter(P=>typeof P=="number")}}catch{}return[]}),W=f!==void 0?f:N,U=o.useCallback(w=>{const S=f!==void 0?f:N,P=S.includes(w)?S.filter(V=>V!==w):[...S,w];if(f===void 0){E(P);try{localStorage.setItem("aiquants-submenu-pinned",JSON.stringify(P))}catch{}}k&&k(P)},[f,N,k]);se(()=>{const w=x?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",w),v?.(x)},[x,v]),se(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const H=o.useCallback(()=>{p(!0)},[]),O=o.useCallback(()=>{p(!1),_(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),J=o.useCallback(()=>{_(w=>{const S=!w;if(S)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return S})},[]),G=o.useCallback(w=>{b&&b(w),x||p(!1)},[b,x]),R=o.useCallback(w=>{w.key==="Escape"&&O()},[O]),D=j===!0||j==="auto"&&!x;return o.useEffect(()=>(s&&D?window.addEventListener("keydown",R,{passive:!0}):window.removeEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}),[s,D,R]),u?null:n.jsxs("div",{className:`aiquants-menu-bar ${c}`,children:[n.jsx(we,{onMenuClose:O,onMenuOpen:H,open:!s,theme:c}),n.jsx(ve,{menuList:r,menuHeader:l,onClickSignout:i,onMenuSelected:G,open:s,theme:c,toggleTheme:d,isPinned:x,onTogglePin:J,pinnedSubmenuIds:W,onToggleSubmenuPin:U}),n.jsx(ke,{isOverlay:s&&!x,onOverlayClick:O})]})};T.DefaultLink=$,T.MenuBar=je,T.SessionInfo=pe,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
<%s key={someKey} {...props} />`,g,y,I,y),ce[y+g]=!0)}if(y=null,h!==void 0&&(l(h),y=""+h),d(a)&&(l(a.key),y=""+a.key),"key"in a){h={};for(var B in a)B!=="key"&&(h[B]=a[B])}else h=a;return y&&b(h,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,y,h,u(),Y,q)}function k(e){j(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===R&&(e._payload.status==="fulfilled"?j(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function j(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}var x=o,_=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),U=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),S=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,V=Array.isArray,Z=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(e){return e()}};var oe,ae={},le=x.react_stack_bottom_frame.bind(x,c)(),ie=Z(i(c)),ce={};M.Fragment=p,M.jsx=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!1,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)},M.jsxs=function(e,a,h){var g=1e4>S.recentlyCreatedOwnerStacks++;return m(e,a,h,!0,g?Error("react-stack-top-frame"):le,g?Z(i(e)):ie)}})()),M}var K;function fe(){return K||(K=1,process.env.NODE_ENV==="production"?L.exports=ue():L.exports=de()),L.exports}var n=fe();const me="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg==",$=({to:t,className:r,children:l})=>n.jsx("a",{href:t,className:r,children:l}),pe=t=>{const{user:r,LinkComponent:l=$}=t;return n.jsx("div",{className:"max-h-20 max-w-52",children:n.jsx("div",{className:"flex grow flex-col",children:r?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-row",children:[n.jsx("div",{className:"aiquants-session-photo m-1 h-14 w-14 p-0.5",children:n.jsx("img",{className:"object-contain",src:r.photo||me,"aria-label":"profile photo"})}),n.jsxs("div",{className:"mx-1 flex flex-col",children:[n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィールを編集"}),n.jsx(l,{className:"aiquants-session-link rounded-lg px-2 text-center text-xs",to:"/",children:"プロフィール"}),n.jsx(l,{className:"aiquants-session-link my-1 rounded-lg px-2 text-center text-xs",to:"https://myaccount.google.com/",children:"Google Account"})]})]}),n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs",children:r.displayName})]}):n.jsx("div",{className:"aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs",children:"ログインはこちら"})})})},he=typeof window<"u"?o.useLayoutEffect:o.useEffect,ee="aiquants-menu-scroll",ne=new RegExp(/(^https?:\/\/)|(\.(html|htm)?$)/),be={report:C.FileText,slip:C.FileText,table:C.Table,chart:C.BarChart,download:C.Download,lock:C.Lock,href:C.Link},xe=({mark:t,children:r})=>{const l=t?be[t]:void 0;return l?n.jsxs("div",{className:"flex flex-nowrap items-center",children:[n.jsx(l,{className:"h-4 w-4"}),n.jsx("div",{className:"aiquants-menu-link mx-1 hover:underline",children:r})]}):n.jsx("span",{className:"mx-1 text-sky-600 hover:underline dark:text-sky-400",children:r})},F=(t,r)=>r?{menu:{id:t.id,title:t.title,href:t.href},submenu:{subid:r.subid,title:r.title,href:r.href,mark:r.mark,new:r.new}}:{menu:{id:t.id,title:t.title,href:t.href}},ge=({item:t,parentMenu:r,onMenuSelected:l})=>{if(t.href==="separator")return n.jsx("hr",{className:"aiquants-menu-separator mx-2 my-1 h-px"});const i=n.jsx(xe,{mark:t.mark,children:t.title}),u={onClick:()=>{l&&l(F(r,t))}};return t.new?n.jsx("a",{href:t.href,rel:"noopener noreferrer",target:"_blank",...u,children:i}):ne.test(t.href)?n.jsx("a",{href:t.href,...u,children:i}):n.jsx(z.Link,{to:t.href,...u,children:i})},te=t=>t?t.split(/[?#]/)[0].replace(/(?!^\/)\/$/,""):"",re=(t,r)=>{const l=r!=="/"&&r.endsWith("/")?r.slice(0,-1):r;for(const i of t){if(te(i.href)===l)return i.id;if(i.submenu){for(const u of i.submenu)if(te(u.href)===l)return i.id}}return null},ye=t=>{const{menuList:r,onMenuSelected:l,pinnedSubmenuIds:i=[],onToggleSubmenuPin:u}=t;let c="";try{c=z.useLocation().pathname}catch{typeof window<"u"&&(c=window.location.pathname)}const d=o.useMemo(()=>re(r,c),[r,c]),[b,v]=o.useState(d),f=o.useRef(c),m=o.useRef(d!==null);o.useEffect(()=>{if(f.current!==c&&(f.current=c,m.current=!1),!m.current){const s=re(r,c);s!==null&&(v(s),m.current=!0)}},[c,r]);const k=o.useCallback(s=>{i.includes(s)||v(N=>N===s?null:s)},[i]),j=o.useRef(null);he(()=>{const s=j.current;if(s)try{const p=sessionStorage.getItem(ee);if(p!==null){const N=Number.parseFloat(p);Number.isNaN(N)||(s.scrollTop=N)}}catch{}},[]);const x=o.useCallback(()=>{const s=j.current;if(s)try{sessionStorage.setItem(ee,String(s.scrollTop))}catch{}},[]),_=o.useMemo(()=>n.jsx(n.Fragment,{children:r.map(s=>n.jsx("div",{children:s.href?n.jsx("div",{className:"aiquants-menu-list-item relative mb-1 ml-1 h-full rounded-l-2xl p-2 align-middle text-sm before:-mt-1 before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:align-middle before:content-['']",children:ne.test(s.href)?n.jsx("a",{href:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})}):n.jsx(z.Link,{to:s.href,onClick:()=>{l&&l(F(s))},children:n.jsx("span",{className:"aiquants-menu-link hover:underline",children:s.title})})}):n.jsxs("details",{className:"aiquants-menu-accordion-details",open:s.id===b||i.includes(s.id),children:[n.jsxs("summary",{className:"aiquants-menu-list-item aiquants-menu-accordion-summary relative mb-1 ml-1 h-full list-none rounded-l-2xl p-2 text-sm outline-none before:mr-2 before:inline-block before:h-4 before:w-4 before:rounded-full before:content-['']",onClick:p=>{p.preventDefault(),k(s.id)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),k(s.id))},children:[n.jsx("span",{children:s.title}),n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),p.preventDefault(),u&&u(s.id)},className:`aiquants-submenu-pin-button ${i.includes(s.id)?"pinned":""}`,title:i.includes(s.id)?"ピン留め解除":"ピン留め",children:i.includes(s.id)?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})})]}),n.jsx("div",{className:"aiquants-menu-submenu pointer-events-auto my-1 mr-1 ml-4 rounded p-2 shadow-md",children:s.submenu.map(p=>n.jsx("div",{className:"aiquants-menu-accordion-container block w-full whitespace-nowrap text-sm",children:n.jsx(ge,{item:p,parentMenu:s,onMenuSelected:l})},p.subid))})]})},s.id))}),[r,l,b,k,i]);return n.jsx("div",{ref:j,onScroll:x,className:"hidden-scrollbar h-0 grow overflow-y-scroll",children:_})},ve=t=>{const{menuList:r,menuHeader:l,open:i,onMenuSelected:u,onClickSignout:c,theme:d,toggleTheme:b,isPinned:v,onTogglePin:f,pinnedSubmenuIds:m,onToggleSubmenuPin:k}=t;return n.jsxs("div",{className:`aiquants-menu-content fixed top-0 right-0 z-2147483642 flex min-h-dvh w-[250px] select-none flex-col transition-transform duration-500 ${i?"aiquants-menu-translate-x-0":"aiquants-menu-translate-x-250"}`,children:[n.jsx("div",{className:"flex h-[100px] flex-col",children:l}),n.jsx("div",{className:"flex grow flex-col",children:n.jsx(ye,{menuList:r,onMenuSelected:u,pinnedSubmenuIds:m,onToggleSubmenuPin:k})}),n.jsx("div",{className:"px-4 pt-2 pb-4",children:n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("button",{type:"button",onClick:f,className:`flex items-center justify-center rounded-md px-3 py-2 text-white text-xs shadow-sm transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60 ${v?"bg-amber-500/90 hover:bg-amber-600":"border border-white/15 bg-white/10 hover:bg-white/20"}`,title:v?"ピン留め解除":"ピン留め",children:v?n.jsx(C.Pin,{size:14}):n.jsx(C.PinOff,{size:14})}),n.jsxs("button",{type:"button",onClick:b,className:"group relative flex flex-1 items-center gap-2 rounded-lg border border-white/15 bg-white/10 px-3 py-2 font-medium text-white text-xs shadow-sm backdrop-blur-sm transition-all duration-300 hover:border-white/25 hover:bg-white/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-offset-0 dark:border-gray-600/40 dark:bg-gray-800/80 dark:hover:border-gray-500/60 dark:hover:bg-gray-700",children:[n.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white/20 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-white/30 dark:bg-gray-600/60 dark:group-hover:bg-gray-500/70",children:n.jsx("span",{className:"text-sm transition-transform duration-300 group-hover:scale-110",children:d==="dark"?"🌞":"🌙"})}),n.jsx("span",{className:"text-white transition-colors duration-300 group-hover:text-white/90 dark:text-gray-200 dark:group-hover:text-white",children:d==="dark"?"Light":"Dark"}),n.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-transparent via-white/5 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 dark:via-gray-400/10"})]}),n.jsx("button",{type:"button",className:"aiquants-signout-button flex items-center justify-center rounded-md bg-red-500/90 px-3 py-2 font-medium text-white text-xs shadow-sm transition-colors duration-300 hover:bg-red-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300/60",onClick:c,children:"サインアウト"})]})})]})},ke=t=>{const{isOverlay:r,onOverlayClick:l}=t;return n.jsx("button",{type:"button",className:`fixed inset-0 z-2147483640 cursor-default bg-black/50 transition-opacity duration-500 ${r?"opacity-100":"pointer-events-none opacity-0"}`,onClick:l})},we=t=>{const{open:r,onMenuOpen:l,onMenuClose:i,theme:u}=t,c=o.useRef(r),d=o.useRef(null),b=o.useRef(null),v=o.useRef(null),f=o.useRef(null),m=o.useRef(null),k=o.useCallback(()=>{if(d.current&&b.current&&v.current&&f.current&&m.current){const E=u==="dark"?"#fff":"#000";d.current.style.backgroundColor=E,d.current.style.width="100%",d.current.style.height="3px",d.current.style.transform="",b.current.style.opacity="1",b.current.style.backgroundColor=E,v.current.style.opacity="1",v.current.style.backgroundColor=E,f.current.style.backgroundColor=E,f.current.style.width="100%",f.current.style.height="3px",f.current.style.transform="",m.current.style.color=E,m.current.classList.remove("after:content-['close']"),m.current.classList.remove("after:ml-0.5"),m.current.classList.add("after:content-['menu']"),m.current.classList.add("after:-ml-0.5"),c.current=!0}},[u]),j=o.useCallback(()=>{d.current&&b.current&&v.current&&f.current&&m.current&&(d.current.style.backgroundColor="#fff",d.current.style.width="32px",d.current.style.height="4px",d.current.style.transform="translateY(9px) rotate(-45deg)",b.current.style.opacity="0",v.current.style.opacity="0",f.current.style.backgroundColor="#fff",f.current.style.width="32px",f.current.style.height="4px",f.current.style.transform="translateY(-9px) rotate(45deg)",m.current.style.color="#fff",m.current.classList.remove("after:content-['menu']"),m.current.classList.remove("after:-ml-0.5"),m.current.classList.add("after:content-['close']"),m.current.classList.add("after:ml-0.5"),c.current=!1)},[]),x=o.useCallback(()=>{k(),i&&i()},[k,i]),_=o.useCallback(()=>{j(),l&&l()},[j,l]),s=o.useCallback(()=>{c.current?_():x()},[x,_]),p=o.useCallback(E=>{E.currentTarget.blur()},[]),N=o.useCallback(E=>{E.preventDefault()},[]);return o.useEffect(()=>{r?k():j()},[r,k,j]),n.jsxs("button",{type:"button","data-aqmb-menu-switch":!0,className:"aiquants-menu-switch fixed z-2147483647 inline-block h-[27px] w-[27px] cursor-pointer align-middle outline-hidden",onClick:s,onFocus:p,onMouseDown:N,tabIndex:-1,children:[n.jsx("span",{className:"absolute top-0 left-0 box-border inline-block h-[3px] w-full select-none",ref:d}),n.jsx("span",{className:"absolute top-1.5 left-0 box-border inline-block h-[3px] w-full select-none",ref:b}),n.jsx("span",{className:"absolute top-3 left-0 box-border inline-block h-[3px] w-full select-none",ref:v}),n.jsx("span",{className:"absolute top-[18px] left-0 box-border inline-block h-[3px] w-full select-none",ref:f}),n.jsx("div",{className:"absolute w-full text-xs after:mt-2 after:block",ref:m})]})},se=typeof window<"u"?o.useLayoutEffect:o.useEffect,je=t=>{const{menuList:r,menuHeader:l,onClickSignout:i,isMenuhide:u,theme:c,toggleTheme:d,onMenuNavigate:b,onPinChange:v,pinnedSubmenuIds:f,initialPinnedSubmenuIds:m,onSubmenuPinChange:k,closeOnEscape:j="auto"}=t,[x,_]=o.useState(()=>{try{return localStorage.getItem("aiquants-menu-pinned")==="true"}catch{return!1}}),[s,p]=o.useState(x),[N,E]=o.useState(()=>{if(m)return m;try{const w=localStorage.getItem("aiquants-submenu-pinned");if(w){const S=JSON.parse(w);if(Array.isArray(S))return S.filter(P=>typeof P=="number")}}catch{}return[]}),W=f!==void 0?f:N,U=o.useCallback(w=>{const S=f!==void 0?f:N,P=S.includes(w)?S.filter(V=>V!==w):[...S,w];if(f===void 0){E(P);try{localStorage.setItem("aiquants-submenu-pinned",JSON.stringify(P))}catch{}}k&&k(P)},[f,N,k]);se(()=>{const w=x?"250px":"0px";document.documentElement.style.setProperty("--aiquants-menu-pinned-width",w),v?.(x)},[x,v]),se(()=>()=>{document.documentElement.style.setProperty("--aiquants-menu-pinned-width","0px")},[]);const H=o.useCallback(()=>{p(!0)},[]),O=o.useCallback(()=>{p(!1),_(!1);try{localStorage.removeItem("aiquants-menu-pinned")}catch{}},[]),J=o.useCallback(()=>{_(w=>{const S=!w;if(S)try{localStorage.setItem("aiquants-menu-pinned","true")}catch{}else try{localStorage.removeItem("aiquants-menu-pinned")}catch{}return S})},[]),G=o.useCallback(w=>{b&&b(w),x||p(!1)},[b,x]),R=o.useCallback(w=>{w.key==="Escape"&&O()},[O]),D=j===!0||j==="auto"&&!x;return o.useEffect(()=>(s&&D?window.addEventListener("keydown",R,{passive:!0}):window.removeEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}),[s,D,R]),u?null:n.jsxs("div",{className:`aiquants-menu-bar ${c}`,children:[n.jsx(we,{onMenuClose:O,onMenuOpen:H,open:!s,theme:c}),n.jsx(ve,{menuList:r,menuHeader:l,onClickSignout:i,onMenuSelected:G,open:s,theme:c,toggleTheme:d,isPinned:x,onTogglePin:J,pinnedSubmenuIds:W,onToggleSubmenuPin:U}),n.jsx(ke,{isOverlay:s&&!x,onOverlayClick:O})]})};T.DefaultLink=$,T.MenuBar=je,T.SessionInfo=pe,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/styles/menu-bar.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-content:""}}}@layer theme{:root,:host{--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-600:oklch(58.8% .158 241.966);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{:root{--aiquants-menu-pinned-width:0px}@layer utilities{.aiquants-menu-bar{font-size:1rem;line-height:1.5}.aiquants-menu-bar *{box-sizing:border-box}.aiquants-menu-bar a,.aiquants-menu-bar button{cursor:pointer;background:0 0;border:none;text-decoration:none}.aiquants-menu-bar.dark{color-scheme:dark}.aiquants-menu-bar.dark .aiquants-menu-content{background-color:#0f172a}.aiquants-menu-bar.light .aiquants-menu-content,.aiquants-menu-bar .aiquants-menu-content{background-color:#0369a1}.aiquants-menu-bar.dark .aiquants-signout-button{background-color:#334155}.aiquants-menu-bar.dark .aiquants-signout-button:hover{background-color:#475569}.aiquants-menu-bar.light .aiquants-signout-button,.aiquants-menu-bar .aiquants-signout-button{background-color:#2563eb}.aiquants-menu-bar.light .aiquants-signout-button:hover,.aiquants-menu-bar .aiquants-signout-button:hover{background-color:#1e40af}.aiquants-menu-bar.dark .aiquants-menu-list-item{color:#d1d5db;background-color:#334155}.aiquants-menu-bar.dark .aiquants-menu-list-item:before{background-color:#94a3b8}.aiquants-menu-bar.dark .aiquants-menu-submenu{background-color:#1e293b}.aiquants-menu-bar.dark .aiquants-menu-link{color:#38bdf8}.aiquants-menu-bar.dark .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.light .aiquants-menu-list-item,.aiquants-menu-bar .aiquants-menu-list-item{color:#4b5563;background-color:#bae6fd}.aiquants-menu-bar.light .aiquants-menu-list-item:before,.aiquants-menu-bar .aiquants-menu-list-item:before{background-color:#fff}.aiquants-menu-bar.light .aiquants-menu-submenu,.aiquants-menu-bar .aiquants-menu-submenu{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-menu-link,.aiquants-menu-bar .aiquants-menu-link{color:#0284c7}.aiquants-menu-bar.light .aiquants-menu-separator,.aiquants-menu-bar .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.dark .aiquants-session-photo{background-color:#27272a}.aiquants-menu-bar.dark .aiquants-session-link,.aiquants-menu-bar.dark .aiquants-session-info{color:#e2e8f0;background-color:#334155}.aiquants-menu-bar.light .aiquants-session-photo,.aiquants-menu-bar .aiquants-session-photo{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-session-link,.aiquants-menu-bar .aiquants-session-link,.aiquants-menu-bar.light .aiquants-session-info,.aiquants-menu-bar .aiquants-session-info{color:#000;background-color:#dcfce7}.aiquants-menu-accordion-summary{cursor:pointer;justify-content:space-between;align-items:center;display:flex}.aiquants-menu-accordion-summary::-webkit-details-marker{display:none}.aiquants-menu-accordion-summary span{text-align:left;flex-grow:1}.aiquants-submenu-pin-button{border-radius:.375rem;justify-content:center;align-items:center;padding:.25rem;transition:all .3s;display:inline-flex}.aiquants-menu-bar.light .aiquants-submenu-pin-button{color:#4b556366}.aiquants-menu-bar.light .aiquants-submenu-pin-button:hover{color:#4b5563cc;background-color:#4b55631a}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned{color:#d97706}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned:hover{color:#b45309;background-color:#d977061a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button{color:#fff6}.aiquants-menu-bar.dark .aiquants-submenu-pin-button:hover{color:#fffc;background-color:#ffffff1a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned{color:#f59e0b}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned:hover{color:#fbbf24;background-color:#f59e0b26}.aiquants-menu-accordion-container{contain:content;transition:block-size .5s}.aiquants-menu-translate-x-0{transform:translate(0)}.aiquants-menu-translate-x-250{transform:translate(250px)}.aiquants-menu-switch{top:calc(var(--spacing) * 2);right:calc(var(--spacing) * 2)}@media (min-width:40rem){.aiquants-menu-switch{top:calc(var(--spacing) * 3);right:calc(var(--spacing) * 3)}}}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3{top:calc(var(--spacing) * 3)}.top-\[18px\]{top:18px}.right-0{right:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-2147483640{z-index:2147483640}.z-2147483642{z-index:2147483642}.z-2147483647{z-index:2147483647}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-1{margin:calc(var(--spacing) * 1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.my-1{margin-block:calc(var(--spacing) * 1)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-4{margin-left:calc(var(--spacing) * 4)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.table{display:table}.h-0{height:calc(var(--spacing) * 0)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-14{height:calc(var(--spacing) * 14)}.h-\[3px\]{height:3px}.h-\[27px\]{height:27px}.h-\[100px\]{height:100px}.h-full{height:100%}.h-px{height:1px}.max-h-20{max-height:calc(var(--spacing) * 20)}.min-h-\[1em\]{min-height:1em}.min-h-dvh{min-height:100dvh}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-9\/12{width:75%}.w-14{width:calc(var(--spacing) * 14)}.w-\[27px\]{width:27px}.w-\[250px\]{width:250px}.w-full{width:100%}.max-w-52{max-width:calc(var(--spacing) * 52)}.flex-1{flex:1}.flex-grow,.grow{flex-grow:1}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-l-2xl{border-top-left-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.border-white\/15{border-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-amber-500\/90{background-color:#f99c00e6}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/90{background-color:color-mix(in oklab, var(--color-amber-500) 90%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-red-500\/90{background-color:#fb2c36e6}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/90{background-color:color-mix(in oklab, var(--color-red-500) 90%, transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-white\/5{--tw-gradient-via:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.via-white\/5{--tw-gradient-via:color-mix(in oklab, var(--color-white) 5%, transparent)}}.via-white\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-2{padding-block:calc(var(--spacing) * 2)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-1{padding-left:calc(var(--spacing) * 1)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-sky-600{color:var(--color-sky-600)}.text-white{color:var(--color-white)}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.group-hover\:text-white\/90:is(:where(.group):hover *){color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.group-hover\:text-white\/90:is(:where(.group):hover *){color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.before\:-mt-1:before{content:var(--tw-content);margin-top:calc(var(--spacing) * -1)}.before\:mr-2:before{content:var(--tw-content);margin-right:calc(var(--spacing) * 2)}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:h-4:before{content:var(--tw-content);height:calc(var(--spacing) * 4)}.before\:w-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4)}.before\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\:align-middle:before{content:var(--tw-content);vertical-align:middle}.before\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.after\:mt-2:after{content:var(--tw-content);margin-top:calc(var(--spacing) * 2)}.after\:-ml-0\.5:after{content:var(--tw-content);margin-left:calc(var(--spacing) * -.5)}.after\:ml-0\.5:after{content:var(--tw-content);margin-left:calc(var(--spacing) * .5)}.after\:block:after{content:var(--tw-content);display:block}.after\:content-\[\'close\'\]:after{--tw-content:"close";content:var(--tw-content)}.after\:content-\[\'menu\'\]:after{--tw-content:"menu";content:var(--tw-content)}@media (hover:hover){.hover\:border-white\/25:hover{border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.hover\:border-white\/25:hover{border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-red-500:hover{background-color:var(--color-red-500)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-amber-300\/60:focus-visible{--tw-ring-color:#ffd23699}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-amber-300\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-amber-300) 60%, transparent)}}.focus-visible\:ring-red-300\/60:focus-visible{--tw-ring-color:#ffa3a399}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-red-300\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-red-300) 60%, transparent)}}.focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:#fff6}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}@media (prefers-color-scheme:dark){.dark\:border-gray-600\/40{border-color:#4a556566}@supports (color:color-mix(in lab, red, red)){.dark\:border-gray-600\/40{border-color:color-mix(in oklab, var(--color-gray-600) 40%, transparent)}}.dark\:bg-gray-600\/60{background-color:#4a556599}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-600\/60{background-color:color-mix(in oklab, var(--color-gray-600) 60%, transparent)}}.dark\:bg-gray-800\/80{background-color:#1e2939cc}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-800\/80{background-color:color-mix(in oklab, var(--color-gray-800) 80%, transparent)}}.dark\:via-gray-400\/10{--tw-gradient-via:#99a1af1a}@supports (color:color-mix(in lab, red, red)){.dark\:via-gray-400\/10{--tw-gradient-via:color-mix(in oklab, var(--color-gray-400) 10%, transparent)}}.dark\:via-gray-400\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-sky-400{color:var(--color-sky-400)}@media (hover:hover){.dark\:group-hover\:bg-gray-500\/70:is(:where(.group):hover *){background-color:#6a7282b3}@supports (color:color-mix(in lab, red, red)){.dark\:group-hover\:bg-gray-500\/70:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-gray-500) 70%, transparent)}}.dark\:group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.dark\:hover\:border-gray-500\/60:hover{border-color:#6a728299}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-gray-500\/60:hover{border-color:color-mix(in oklab, var(--color-gray-500) 60%, transparent)}}.dark\:hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-content{syntax:"*";inherits:false;initial-value:""}
|
|
2
|
+
:root{--aiquants-menu-pinned-width:0px}@layer utilities{.aiquants-menu-bar{font-size:1rem;line-height:1.5}.aiquants-menu-bar *{box-sizing:border-box}.aiquants-menu-bar a,.aiquants-menu-bar button{cursor:pointer;background:0 0;border:none;text-decoration:none}.aiquants-menu-bar.dark{color-scheme:dark}.aiquants-menu-bar.dark .aiquants-menu-content{background-color:#0f172a}.aiquants-menu-bar.light .aiquants-menu-content,.aiquants-menu-bar .aiquants-menu-content{background-color:#0369a1}.aiquants-menu-bar.dark .aiquants-signout-button{background-color:#334155}.aiquants-menu-bar.dark .aiquants-signout-button:hover{background-color:#475569}.aiquants-menu-bar.light .aiquants-signout-button,.aiquants-menu-bar .aiquants-signout-button{background-color:#2563eb}.aiquants-menu-bar.light .aiquants-signout-button:hover,.aiquants-menu-bar .aiquants-signout-button:hover{background-color:#1e40af}.aiquants-menu-bar.dark .aiquants-menu-list-item{color:#d1d5db;background-color:#334155}.aiquants-menu-bar.dark .aiquants-menu-list-item:before{background-color:#94a3b8}.aiquants-menu-bar.dark .aiquants-menu-submenu{background-color:#1e293b}.aiquants-menu-bar.dark .aiquants-menu-link{color:#38bdf8}.aiquants-menu-bar.dark .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.light .aiquants-menu-list-item,.aiquants-menu-bar .aiquants-menu-list-item{color:#4b5563;background-color:#bae6fd}.aiquants-menu-bar.light .aiquants-menu-list-item:before,.aiquants-menu-bar .aiquants-menu-list-item:before{background-color:#fff}.aiquants-menu-bar.light .aiquants-menu-submenu,.aiquants-menu-bar .aiquants-menu-submenu{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-menu-link,.aiquants-menu-bar .aiquants-menu-link{color:#0284c7}.aiquants-menu-bar.light .aiquants-menu-separator,.aiquants-menu-bar .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.dark .aiquants-session-photo{background-color:#27272a}.aiquants-menu-bar.dark .aiquants-session-link,.aiquants-menu-bar.dark .aiquants-session-info{color:#e2e8f0;background-color:#334155}.aiquants-menu-bar.light .aiquants-session-photo,.aiquants-menu-bar .aiquants-session-photo{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-session-link,.aiquants-menu-bar .aiquants-session-link,.aiquants-menu-bar.light .aiquants-session-info,.aiquants-menu-bar .aiquants-session-info{color:#000;background-color:#dcfce7}.aiquants-menu-accordion-summary{cursor:pointer;justify-content:space-between;align-items:center;display:flex}.aiquants-menu-accordion-summary::-webkit-details-marker{display:none}.aiquants-menu-accordion-summary span{text-align:left;flex-grow:1}.aiquants-submenu-pin-button{border-radius:.375rem;justify-content:center;align-items:center;padding:.25rem;transition:all .3s;display:inline-flex}.aiquants-menu-bar.light .aiquants-submenu-pin-button{color:#4b556366}.aiquants-menu-bar.light .aiquants-submenu-pin-button:hover{color:#4b5563cc;background-color:#4b55631a}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned{color:#d97706}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned:hover{color:#b45309;background-color:#d977061a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button{color:#fff6}.aiquants-menu-bar.dark .aiquants-submenu-pin-button:hover{color:#fffc;background-color:#ffffff1a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned{color:#f59e0b}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned:hover{color:#fbbf24;background-color:#f59e0b26}.aiquants-menu-accordion-container{contain:content;transition:block-size .5s}.aiquants-menu-translate-x-0{transform:translate(0)}.aiquants-menu-translate-x-250{transform:translate(250px)}.aiquants-menu-switch{top:calc(var(--spacing) * 2);right:calc(var(--spacing) * 2)}@media (min-width:40rem){.aiquants-menu-switch{top:calc(var(--spacing) * 3);right:calc(var(--spacing) * 3)}}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
|
+
/*! @aiquants/menu-bar standalone CSS — 非 Tailwind ホスト専用。ホストの Tailwind ビルドと混在させないこと (同名ユーティリティ重複でカスケード反転が起きる) */
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-content:""}}}@layer theme{:root,:host{--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-600:oklch(58.8% .158 241.966);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{:root{--aiquants-menu-pinned-width:0px}@layer utilities{.aiquants-menu-bar{font-size:1rem;line-height:1.5}.aiquants-menu-bar *{box-sizing:border-box}.aiquants-menu-bar a,.aiquants-menu-bar button{cursor:pointer;background:0 0;border:none;text-decoration:none}.aiquants-menu-bar.dark{color-scheme:dark}.aiquants-menu-bar.dark .aiquants-menu-content{background-color:#0f172a}.aiquants-menu-bar.light .aiquants-menu-content,.aiquants-menu-bar .aiquants-menu-content{background-color:#0369a1}.aiquants-menu-bar.dark .aiquants-signout-button{background-color:#334155}.aiquants-menu-bar.dark .aiquants-signout-button:hover{background-color:#475569}.aiquants-menu-bar.light .aiquants-signout-button,.aiquants-menu-bar .aiquants-signout-button{background-color:#2563eb}.aiquants-menu-bar.light .aiquants-signout-button:hover,.aiquants-menu-bar .aiquants-signout-button:hover{background-color:#1e40af}.aiquants-menu-bar.dark .aiquants-menu-list-item{color:#d1d5db;background-color:#334155}.aiquants-menu-bar.dark .aiquants-menu-list-item:before{background-color:#94a3b8}.aiquants-menu-bar.dark .aiquants-menu-submenu{background-color:#1e293b}.aiquants-menu-bar.dark .aiquants-menu-link{color:#38bdf8}.aiquants-menu-bar.dark .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.light .aiquants-menu-list-item,.aiquants-menu-bar .aiquants-menu-list-item{color:#4b5563;background-color:#bae6fd}.aiquants-menu-bar.light .aiquants-menu-list-item:before,.aiquants-menu-bar .aiquants-menu-list-item:before{background-color:#fff}.aiquants-menu-bar.light .aiquants-menu-submenu,.aiquants-menu-bar .aiquants-menu-submenu{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-menu-link,.aiquants-menu-bar .aiquants-menu-link{color:#0284c7}.aiquants-menu-bar.light .aiquants-menu-separator,.aiquants-menu-bar .aiquants-menu-separator{border-color:#4b5563}.aiquants-menu-bar.dark .aiquants-session-photo{background-color:#27272a}.aiquants-menu-bar.dark .aiquants-session-link,.aiquants-menu-bar.dark .aiquants-session-info{color:#e2e8f0;background-color:#334155}.aiquants-menu-bar.light .aiquants-session-photo,.aiquants-menu-bar .aiquants-session-photo{background-color:#fafafa}.aiquants-menu-bar.light .aiquants-session-link,.aiquants-menu-bar .aiquants-session-link,.aiquants-menu-bar.light .aiquants-session-info,.aiquants-menu-bar .aiquants-session-info{color:#000;background-color:#dcfce7}.aiquants-menu-accordion-summary{cursor:pointer;justify-content:space-between;align-items:center;display:flex}.aiquants-menu-accordion-summary::-webkit-details-marker{display:none}.aiquants-menu-accordion-summary span{text-align:left;flex-grow:1}.aiquants-submenu-pin-button{border-radius:.375rem;justify-content:center;align-items:center;padding:.25rem;transition:all .3s;display:inline-flex}.aiquants-menu-bar.light .aiquants-submenu-pin-button{color:#4b556366}.aiquants-menu-bar.light .aiquants-submenu-pin-button:hover{color:#4b5563cc;background-color:#4b55631a}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned{color:#d97706}.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned:hover{color:#b45309;background-color:#d977061a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button{color:#fff6}.aiquants-menu-bar.dark .aiquants-submenu-pin-button:hover{color:#fffc;background-color:#ffffff1a}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned{color:#f59e0b}.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned:hover{color:#fbbf24;background-color:#f59e0b26}.aiquants-menu-accordion-container{contain:content;transition:block-size .5s}.aiquants-menu-translate-x-0{transform:translate(0)}.aiquants-menu-translate-x-250{transform:translate(250px)}.aiquants-menu-switch{top:calc(var(--spacing) * 2);right:calc(var(--spacing) * 2)}@media (min-width:40rem){.aiquants-menu-switch{top:calc(var(--spacing) * 3);right:calc(var(--spacing) * 3)}}}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-3{top:calc(var(--spacing) * 3)}.top-\[18px\]{top:18px}.right-0{right:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-2147483640{z-index:2147483640}.z-2147483642{z-index:2147483642}.z-2147483647{z-index:2147483647}.m-1{margin:calc(var(--spacing) * 1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.my-1{margin-block:calc(var(--spacing) * 1)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-4{margin-left:calc(var(--spacing) * 4)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.table{display:table}.h-0{height:calc(var(--spacing) * 0)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-14{height:calc(var(--spacing) * 14)}.h-\[3px\]{height:3px}.h-\[27px\]{height:27px}.h-\[100px\]{height:100px}.h-full{height:100%}.h-px{height:1px}.max-h-20{max-height:calc(var(--spacing) * 20)}.min-h-\[1em\]{min-height:1em}.min-h-dvh{min-height:100dvh}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-9\/12{width:75%}.w-14{width:calc(var(--spacing) * 14)}.w-\[27px\]{width:27px}.w-\[250px\]{width:250px}.w-full{width:100%}.max-w-52{max-width:calc(var(--spacing) * 52)}.flex-1{flex:1}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-l-2xl{border-top-left-radius:var(--radius-2xl);border-bottom-left-radius:var(--radius-2xl)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-white\/15{border-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.border-white\/15{border-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-amber-500\/90{background-color:#f99c00e6}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/90{background-color:color-mix(in oklab, var(--color-amber-500) 90%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-red-500\/90{background-color:#fb2c36e6}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/90{background-color:color-mix(in oklab, var(--color-red-500) 90%, transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-white\/5{--tw-gradient-via:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.via-white\/5{--tw-gradient-via:color-mix(in oklab, var(--color-white) 5%, transparent)}}.via-white\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-2{padding:calc(var(--spacing) * 2)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-2{padding-block:calc(var(--spacing) * 2)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-1{padding-left:calc(var(--spacing) * 1)}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-sky-600{color:var(--color-sky-600)}.text-white{color:var(--color-white)}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-white\/30:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.group-hover\:text-white\/90:is(:where(.group):hover *){color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.group-hover\:text-white\/90:is(:where(.group):hover *){color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.before\:-mt-1:before{content:var(--tw-content);margin-top:calc(var(--spacing) * -1)}.before\:mr-2:before{content:var(--tw-content);margin-right:calc(var(--spacing) * 2)}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:h-4:before{content:var(--tw-content);height:calc(var(--spacing) * 4)}.before\:w-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4)}.before\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\:align-middle:before{content:var(--tw-content);vertical-align:middle}.before\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.after\:mt-2:after{content:var(--tw-content);margin-top:calc(var(--spacing) * 2)}.after\:-ml-0\.5:after{content:var(--tw-content);margin-left:calc(var(--spacing) * -.5)}.after\:ml-0\.5:after{content:var(--tw-content);margin-left:calc(var(--spacing) * .5)}.after\:block:after{content:var(--tw-content);display:block}.after\:content-\[\'close\'\]:after{--tw-content:"close";content:var(--tw-content)}.after\:content-\[\'menu\'\]:after{--tw-content:"menu";content:var(--tw-content)}@media (hover:hover){.hover\:border-white\/25:hover{border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.hover\:border-white\/25:hover{border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-red-500:hover{background-color:var(--color-red-500)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-amber-300\/60:focus-visible{--tw-ring-color:#ffd23699}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-amber-300\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-amber-300) 60%, transparent)}}.focus-visible\:ring-red-300\/60:focus-visible{--tw-ring-color:#ffa3a399}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-red-300\/60:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-red-300) 60%, transparent)}}.focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:#fff6}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-white\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.dark\:border-gray-600\/40:where(.dark,.dark *){border-color:#4a556566}@supports (color:color-mix(in lab, red, red)){.dark\:border-gray-600\/40:where(.dark,.dark *){border-color:color-mix(in oklab, var(--color-gray-600) 40%, transparent)}}.dark\:bg-gray-600\/60:where(.dark,.dark *){background-color:#4a556599}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-600\/60:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-gray-600) 60%, transparent)}}.dark\:bg-gray-800\/80:where(.dark,.dark *){background-color:#1e2939cc}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-800\/80:where(.dark,.dark *){background-color:color-mix(in oklab, var(--color-gray-800) 80%, transparent)}}.dark\:via-gray-400\/10:where(.dark,.dark *){--tw-gradient-via:#99a1af1a}@supports (color:color-mix(in lab, red, red)){.dark\:via-gray-400\/10:where(.dark,.dark *){--tw-gradient-via:color-mix(in oklab, var(--color-gray-400) 10%, transparent)}}.dark\:via-gray-400\/10:where(.dark,.dark *){--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.dark\:text-gray-200:where(.dark,.dark *){color:var(--color-gray-200)}.dark\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}@media (hover:hover){.dark\:group-hover\:bg-gray-500\/70:where(.dark,.dark *):is(:where(.group):hover *){background-color:#6a7282b3}@supports (color:color-mix(in lab, red, red)){.dark\:group-hover\:bg-gray-500\/70:where(.dark,.dark *):is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-gray-500) 70%, transparent)}}.dark\:group-hover\:text-white:where(.dark,.dark *):is(:where(.group):hover *){color:var(--color-white)}.dark\:hover\:border-gray-500\/60:where(.dark,.dark *):hover{border-color:#6a728299}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-gray-500\/60:where(.dark,.dark *):hover{border-color:color-mix(in oklab, var(--color-gray-500) 60%, transparent)}}.dark\:hover\:bg-gray-700:where(.dark,.dark *):hover{background-color:var(--color-gray-700)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-content{syntax:"*";inherits:false;initial-value:""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/menu-bar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A React menu bar component with authentication support and theming",
|
|
6
6
|
"keywords": [
|
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"import": "./dist/index.es.js",
|
|
28
28
|
"require": "./dist/index.umd.js"
|
|
29
29
|
},
|
|
30
|
-
"./styles/menu-bar.css": "./dist/styles/menu-bar.css"
|
|
30
|
+
"./styles/menu-bar.css": "./dist/styles/menu-bar.css",
|
|
31
|
+
"./styles/menu-bar.standalone.css": "./dist/styles/menu-bar.standalone.css"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
34
|
"dist",
|
|
35
|
+
"src",
|
|
34
36
|
"README.md",
|
|
35
37
|
"LICENSE"
|
|
36
38
|
],
|
|
@@ -69,10 +71,10 @@
|
|
|
69
71
|
},
|
|
70
72
|
"scripts": {
|
|
71
73
|
"build": "vite build && pnpm build:css",
|
|
72
|
-
"build:css": "tailwindcss -i src/styles/
|
|
74
|
+
"build:css": "tailwindcss -i src/styles/components.entry.css -o dist/styles/menu-bar.css --minify && tailwindcss -i src/styles/standalone.entry.css -o dist/styles/menu-bar.standalone.css --minify",
|
|
73
75
|
"dev": "vite build --watch",
|
|
74
76
|
"watch": "vite build --watch",
|
|
75
|
-
"watch:css": "tailwindcss -i src/styles/
|
|
77
|
+
"watch:css": "tailwindcss -i src/styles/components.entry.css -o dist/styles/menu-bar.css --minify --watch",
|
|
76
78
|
"typecheck": "tsc --noEmit",
|
|
77
79
|
"license-check": "pnpm dlx license-checker --production --onlyAllow \"MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;Unlicense\"",
|
|
78
80
|
"license-check:json": "pnpm dlx license-checker --production --onlyAllow \"MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;Unlicense\" --json",
|
package/src/MenuBar.tsx
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module MenuBar
|
|
3
|
+
* @description This module provides the main menu bar component.
|
|
4
|
+
* @description このモジュールは、メインメニューバーコンポーネントを提供します。
|
|
5
|
+
*/
|
|
6
|
+
import { useCallback, useEffect, useLayoutEffect, useState } from "react"
|
|
7
|
+
|
|
8
|
+
const useSafeLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect
|
|
9
|
+
|
|
10
|
+
import { MenuContent } from "./contents/MenuContent"
|
|
11
|
+
import type { IMenu, MenuNavigationPayload } from "./contents/MenuList"
|
|
12
|
+
import { OverlayShadow } from "./contents/OverlayShadow"
|
|
13
|
+
import { MenuSwitch } from "./elements/MenuSwitch"
|
|
14
|
+
import type { Theme } from "./types"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @interface IMenuBarProps
|
|
18
|
+
* @description Props for the MenuBar component.
|
|
19
|
+
* @description MenuBar コンポーネントの Props。
|
|
20
|
+
* @property {IMenu[]} menuList - The list of menu items. メニュー項目のリスト。
|
|
21
|
+
* @property {React.ReactNode} [menuHeader] - The header content of the menu. メニューのヘッダーコンテンツ。
|
|
22
|
+
* @property {() => void} onClickSignout - Function to handle sign out. サインアウトを処理する関数。
|
|
23
|
+
* @property {boolean} [isMenuhide] - Whether to hide the menu. メニューを非表示にするかどうか。
|
|
24
|
+
* @property {Theme} theme - The current theme.
|
|
25
|
+
* @property {() => void} toggleTheme - Function to toggle the theme.
|
|
26
|
+
* @property {(payload: MenuNavigationPayload) => void} [onMenuNavigate] - Function to receive menu navigation events. メニュー遷移イベントを受け取る関数。
|
|
27
|
+
* @property {boolean | "auto"} [closeOnEscape] - Controls whether the Escape key closes the menu.
|
|
28
|
+
* - "auto" (default): closes when NOT pinned, stays open when pinned. ピン留めなしでは閉じ、ピン留め中は閉じない。
|
|
29
|
+
* - true: always closes on Escape (resets pin if pinned). 常に閉じる。
|
|
30
|
+
* - false: never closes on Escape. 常に閉じない。
|
|
31
|
+
*/
|
|
32
|
+
interface IMenuBarProps {
|
|
33
|
+
menuList: IMenu[]
|
|
34
|
+
menuHeader?: React.ReactNode
|
|
35
|
+
onClickSignout(): void
|
|
36
|
+
isMenuhide?: boolean
|
|
37
|
+
theme: Theme
|
|
38
|
+
toggleTheme: () => void
|
|
39
|
+
onMenuNavigate?(payload: MenuNavigationPayload): void
|
|
40
|
+
onPinChange?(pinned: boolean): void
|
|
41
|
+
pinnedSubmenuIds?: number[]
|
|
42
|
+
initialPinnedSubmenuIds?: number[]
|
|
43
|
+
onSubmenuPinChange?(pinnedIds: number[]): void
|
|
44
|
+
closeOnEscape?: boolean | "auto"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @function MenuBar
|
|
49
|
+
* @description A component that renders the main menu bar.
|
|
50
|
+
* @description メインメニューバーを描画するコンポーネント。
|
|
51
|
+
* @param {IMenuBarProps} props - The props for the component.
|
|
52
|
+
* @returns {React.JSX.Element | null} The rendered menu bar.
|
|
53
|
+
*/
|
|
54
|
+
export const MenuBar = (props: IMenuBarProps): React.JSX.Element | null => {
|
|
55
|
+
const { menuList, menuHeader, onClickSignout, isMenuhide, theme, toggleTheme, onMenuNavigate, onPinChange, pinnedSubmenuIds: propPinnedSubmenuIds, initialPinnedSubmenuIds, onSubmenuPinChange, closeOnEscape = "auto" } = props
|
|
56
|
+
const [isPinned, setIsPinned] = useState(() => {
|
|
57
|
+
try {
|
|
58
|
+
return localStorage.getItem("aiquants-menu-pinned") === "true"
|
|
59
|
+
} catch {
|
|
60
|
+
return false
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
const [isMenuOpen, setIsMenuOpen] = useState(isPinned)
|
|
64
|
+
|
|
65
|
+
const [pinnedSubmenuIds, setPinnedSubmenuIds] = useState<number[]>(() => {
|
|
66
|
+
if (initialPinnedSubmenuIds) {
|
|
67
|
+
return initialPinnedSubmenuIds
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const saved = localStorage.getItem("aiquants-submenu-pinned")
|
|
71
|
+
if (saved) {
|
|
72
|
+
const parsed = JSON.parse(saved)
|
|
73
|
+
if (Array.isArray(parsed)) {
|
|
74
|
+
return parsed.filter((id) => typeof id === "number")
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} catch {}
|
|
78
|
+
return []
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const activePinnedSubmenuIds = propPinnedSubmenuIds !== undefined ? propPinnedSubmenuIds : pinnedSubmenuIds
|
|
82
|
+
|
|
83
|
+
const handleToggleSubmenuPin = useCallback(
|
|
84
|
+
(id: number) => {
|
|
85
|
+
const currentIds = propPinnedSubmenuIds !== undefined ? propPinnedSubmenuIds : pinnedSubmenuIds
|
|
86
|
+
const nextIds = currentIds.includes(id) ? currentIds.filter((x) => x !== id) : [...currentIds, id]
|
|
87
|
+
|
|
88
|
+
if (propPinnedSubmenuIds === undefined) {
|
|
89
|
+
setPinnedSubmenuIds(nextIds)
|
|
90
|
+
try {
|
|
91
|
+
localStorage.setItem("aiquants-submenu-pinned", JSON.stringify(nextIds))
|
|
92
|
+
} catch {}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (onSubmenuPinChange) {
|
|
96
|
+
onSubmenuPinChange(nextIds)
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
[propPinnedSubmenuIds, pinnedSubmenuIds, onSubmenuPinChange],
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
// ピン状態変化時に CSS 変数をセットしコールバックで通知
|
|
103
|
+
useSafeLayoutEffect(() => {
|
|
104
|
+
const width = isPinned ? "250px" : "0px"
|
|
105
|
+
document.documentElement.style.setProperty("--aiquants-menu-pinned-width", width)
|
|
106
|
+
onPinChange?.(isPinned)
|
|
107
|
+
}, [isPinned, onPinChange])
|
|
108
|
+
|
|
109
|
+
// アンマウント時に CSS 変数をリセット
|
|
110
|
+
useSafeLayoutEffect(() => {
|
|
111
|
+
return () => {
|
|
112
|
+
document.documentElement.style.setProperty("--aiquants-menu-pinned-width", "0px")
|
|
113
|
+
}
|
|
114
|
+
}, [])
|
|
115
|
+
|
|
116
|
+
const handleMenuOpen = useCallback(() => {
|
|
117
|
+
setIsMenuOpen(true)
|
|
118
|
+
}, [])
|
|
119
|
+
|
|
120
|
+
const handleMenuClose = useCallback(() => {
|
|
121
|
+
setIsMenuOpen(false)
|
|
122
|
+
setIsPinned(false)
|
|
123
|
+
try {
|
|
124
|
+
localStorage.removeItem("aiquants-menu-pinned")
|
|
125
|
+
} catch {}
|
|
126
|
+
}, [])
|
|
127
|
+
|
|
128
|
+
const handleTogglePin = useCallback(() => {
|
|
129
|
+
setIsPinned((prev) => {
|
|
130
|
+
const next = !prev
|
|
131
|
+
if (next) {
|
|
132
|
+
try {
|
|
133
|
+
localStorage.setItem("aiquants-menu-pinned", "true")
|
|
134
|
+
} catch {}
|
|
135
|
+
} else {
|
|
136
|
+
try {
|
|
137
|
+
localStorage.removeItem("aiquants-menu-pinned")
|
|
138
|
+
} catch {}
|
|
139
|
+
}
|
|
140
|
+
return next
|
|
141
|
+
})
|
|
142
|
+
}, [])
|
|
143
|
+
|
|
144
|
+
const handleMenuSelected = useCallback(
|
|
145
|
+
(payload: MenuNavigationPayload) => {
|
|
146
|
+
if (onMenuNavigate) {
|
|
147
|
+
onMenuNavigate(payload)
|
|
148
|
+
}
|
|
149
|
+
if (!isPinned) {
|
|
150
|
+
setIsMenuOpen(false)
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[onMenuNavigate, isPinned],
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
const handleEscKey = useCallback(
|
|
157
|
+
(e: KeyboardEvent) => {
|
|
158
|
+
if (e.key === "Escape") {
|
|
159
|
+
handleMenuClose()
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[handleMenuClose],
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
// Esc キーで閉じるかの実効値。
|
|
166
|
+
// "auto" (デフォルト): ピン留めなしでは閉じ、ピン留め中は閉じない。true/false で強制。
|
|
167
|
+
// 想定外の値が渡された場合は安全側 (閉じない) に倒す。
|
|
168
|
+
const escapeCloses = closeOnEscape === true || (closeOnEscape === "auto" && !isPinned)
|
|
169
|
+
|
|
170
|
+
// Escキーでメニューを閉じる処理 (escapeCloses が true のときのみリスナーを登録)
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if (isMenuOpen && escapeCloses) {
|
|
173
|
+
window.addEventListener("keydown", handleEscKey, { passive: true })
|
|
174
|
+
} else {
|
|
175
|
+
window.removeEventListener("keydown", handleEscKey)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return () => {
|
|
179
|
+
window.removeEventListener("keydown", handleEscKey)
|
|
180
|
+
}
|
|
181
|
+
}, [isMenuOpen, escapeCloses, handleEscKey])
|
|
182
|
+
|
|
183
|
+
return isMenuhide ? null : (
|
|
184
|
+
<div className={`aiquants-menu-bar ${theme}`}>
|
|
185
|
+
<MenuSwitch onMenuClose={handleMenuClose} onMenuOpen={handleMenuOpen} open={!isMenuOpen} theme={theme} />
|
|
186
|
+
<MenuContent
|
|
187
|
+
menuList={menuList}
|
|
188
|
+
menuHeader={menuHeader}
|
|
189
|
+
onClickSignout={onClickSignout}
|
|
190
|
+
onMenuSelected={handleMenuSelected}
|
|
191
|
+
open={isMenuOpen}
|
|
192
|
+
theme={theme}
|
|
193
|
+
toggleTheme={toggleTheme}
|
|
194
|
+
isPinned={isPinned}
|
|
195
|
+
onTogglePin={handleTogglePin}
|
|
196
|
+
pinnedSubmenuIds={activePinnedSubmenuIds}
|
|
197
|
+
onToggleSubmenuPin={handleToggleSubmenuPin}
|
|
198
|
+
/>
|
|
199
|
+
<OverlayShadow isOverlay={isMenuOpen && !isPinned} onOverlayClick={handleMenuClose} />
|
|
200
|
+
</div>
|
|
201
|
+
)
|
|
202
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { UserProfile } from "../types/user"
|
|
2
|
+
|
|
3
|
+
const DEFAULT_USER_ICON =
|
|
4
|
+
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NiZDVlMSI+PHBhdGggZD0iTTEyIDEyYzIuMjEgMCA0LTEuNzkgNC00cy0xLjc5LTQtNC00LTQgMS43OS00IDQgMS43OSA0IDQgNHptMCAyYy0yLjY3IDAtOCAxLjM0LTggNHYyaDE2di0yYzAtMi42Ni01LjMzLTQtOC00eiIvPjwvc3ZnPg=="
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Link component props interface.
|
|
8
|
+
* リンクコンポーネントのプロパティ。
|
|
9
|
+
*/
|
|
10
|
+
export interface LinkProps {
|
|
11
|
+
/** Link destination URL */
|
|
12
|
+
to: string
|
|
13
|
+
/** CSS class name */
|
|
14
|
+
className?: string
|
|
15
|
+
/** Link content */
|
|
16
|
+
children: React.ReactNode
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Generic Link component that can be replaced with router-specific implementation.
|
|
21
|
+
* ルーター固有の実装で置き換え可能な汎用リンクコンポーネント。
|
|
22
|
+
*/
|
|
23
|
+
export const DefaultLink = ({ to, className, children }: LinkProps): React.JSX.Element => (
|
|
24
|
+
<a href={to} className={className}>
|
|
25
|
+
{children}
|
|
26
|
+
</a>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* SessionInfo component props interface.
|
|
31
|
+
* ユーザーセッション情報を表示するコンポーネントのプロパティ。
|
|
32
|
+
*/
|
|
33
|
+
export interface SessionInfoProps {
|
|
34
|
+
/** User profile information from Google OAuth */
|
|
35
|
+
user: UserProfile | null
|
|
36
|
+
/** Custom Link component (optional, defaults to DefaultLink) */
|
|
37
|
+
LinkComponent?: React.ComponentType<LinkProps>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* SessionInfo component for displaying user session information.
|
|
42
|
+
* Displays user profile photo, navigation links, and user name when authenticated.
|
|
43
|
+
*
|
|
44
|
+
* ユーザーセッション情報を表示するコンポーネント。
|
|
45
|
+
* 認証時にプロフィール写真、ナビゲーションリンク、ユーザー名を表示する。
|
|
46
|
+
*/
|
|
47
|
+
export const SessionInfo = (props: SessionInfoProps): React.JSX.Element => {
|
|
48
|
+
const { user, LinkComponent = DefaultLink } = props
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className="max-h-20 max-w-52">
|
|
52
|
+
<div className="flex grow flex-col">
|
|
53
|
+
{user ? (
|
|
54
|
+
<>
|
|
55
|
+
<div className="flex flex-row">
|
|
56
|
+
<div className="aiquants-session-photo m-1 h-14 w-14 p-0.5">
|
|
57
|
+
<img className="object-contain" src={user.photo || DEFAULT_USER_ICON} aria-label="profile photo" />
|
|
58
|
+
</div>
|
|
59
|
+
<div className="mx-1 flex flex-col">
|
|
60
|
+
<LinkComponent className="aiquants-session-link my-1 rounded-lg px-2 text-center text-xs" to="/">
|
|
61
|
+
プロフィールを編集
|
|
62
|
+
</LinkComponent>
|
|
63
|
+
<LinkComponent className="aiquants-session-link rounded-lg px-2 text-center text-xs" to="/">
|
|
64
|
+
プロフィール
|
|
65
|
+
</LinkComponent>
|
|
66
|
+
<LinkComponent className="aiquants-session-link my-1 rounded-lg px-2 text-center text-xs" to="https://myaccount.google.com/">
|
|
67
|
+
Google Account
|
|
68
|
+
</LinkComponent>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div className="aiquants-session-info mb-1 min-h-[1em] w-full rounded-r-lg px-2 py-0.5 text-xs">{user.displayName}</div>
|
|
72
|
+
</>
|
|
73
|
+
) : (
|
|
74
|
+
<div className="aiquants-session-info mb-1 min-h-[1em] w-9/12 rounded-r-lg py-0.5 pl-1 text-xs">ログインはこちら</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|