@1889ca/ui 0.4.0 → 0.5.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/package.json +1 -1
- package/src/components/Panel.css +65 -0
- package/src/components/Panel.jsx +31 -0
- package/src/index.js +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Contract: contracts/packages-ui-components/rules.md */
|
|
2
|
+
|
|
3
|
+
.ui-panel {
|
|
4
|
+
background: rgba(18, 18, 24, 0.8);
|
|
5
|
+
backdrop-filter: blur(var(--ui-glass-blur-heavy));
|
|
6
|
+
border: 1px solid var(--ui-border);
|
|
7
|
+
border-top-color: var(--ui-border-strong);
|
|
8
|
+
border-radius: var(--ui-radius-lg);
|
|
9
|
+
box-shadow: var(--ui-shadow-float);
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
min-width: 120px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ui-panel-titlebar {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
padding: 0.4rem 0.65rem;
|
|
21
|
+
border-bottom: 1px solid var(--ui-border);
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ui-panel-title {
|
|
26
|
+
font-size: 0.7rem;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
color: var(--ui-text-muted);
|
|
29
|
+
text-transform: uppercase;
|
|
30
|
+
letter-spacing: 0.06em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ui-panel-actions {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 0.35rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ui-panel-close {
|
|
40
|
+
background: none;
|
|
41
|
+
border: none;
|
|
42
|
+
color: var(--ui-text-subtle);
|
|
43
|
+
font-size: 0.9rem;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
line-height: 1;
|
|
46
|
+
padding: 0.1rem 0.2rem;
|
|
47
|
+
border-radius: var(--ui-radius-sm);
|
|
48
|
+
transition: color 0.15s, background 0.15s;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ui-panel-close:hover {
|
|
52
|
+
color: var(--ui-text);
|
|
53
|
+
background: var(--ui-surface-raised);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ui-panel-body {
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-height: 0;
|
|
59
|
+
padding: 0.5rem 0.65rem;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ui-panel-body--flush {
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Contract: contracts/packages-ui-components/rules.md */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Static glass panel — same chrome as DraggablePanel but positioned in flow.
|
|
5
|
+
* Use for sidebar sections, inspector panels, toolboxes, etc.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} title - Titlebar text
|
|
8
|
+
* @param {ReactNode} children - Panel body content
|
|
9
|
+
* @param {ReactNode} actions - Extra elements in the titlebar (right side, before close)
|
|
10
|
+
* @param {function} onClose - Close button handler (omit to hide close button)
|
|
11
|
+
* @param {string} className - Additional class names
|
|
12
|
+
* @param {boolean} flush - If true, removes body padding (for custom layouts)
|
|
13
|
+
*/
|
|
14
|
+
export default function Panel({ title, children, actions, onClose, className, flush }) {
|
|
15
|
+
return (
|
|
16
|
+
<div className={`ui-panel${className ? ` ${className}` : ''}`}>
|
|
17
|
+
{title && (
|
|
18
|
+
<div className="ui-panel-titlebar">
|
|
19
|
+
<span className="ui-panel-title">{title}</span>
|
|
20
|
+
<div className="ui-panel-actions">
|
|
21
|
+
{actions}
|
|
22
|
+
{onClose && <button className="ui-panel-close" type="button" onClick={onClose}>×</button>}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
)}
|
|
26
|
+
<div className={`ui-panel-body${flush ? ' ui-panel-body--flush' : ''}`}>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
package/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import './components/LoginCard.css';
|
|
|
20
20
|
import './components/PasskeyLoginPage.css';
|
|
21
21
|
import './components/UserMenu.css';
|
|
22
22
|
import './components/StatusBar.css';
|
|
23
|
+
import './components/Panel.css';
|
|
23
24
|
|
|
24
25
|
/* Components */
|
|
25
26
|
export { default as ContextMenu } from './components/ContextMenu.jsx';
|
|
@@ -38,6 +39,7 @@ export { default as LoginCard } from './components/LoginCard.jsx';
|
|
|
38
39
|
export { default as PasskeyLoginPage } from './components/PasskeyLoginPage.jsx';
|
|
39
40
|
export { default as UserMenu } from './components/UserMenu.jsx';
|
|
40
41
|
export { default as StatusBar } from './components/StatusBar.jsx';
|
|
42
|
+
export { default as Panel } from './components/Panel.jsx';
|
|
41
43
|
|
|
42
44
|
/* Auth */
|
|
43
45
|
export { AuthProvider, useAuth } from './auth/AuthProvider.jsx';
|