@aiquants/menu-bar 1.18.2 → 1.19.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 +159 -30
- package/dist/MenuBar.d.ts +2 -29
- package/dist/components/SessionInfo.d.ts +1 -26
- package/dist/contents/MenuContent.d.ts +3 -14
- package/dist/contents/MenuList.d.ts +3 -38
- package/dist/contents/OverlayShadow.d.ts +1 -20
- package/dist/elements/MenuSwitch.d.ts +8 -22
- package/dist/events/pinEvent.d.ts +2 -37
- package/dist/hooks/useMenuPinState.d.ts +1 -16
- package/dist/index.d.ts +11 -21
- package/dist/index.es.js +478 -475
- package/dist/index.umd.js +2 -2
- package/dist/styles/menu-bar.css +1 -1
- package/dist/styles/menu-bar.standalone.css +1 -1
- package/dist/types/user.d.ts +0 -7
- package/dist/types.d.ts +1 -15
- package/package.json +8 -6
- package/dist/__tests__/pinEvent.test.d.ts +0 -1
- package/src/MenuBar.tsx +0 -248
- package/src/__tests__/pinEvent.test.tsx +0 -68
- package/src/components/SessionInfo.tsx +0 -95
- package/src/contents/MenuContent.tsx +0 -79
- package/src/contents/MenuList.tsx +0 -400
- package/src/contents/OverlayShadow.tsx +0 -30
- package/src/elements/MenuSwitch.tsx +0 -134
- package/src/events/pinEvent.ts +0 -129
- package/src/hooks/useMenuPinState.ts +0 -58
- package/src/index.ts +0 -29
- package/src/lucide-icons.d.ts +0 -6
- package/src/styles/components.entry.css +0 -11
- package/src/styles/menu-bar.css +0 -224
- package/src/styles/standalone.entry.css +0 -12
- package/src/types/user.ts +0 -12
- package/src/types.ts +0 -24
package/src/events/pinEvent.ts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module events/pinEvent
|
|
3
|
-
* @description Event handling and subscription helpers for menu pin state.
|
|
4
|
-
* @description メニューピン留め状態のイベント処理および購読ヘルパー。
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { MenuPinChangeDetail, MenuPinCustomEvent } from "../types"
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Canonical Window CustomEvent name for menu pin state changes.
|
|
11
|
-
* メニューのピン留め状態変更を通知する正準 CustomEvent 名。
|
|
12
|
-
*/
|
|
13
|
-
export const MENU_PIN_CHANGE_EVENT = "aiquants-menu-pin-change"
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Cached snapshot object reference to prevent unnecessary re-renders in useSyncExternalStore.
|
|
17
|
-
* 不要な再レンダリングを防止するためのキャッシュスナップショットオブジェクト参照。
|
|
18
|
-
*/
|
|
19
|
-
let cachedSnapshot: MenuPinChangeDetail = { pinned: false, width: 0 }
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Reads initial pin state safely from document CSS variable or localStorage.
|
|
23
|
-
* document の CSS 変数または localStorage から初期のピン留め状態を安全に読み取ります。
|
|
24
|
-
*
|
|
25
|
-
* @param defaultPinnedWidth - Default width in pixels when pinned (default: 240).
|
|
26
|
-
* @returns Current MenuPinChangeDetail object.
|
|
27
|
-
*/
|
|
28
|
-
export const getInitialPinState = (defaultPinnedWidth = 240): MenuPinChangeDetail => {
|
|
29
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
30
|
-
return { pinned: false, width: 0 }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
const cssVal = getComputedStyle(document.documentElement).getPropertyValue("--aiquants-menu-pinned-width").trim()
|
|
35
|
-
|
|
36
|
-
if (cssVal) {
|
|
37
|
-
const numericWidth = Number.parseInt(cssVal, 10)
|
|
38
|
-
if (!Number.isNaN(numericWidth)) {
|
|
39
|
-
const pinned = numericWidth > 0
|
|
40
|
-
const width = pinned ? numericWidth || defaultPinnedWidth : 0
|
|
41
|
-
if (cachedSnapshot.pinned === pinned && cachedSnapshot.width === width) {
|
|
42
|
-
return cachedSnapshot
|
|
43
|
-
}
|
|
44
|
-
cachedSnapshot = { pinned, width }
|
|
45
|
-
return cachedSnapshot
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const saved = localStorage.getItem("aiquants-menu-pinned")
|
|
50
|
-
const pinned = saved === "true"
|
|
51
|
-
const width = pinned ? defaultPinnedWidth : 0
|
|
52
|
-
if (cachedSnapshot.pinned === pinned && cachedSnapshot.width === width) {
|
|
53
|
-
return cachedSnapshot
|
|
54
|
-
}
|
|
55
|
-
cachedSnapshot = { pinned, width }
|
|
56
|
-
return cachedSnapshot
|
|
57
|
-
} catch {
|
|
58
|
-
return { pinned: false, width: 0 }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Dispatches a CustomEvent on window with menu pin state details.
|
|
64
|
-
* window に対してメニューピン留め状態変更カスタムイベントを発行します。
|
|
65
|
-
*
|
|
66
|
-
* @param pinned - Whether the menu is pinned.
|
|
67
|
-
* @param width - The pinned width in pixels.
|
|
68
|
-
*/
|
|
69
|
-
export const dispatchMenuPinChange = (pinned: boolean, width: number): void => {
|
|
70
|
-
if (typeof window === "undefined") return
|
|
71
|
-
|
|
72
|
-
const detail: MenuPinChangeDetail = { pinned, width }
|
|
73
|
-
if (cachedSnapshot.pinned !== pinned || cachedSnapshot.width !== width) {
|
|
74
|
-
cachedSnapshot = detail
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const event: MenuPinCustomEvent = new CustomEvent(MENU_PIN_CHANGE_EVENT, {
|
|
78
|
-
detail,
|
|
79
|
-
bubbles: true,
|
|
80
|
-
cancelable: false,
|
|
81
|
-
})
|
|
82
|
-
window.dispatchEvent(event)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Options for subscribing to menu pin state changes.
|
|
87
|
-
* メニューピン留め状態購読時のオプション。
|
|
88
|
-
*/
|
|
89
|
-
export interface SubscribeMenuPinOptions {
|
|
90
|
-
/** Whether to immediately invoke the listener with the current state upon subscription (default: true). 購読開始時に即座に現在の状態を通知するかどうか。 */
|
|
91
|
-
immediate?: boolean
|
|
92
|
-
/** Default width when pinned (default: 240). ピン留め時のデフォルト幅。 */
|
|
93
|
-
defaultPinnedWidth?: number
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Subscribes a listener to menu pin state changes on window.
|
|
98
|
-
* Returns an unsubscription cleanup function.
|
|
99
|
-
* window 上のメニューピン留め状態変更イベントを購読します。
|
|
100
|
-
* クリーンアップ関数を返します。
|
|
101
|
-
*
|
|
102
|
-
* @param listener - Callback invoked on pin state changes.
|
|
103
|
-
* @param options - Subscription options (e.g. immediate notification).
|
|
104
|
-
* @returns Cleanup function to unsubscribe.
|
|
105
|
-
*/
|
|
106
|
-
export const subscribeMenuPinChange = (listener: (detail: MenuPinChangeDetail) => void, options?: SubscribeMenuPinOptions): (() => void) => {
|
|
107
|
-
if (typeof window === "undefined") {
|
|
108
|
-
return () => {}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const { immediate = true, defaultPinnedWidth = 240 } = options ?? {}
|
|
112
|
-
|
|
113
|
-
if (immediate) {
|
|
114
|
-
const currentState = getInitialPinState(defaultPinnedWidth)
|
|
115
|
-
listener(currentState)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const handler = (e: Event) => {
|
|
119
|
-
const customEvent = e as MenuPinCustomEvent
|
|
120
|
-
if (customEvent.detail) {
|
|
121
|
-
listener(customEvent.detail)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
window.addEventListener(MENU_PIN_CHANGE_EVENT, handler, { passive: true })
|
|
126
|
-
return () => {
|
|
127
|
-
window.removeEventListener(MENU_PIN_CHANGE_EVENT, handler)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module hooks/useMenuPinState
|
|
3
|
-
* @description Custom React hook to subscribe to menu pin state changes using useSyncExternalStore.
|
|
4
|
-
* @description useSyncExternalStore を用いてメニューのピン留め状態および幅の変化をシームレスに購読するカスタム React フック。
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useCallback, useSyncExternalStore } from "react"
|
|
8
|
-
import { getInitialPinState, subscribeMenuPinChange } from "../events/pinEvent"
|
|
9
|
-
import type { MenuPinChangeDetail } from "../types"
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Options for the useMenuPinState hook.
|
|
13
|
-
* useMenuPinState フックのオプション。
|
|
14
|
-
*/
|
|
15
|
-
export interface UseMenuPinStateOptions {
|
|
16
|
-
/** Initial pinned state for server-side rendering (default: false). SSR 時の初期ピン留め状態。 */
|
|
17
|
-
initialPinned?: boolean
|
|
18
|
-
/** Default width when pinned in pixels (default: 240). デフォルトのピン留め幅。 */
|
|
19
|
-
defaultPinnedWidth?: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* React hook for consuming components to seamlessly subscribe to menu pin state changes.
|
|
24
|
-
* Hydration-safe, re-render optimized via React 18 useSyncExternalStore.
|
|
25
|
-
* 利用側 React コンポーネントがメニューのピン留め状態および幅をシームレスに購読するためのカスタムフック。
|
|
26
|
-
*
|
|
27
|
-
* @param options - Optional initial pin state and width configuration.
|
|
28
|
-
* @returns Current MenuPinChangeDetail ({ pinned: boolean, width: number }).
|
|
29
|
-
*/
|
|
30
|
-
export const useMenuPinState = (options?: UseMenuPinStateOptions): MenuPinChangeDetail => {
|
|
31
|
-
const defaultPinnedWidth = options?.defaultPinnedWidth ?? 240
|
|
32
|
-
const initialPinned = options?.initialPinned ?? false
|
|
33
|
-
|
|
34
|
-
const subscribe = useCallback(
|
|
35
|
-
(onStoreChange: () => void) => {
|
|
36
|
-
return subscribeMenuPinChange(
|
|
37
|
-
() => {
|
|
38
|
-
onStoreChange()
|
|
39
|
-
},
|
|
40
|
-
{ immediate: false, defaultPinnedWidth },
|
|
41
|
-
)
|
|
42
|
-
},
|
|
43
|
-
[defaultPinnedWidth],
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
const getSnapshot = useCallback(() => {
|
|
47
|
-
return getInitialPinState(defaultPinnedWidth)
|
|
48
|
-
}, [defaultPinnedWidth])
|
|
49
|
-
|
|
50
|
-
const getServerSnapshot = useCallback((): MenuPinChangeDetail => {
|
|
51
|
-
return {
|
|
52
|
-
pinned: initialPinned,
|
|
53
|
-
width: initialPinned ? defaultPinnedWidth : 0,
|
|
54
|
-
}
|
|
55
|
-
}, [initialPinned, defaultPinnedWidth])
|
|
56
|
-
|
|
57
|
-
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
|
|
58
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module index
|
|
3
|
-
* @description Entry point for @aiquants/menu-bar package exports.
|
|
4
|
-
* @description @aiquants/menu-bar パッケージのエクスポートエントリーポイント。
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/** @deprecated Use MenuBarLinkProps instead to avoid namespace collisions. */
|
|
8
|
-
export type { LinkProps as MenuBarLinkProps, LinkProps, SessionInfoProps as MenuBarSessionInfoProps, SessionInfoProps } from "./components/SessionInfo"
|
|
9
|
-
export { DefaultLink, SessionInfo } from "./components/SessionInfo"
|
|
10
|
-
/** @deprecated Use IMenuBarMenu instead to avoid namespace collisions. */
|
|
11
|
-
/** @deprecated Use IMenuBarSubmenu instead to avoid namespace collisions. */
|
|
12
|
-
export type { IMenu as IMenuBarMenu, IMenu, ISubmenu as IMenuBarSubmenu, ISubmenu, MenuNavigationPayload } from "./contents/MenuList"
|
|
13
|
-
export type { SubscribeMenuPinOptions } from "./events/pinEvent"
|
|
14
|
-
export {
|
|
15
|
-
dispatchMenuPinChange,
|
|
16
|
-
getInitialPinState,
|
|
17
|
-
MENU_PIN_CHANGE_EVENT,
|
|
18
|
-
subscribeMenuPinChange,
|
|
19
|
-
} from "./events/pinEvent"
|
|
20
|
-
|
|
21
|
-
export type { UseMenuPinStateOptions } from "./hooks/useMenuPinState"
|
|
22
|
-
export { useMenuPinState } from "./hooks/useMenuPinState"
|
|
23
|
-
|
|
24
|
-
export type { IMenuBarProps } from "./MenuBar"
|
|
25
|
-
export { MenuBar } from "./MenuBar"
|
|
26
|
-
/** @deprecated Use MenuBarTheme instead to avoid namespace collisions. */
|
|
27
|
-
export type { MenuPinChangeDetail, MenuPinCustomEvent, Theme as MenuBarTheme, Theme } from "./types"
|
|
28
|
-
/** @deprecated Use MenuBarUserProfile instead to avoid namespace collisions. */
|
|
29
|
-
export type { UserProfile as MenuBarUserProfile, UserProfile } from "./types/user"
|
package/src/lucide-icons.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Artifact A: components-only CSS (Tailwind ホスト向け).
|
|
3
|
-
* theme(reference) によりテーマトークンは var(--token, fallback) 形式で参照され、
|
|
4
|
-
* :root へのテーマ変数放出・ユーティリティ・preflight は一切含まない。
|
|
5
|
-
* ホストは @import "@aiquants/menu-bar/styles/menu-bar.css" layer(components) で読み込み、
|
|
6
|
-
* JSX ユーティリティはホスト側の @source スキャンで単一正準ビルドに生成する。
|
|
7
|
-
*/
|
|
8
|
-
@import "tailwindcss/theme.css" theme(reference);
|
|
9
|
-
@layer components {
|
|
10
|
-
@import "./menu-bar.css";
|
|
11
|
-
}
|
package/src/styles/menu-bar.css
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
/* biome-ignore-all lint: menu-bar stylesheet */
|
|
2
|
-
/* メニューバー専用のスコープ化されたスタイル */
|
|
3
|
-
|
|
4
|
-
:root {
|
|
5
|
-
--aiquants-menu-pinned-width: 0px;
|
|
6
|
-
|
|
7
|
-
/* 中立なメニュースイッチのカスタムプロパティ・デフォルト値 */
|
|
8
|
-
--aqmb-switch-position: fixed;
|
|
9
|
-
--aqmb-switch-top: 6px;
|
|
10
|
-
--aqmb-switch-right: 8px;
|
|
11
|
-
--aqmb-switch-left: auto;
|
|
12
|
-
--aqmb-switch-bottom: auto;
|
|
13
|
-
--aqmb-switch-z-index: 2147483647;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* メニューバーコンテナ内でのみTailwindスタイルを適用 */
|
|
17
|
-
.aiquants-menu-bar {
|
|
18
|
-
position: relative;
|
|
19
|
-
/* 基本的なフォントスタイル */
|
|
20
|
-
font-size: 1rem;
|
|
21
|
-
line-height: 1.5;
|
|
22
|
-
|
|
23
|
-
/* メニューバー内の要素のリセット */
|
|
24
|
-
* {
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* メニューバー内のリンクとボタンの基本スタイル */
|
|
29
|
-
a,
|
|
30
|
-
button {
|
|
31
|
-
text-decoration: none;
|
|
32
|
-
border: none;
|
|
33
|
-
background: none;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* ダークモード用のスタイル */
|
|
39
|
-
.aiquants-menu-bar.dark {
|
|
40
|
-
color-scheme: dark;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* ダークモード時のメニューコンテンツの背景色 */
|
|
44
|
-
.aiquants-menu-bar.dark .aiquants-menu-content {
|
|
45
|
-
background-color: rgb(15 23 42); /* slate-900 */
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* ライトモード時のメニューコンテンツの背景色 */
|
|
49
|
-
.aiquants-menu-bar.light .aiquants-menu-content,
|
|
50
|
-
.aiquants-menu-bar .aiquants-menu-content {
|
|
51
|
-
background-color: rgb(3 105 161); /* sky-700 */
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* ダークモード時のボタンスタイル */
|
|
55
|
-
.aiquants-menu-bar.dark .aiquants-signout-button {
|
|
56
|
-
background-color: rgb(51 65 85); /* slate-700 */
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.aiquants-menu-bar.dark .aiquants-signout-button:hover {
|
|
60
|
-
background-color: rgb(71 85 105); /* slate-600 */
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* ライトモード時のボタンスタイル */
|
|
64
|
-
.aiquants-menu-bar.light .aiquants-signout-button,
|
|
65
|
-
.aiquants-menu-bar .aiquants-signout-button {
|
|
66
|
-
background-color: rgb(37 99 235); /* blue-600 */
|
|
67
|
-
white-space: nowrap;
|
|
68
|
-
min-width: 0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.aiquants-menu-bar.light .aiquants-signout-button:hover,
|
|
72
|
-
.aiquants-menu-bar .aiquants-signout-button:hover {
|
|
73
|
-
background-color: rgb(30 64 175); /* blue-800 */
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* ダークモード時のメニューリストアイテム */
|
|
77
|
-
.aiquants-menu-bar.dark .aiquants-menu-list-item {
|
|
78
|
-
background-color: rgb(51 65 85); /* slate-700 */
|
|
79
|
-
color: rgb(209 213 219); /* gray-300 */
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.aiquants-menu-bar.dark .aiquants-menu-list-item::before {
|
|
83
|
-
background-color: rgb(148 163 184); /* slate-400 */
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.aiquants-menu-bar.dark .aiquants-menu-submenu {
|
|
87
|
-
background-color: rgb(30 41 59); /* slate-800 */
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.aiquants-menu-bar.dark .aiquants-menu-link {
|
|
91
|
-
color: rgb(56 189 248); /* sky-400 */
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.aiquants-menu-bar.dark .aiquants-menu-separator {
|
|
95
|
-
border-color: rgb(75 85 99); /* gray-500 */
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* ライトモード時のメニューリストアイテム */
|
|
99
|
-
.aiquants-menu-bar.light .aiquants-menu-list-item,
|
|
100
|
-
.aiquants-menu-bar .aiquants-menu-list-item {
|
|
101
|
-
background-color: rgb(186 230 253); /* sky-200 */
|
|
102
|
-
color: rgb(75 85 99); /* gray-600 */
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.aiquants-menu-bar.light .aiquants-menu-list-item::before,
|
|
106
|
-
.aiquants-menu-bar .aiquants-menu-list-item::before {
|
|
107
|
-
background-color: rgb(255 255 255); /* white */
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.aiquants-menu-bar.light .aiquants-menu-submenu,
|
|
111
|
-
.aiquants-menu-bar .aiquants-menu-submenu {
|
|
112
|
-
background-color: rgb(250 250 250); /* zinc-50 */
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.aiquants-menu-bar.light .aiquants-menu-link,
|
|
116
|
-
.aiquants-menu-bar .aiquants-menu-link {
|
|
117
|
-
color: rgb(2 132 199); /* sky-600 */
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.aiquants-menu-bar.light .aiquants-menu-separator,
|
|
121
|
-
.aiquants-menu-bar .aiquants-menu-separator {
|
|
122
|
-
border-color: rgb(75 85 99); /* gray-600 */
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.aiquants-menu-bar .aiquants-menu-separator {
|
|
126
|
-
border-top: 1px solid;
|
|
127
|
-
height: 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/* SessionInfo グラスカード用基本スタイル */
|
|
131
|
-
.aiquants-menu-bar .aiquants-session-card {
|
|
132
|
-
backdrop-filter: blur(8px);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* アコーディオンメニューの詳細部分のスタイル */
|
|
136
|
-
.aiquants-menu-accordion-details {
|
|
137
|
-
/* max-inline-size: 40rem; */
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/* アコーディオンメニューのサマリー(ヘッダー)部分のスタイル */
|
|
141
|
-
.aiquants-menu-accordion-summary {
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
justify-content: space-between;
|
|
145
|
-
cursor: pointer;
|
|
146
|
-
|
|
147
|
-
/* デフォルトの詳細マーカー(通常は三角形)を非表示にする */
|
|
148
|
-
&::-webkit-details-marker {
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.aiquants-menu-accordion-summary span {
|
|
154
|
-
flex-grow: 1;
|
|
155
|
-
text-align: left;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* サブメニューピンボタンのスタイル */
|
|
159
|
-
.aiquants-submenu-pin-button {
|
|
160
|
-
display: inline-flex;
|
|
161
|
-
align-items: center;
|
|
162
|
-
justify-content: center;
|
|
163
|
-
padding: 0.15rem;
|
|
164
|
-
border-radius: 0.25rem;
|
|
165
|
-
transition: all 0.3s;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.aiquants-menu-bar.light .aiquants-submenu-pin-button {
|
|
169
|
-
color: rgba(75, 85, 99, 0.4);
|
|
170
|
-
}
|
|
171
|
-
.aiquants-menu-bar.light .aiquants-submenu-pin-button:hover {
|
|
172
|
-
color: rgba(75, 85, 99, 0.8);
|
|
173
|
-
background-color: rgba(75, 85, 99, 0.1);
|
|
174
|
-
}
|
|
175
|
-
.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned {
|
|
176
|
-
color: rgb(217 119 6); /* amber-600 */
|
|
177
|
-
}
|
|
178
|
-
.aiquants-menu-bar.light .aiquants-submenu-pin-button.pinned:hover {
|
|
179
|
-
color: rgb(180 83 9); /* amber-700 */
|
|
180
|
-
background-color: rgba(217, 119, 6, 0.1);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.aiquants-menu-bar.dark .aiquants-submenu-pin-button {
|
|
184
|
-
color: rgba(255, 255, 255, 0.4);
|
|
185
|
-
}
|
|
186
|
-
.aiquants-menu-bar.dark .aiquants-submenu-pin-button:hover {
|
|
187
|
-
color: rgba(255, 255, 255, 0.8);
|
|
188
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
189
|
-
}
|
|
190
|
-
.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned {
|
|
191
|
-
color: rgb(245 158 11); /* amber-500 */
|
|
192
|
-
}
|
|
193
|
-
.aiquants-menu-bar.dark .aiquants-submenu-pin-button.pinned:hover {
|
|
194
|
-
color: rgb(251 191 36); /* amber-400 */
|
|
195
|
-
background-color: rgba(245, 158, 11, 0.15);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* アコーディオンメニューのコンテナ全体のスタイル */
|
|
199
|
-
.aiquants-menu-accordion-container {
|
|
200
|
-
/* 高さの変化を0.5秒かけてアニメーションさせる */
|
|
201
|
-
transition: block-size 0.5s;
|
|
202
|
-
/* 要素のサイズ計算を最適化する */
|
|
203
|
-
contain: content;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/* メニューの開閉状態に応じたスタイル */
|
|
207
|
-
/* X軸方向に0px移動させる(メニューが開いた状態) */
|
|
208
|
-
.aiquants-menu-translate-x-0 {
|
|
209
|
-
transform: translateX(0px);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/* X軸方向に250px移動させる(メニューが閉じた状態) */
|
|
213
|
-
.aiquants-menu-translate-x-250 {
|
|
214
|
-
transform: translateX(250px);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.aiquants-menu-switch {
|
|
218
|
-
position: var(--aqmb-switch-position, fixed);
|
|
219
|
-
top: var(--aqmb-switch-top, 6px);
|
|
220
|
-
right: var(--aqmb-switch-right, 8px);
|
|
221
|
-
left: var(--aqmb-switch-left, auto);
|
|
222
|
-
bottom: var(--aqmb-switch-bottom, auto);
|
|
223
|
-
z-index: var(--aqmb-switch-z-index, 2147483647);
|
|
224
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*! @aiquants/menu-bar standalone CSS — 非 Tailwind ホスト専用。ホストの Tailwind ビルドと混在させないこと (同名ユーティリティ重複でカスケード反転が起きる) */
|
|
2
|
-
/*
|
|
3
|
-
* Artifact B: components + JSX ユーティリティを単一ビルドで自己完結生成する.
|
|
4
|
-
* source(none) で自動検出を無効化し src のみをスキャン (README/demo クラス混入を防止)。
|
|
5
|
-
* dark: は .dark クラス基準 (ホストは <html> に .dark を付与する)。
|
|
6
|
-
*/
|
|
7
|
-
@layer theme, base, components, utilities;
|
|
8
|
-
@import "tailwindcss/theme.css" layer(theme);
|
|
9
|
-
@import "tailwindcss/utilities.css" layer(utilities) source(none);
|
|
10
|
-
@import "./menu-bar.css" layer(components);
|
|
11
|
-
@source "../**/*.{ts,tsx}";
|
|
12
|
-
@custom-variant dark (&:where(.dark, .dark *));
|
package/src/types/user.ts
DELETED
package/src/types.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module types
|
|
3
|
-
* @description Common type definitions for @aiquants/menu-bar.
|
|
4
|
-
* @description @aiquants/menu-bar の共通型定義。
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export type Theme = "light" | "dark"
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Menu pin change event payload detail interface.
|
|
11
|
-
* メニューピン留め状態変更イベントの詳細ペイロード。
|
|
12
|
-
*/
|
|
13
|
-
export interface MenuPinChangeDetail {
|
|
14
|
-
/** Whether the menu is currently pinned open. メニューが現在ピン留めされているかどうか。 */
|
|
15
|
-
pinned: boolean
|
|
16
|
-
/** Pinned width in pixels (e.g. 240 or 0). ピン留め時の幅 (ピクセル単位)。 */
|
|
17
|
-
width: number
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Custom Event type for menu pin change events.
|
|
22
|
-
* メニューピン留め状態変更カスタムイベントの型。
|
|
23
|
-
*/
|
|
24
|
-
export type MenuPinCustomEvent = CustomEvent<MenuPinChangeDetail>
|