@nesso-how/ui 0.0.0-stage → 1.0.0-alpha.30
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/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/index.d.ts +273 -0
- package/dist/index.js +1088 -0
- package/dist/styles.css +211 -0
- package/package.json +41 -3
package/dist/styles.css
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
@source "./**/*.{js,ts,tsx}";
|
|
2
|
+
|
|
3
|
+
@theme inline {
|
|
4
|
+
--color-background: var(--background);
|
|
5
|
+
--color-foreground: var(--foreground);
|
|
6
|
+
--color-canvas: var(--canvas);
|
|
7
|
+
--color-sidebar: var(--sidebar);
|
|
8
|
+
--color-sidebar-foreground: var(--foreground);
|
|
9
|
+
--color-primary: var(--primary);
|
|
10
|
+
--color-primary-hover: var(--primary-hover);
|
|
11
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
12
|
+
--color-muted: var(--muted);
|
|
13
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
14
|
+
--color-accent: var(--hover);
|
|
15
|
+
--color-pressed: var(--pressed);
|
|
16
|
+
--color-border: var(--border);
|
|
17
|
+
--color-input: var(--border);
|
|
18
|
+
--color-ring: var(--ring);
|
|
19
|
+
--color-destructive: var(--foreground);
|
|
20
|
+
--color-card: var(--background);
|
|
21
|
+
--color-popover: var(--background);
|
|
22
|
+
--color-node-border: var(--node-border);
|
|
23
|
+
--radius-sm: var(--radius-control);
|
|
24
|
+
--radius-lg: var(--radius-object);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@layer components {
|
|
28
|
+
.nesso-button,
|
|
29
|
+
.nesso-input,
|
|
30
|
+
.nesso-option {
|
|
31
|
+
border-radius: var(--radius-control);
|
|
32
|
+
transition: background-color var(--duration-state), border-color var(--duration-state);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.nesso-button:focus-visible,
|
|
36
|
+
.nesso-option:focus-visible {
|
|
37
|
+
outline: 2px solid var(--ring);
|
|
38
|
+
outline-offset: 2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nesso-input:focus-visible {
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.nesso-popup {
|
|
46
|
+
border: 1px solid var(--border);
|
|
47
|
+
border-radius: var(--radius-object);
|
|
48
|
+
background: var(--background);
|
|
49
|
+
color: var(--foreground);
|
|
50
|
+
box-shadow: 0 8px 24px #00000014;
|
|
51
|
+
outline: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.nesso-option[data-highlighted] {
|
|
55
|
+
background: var(--hover);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.nesso-color-hue { appearance: none; background: transparent; --hue-track: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
|
|
59
|
+
.nesso-color-hue::-webkit-slider-runnable-track { height: 8px; border-radius: 2px; background: var(--hue-track); }
|
|
60
|
+
.nesso-color-hue::-moz-range-track { height: 8px; border-radius: 2px; background: var(--hue-track); }
|
|
61
|
+
.nesso-color-hue::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -2px; border: 1px solid var(--primary); border-radius: 50%; background: var(--background); }
|
|
62
|
+
.nesso-color-hue::-moz-range-thumb { width: 10px; height: 10px; border: 1px solid var(--primary); border-radius: 50%; background: var(--background); }
|
|
63
|
+
|
|
64
|
+
@media (pointer: coarse) {
|
|
65
|
+
.nesso-button,
|
|
66
|
+
.nesso-input,
|
|
67
|
+
.nesso-option {
|
|
68
|
+
min-width: 44px;
|
|
69
|
+
min-height: 44px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@layer components {
|
|
75
|
+
.nesso-panel-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; height: 49px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--border); }
|
|
76
|
+
.nesso-panel-actions { display: flex; flex-shrink: 0; gap: 2px; color: var(--muted-foreground); }
|
|
77
|
+
.nesso-panel-actions button { width: 26px; height: 28px; }
|
|
78
|
+
|
|
79
|
+
.side-panel { position: relative; flex-shrink: 0; width: var(--panel-size); height: 100%; transition: width var(--duration-state) linear; }
|
|
80
|
+
.side-panel[data-open='false'] { width: 0; }
|
|
81
|
+
.side-panel-content { position: absolute; inset-block: 0; width: var(--panel-size); overflow: hidden; background: var(--background); transition: transform var(--duration-state) linear; }
|
|
82
|
+
.side-panel[data-side='left'] > .side-panel-content { left: 0; border-right: 1px solid var(--border); }
|
|
83
|
+
.side-panel[data-side='right'] > .side-panel-content { right: 0; border-left: 1px solid var(--border); }
|
|
84
|
+
.side-panel[data-side='left'][data-open='false'] > .side-panel-content { transform: translateX(-100%); }
|
|
85
|
+
.side-panel[data-side='right'][data-open='false'] > .side-panel-content { transform: translateX(100%); }
|
|
86
|
+
.side-panel > .panel-toggle { position: absolute; z-index: 30; top: 50%; }
|
|
87
|
+
.side-panel[data-side='left'] > .panel-toggle { left: 100%; translate: -50% -50%; }
|
|
88
|
+
.side-panel[data-side='right'] > .panel-toggle { right: 100%; translate: 50% -50%; }
|
|
89
|
+
.side-panel[data-open='false'] > .panel-toggle { translate: 0 -50%; }
|
|
90
|
+
.side-panel-resize { position: absolute; z-index: 20; inset-block: 0; width: 9px; cursor: col-resize; touch-action: none; }
|
|
91
|
+
.side-panel-resize:focus-visible { outline: 2px solid var(--ring); outline-offset: -4px; }
|
|
92
|
+
.side-panel[data-side='left'] > .side-panel-resize { right: -4px; }
|
|
93
|
+
.side-panel[data-side='right'] > .side-panel-resize { left: -4px; }
|
|
94
|
+
.side-panel[data-open='false'] > .side-panel-resize { display: none; }
|
|
95
|
+
.side-panel[data-resizing] { user-select: none; }
|
|
96
|
+
.side-panel[data-resizing], .side-panel[data-resizing] > .side-panel-content { transition: none; }
|
|
97
|
+
|
|
98
|
+
.panel-toggle { position: relative; isolation: isolate; display: grid; place-items: center; width: 28px; height: 52px; flex-shrink: 0; padding: 0; border: 0; color: color-mix(in srgb, var(--foreground) 70%, var(--muted-foreground)); background: transparent; cursor: pointer; }
|
|
99
|
+
.panel-toggle::before { content: ''; position: absolute; z-index: -1; inset: 10px 6px; border-radius: var(--radius-control); background: var(--background); box-shadow: 0 1px 3px #00000014, 0 0 0 1px var(--border); }
|
|
100
|
+
.panel-toggle svg { width: 13px; height: 13px; stroke-width: 2; pointer-events: none; }
|
|
101
|
+
.panel-toggle:hover { color: var(--foreground); }
|
|
102
|
+
.panel-toggle:hover::before { background: linear-gradient(var(--hover), var(--hover)), var(--background); }
|
|
103
|
+
.panel-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; border-radius: var(--radius-control); }
|
|
104
|
+
.panel-toggle[data-side='left'][aria-expanded='false'] { padding-right: 6px; }
|
|
105
|
+
.panel-toggle[data-side='left'][aria-expanded='false']::before { inset: 10px 6px 10px 0; border-radius: 0 var(--radius-control) var(--radius-control) 0; }
|
|
106
|
+
.panel-toggle[data-side='right'][aria-expanded='false'] { padding-left: 6px; }
|
|
107
|
+
.panel-toggle[data-side='right'][aria-expanded='false']::before { inset: 10px 0 10px 6px; border-radius: var(--radius-control) 0 0 var(--radius-control); }
|
|
108
|
+
|
|
109
|
+
@media (pointer: coarse) {
|
|
110
|
+
.panel-toggle { width: 44px; }
|
|
111
|
+
.panel-toggle::before { inset-inline: 14px; }
|
|
112
|
+
.panel-toggle[data-side='left'][aria-expanded='false'] { padding-right: 22px; }
|
|
113
|
+
.panel-toggle[data-side='left'][aria-expanded='false']::before { right: 22px; left: 0; }
|
|
114
|
+
.panel-toggle[data-side='right'][aria-expanded='false'] { padding-left: 22px; }
|
|
115
|
+
.panel-toggle[data-side='right'][aria-expanded='false']::before { left: 22px; right: 0; }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (prefers-reduced-motion: reduce) {
|
|
120
|
+
*,
|
|
121
|
+
*::before,
|
|
122
|
+
*::after {
|
|
123
|
+
transition-duration: 0s !important;
|
|
124
|
+
animation-duration: 0s !important;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.nesso-spinner { display: grid; grid-template-columns: repeat(2, 8px); gap: 4px; }
|
|
129
|
+
.nesso-spinner > span { width: 8px; height: 8px; background: currentColor; opacity: .25; animation: nesso-spinner-pulse 1.2s ease-in-out infinite; }
|
|
130
|
+
.nesso-spinner > span:nth-child(2) { animation-delay: -.9s; }
|
|
131
|
+
.nesso-spinner > span:nth-child(3) { animation-delay: -.3s; }
|
|
132
|
+
.nesso-spinner > span:nth-child(4) { animation-delay: -.6s; }
|
|
133
|
+
|
|
134
|
+
@keyframes nesso-spinner-pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
|
|
135
|
+
|
|
136
|
+
.toast-viewport {
|
|
137
|
+
position: fixed;
|
|
138
|
+
z-index: 60;
|
|
139
|
+
bottom: max(64px, env(safe-area-inset-bottom));
|
|
140
|
+
left: 50%;
|
|
141
|
+
transform: translateX(-50%);
|
|
142
|
+
width: min(380px, calc(100% - 32px));
|
|
143
|
+
max-height: calc(100% - 96px);
|
|
144
|
+
overflow-y: auto;
|
|
145
|
+
overscroll-behavior: contain;
|
|
146
|
+
scrollbar-width: none;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.toast-viewport::-webkit-scrollbar {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.toast-stack { display: flex; flex-direction: column-reverse; gap: 8px; }
|
|
155
|
+
.toast-queue { margin: 0 0 8px; text-align: center; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 10px; line-height: 16px; }
|
|
156
|
+
|
|
157
|
+
.nesso-toast {
|
|
158
|
+
position: relative;
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-shrink: 0;
|
|
161
|
+
flex-wrap: wrap;
|
|
162
|
+
align-items: flex-start;
|
|
163
|
+
gap: 10px 10px;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
padding: 14px;
|
|
166
|
+
border: 1px solid var(--border);
|
|
167
|
+
border-radius: var(--radius-object);
|
|
168
|
+
background: var(--background);
|
|
169
|
+
color: var(--foreground);
|
|
170
|
+
box-shadow: 0 8px 24px #00000014;
|
|
171
|
+
pointer-events: auto;
|
|
172
|
+
animation: toast-enter 180ms ease-out both;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.nesso-toast[data-tone='warning'] { border-color: var(--node-border); }
|
|
176
|
+
.nesso-toast[data-leaving] { animation: toast-exit 140ms ease-in both; pointer-events: none; }
|
|
177
|
+
.toast-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; stroke-width: 1.5; }
|
|
178
|
+
.toast-content { min-width: 0; flex: 1; overflow-wrap: anywhere; }
|
|
179
|
+
.toast-label { display: block; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 10px; line-height: 16px; }
|
|
180
|
+
.toast-title { margin: 4px 0 0; font-size: 13px; font-weight: 500; line-height: 19px; }
|
|
181
|
+
.toast-description { margin: 4px 0 0; color: var(--muted-foreground); font-size: 12px; line-height: 18px; }
|
|
182
|
+
.toast-actions { display: flex; flex-basis: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 2px; }
|
|
183
|
+
.toast-close { flex-shrink: 0; margin: -6px -6px 0 0; color: var(--muted-foreground); }
|
|
184
|
+
.toast-progress { position: absolute; inset: auto 0 0; height: 2px; background: var(--foreground); opacity: 0.2; transform-origin: left; animation: toast-progress var(--toast-duration) linear forwards; }
|
|
185
|
+
|
|
186
|
+
@keyframes toast-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
|
|
187
|
+
@keyframes toast-exit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(4px); } }
|
|
188
|
+
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
|
|
189
|
+
|
|
190
|
+
@media (max-width: 640px) {
|
|
191
|
+
.toast-viewport { width: calc(100% - 24px); bottom: max(76px, env(safe-area-inset-bottom)); max-height: calc(100% - 104px); }
|
|
192
|
+
.toast-viewport { left: 12px; right: 12px; transform: none; }
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@media (prefers-reduced-motion: reduce) {
|
|
196
|
+
.nesso-spinner > span { animation: none; opacity: .65; }
|
|
197
|
+
.nesso-toast { animation: none; }
|
|
198
|
+
.toast-progress { display: none; }
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.nesso-button, .nesso-input, .nesso-option { font-size: 13px; line-height: 20px; }
|
|
202
|
+
.nesso-section-heading { font-size: 11px; line-height: 16px; }
|
|
203
|
+
|
|
204
|
+
.nesso-field { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(160px, 236px); align-items: center; gap: 16px; }
|
|
205
|
+
.nesso-field > button:disabled { opacity: 1; color: var(--muted-foreground); background: var(--canvas); }
|
|
206
|
+
.nesso-field > label { font-size: 12px; }
|
|
207
|
+
.nesso-field-hint { margin-top: 6px; color: var(--muted-foreground); font-size: 11px; line-height: 16px; min-height: 16px; }
|
|
208
|
+
|
|
209
|
+
@media (max-width: 640px) {
|
|
210
|
+
.nesso-field { grid-template-columns: minmax(90px, 1fr) minmax(140px, 1.3fr); gap: 12px; }
|
|
211
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nesso-how/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-alpha.30",
|
|
4
|
+
"description": "Reusable React primitives and shared styles for Nesso, usable in the app and in isolated plugin panels",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/nesso-how/nesso.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./styles.css": "./dist/styles.css"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@base-ui/react": "^1.8.0",
|
|
29
|
+
"class-variance-authority": "^0.7.1",
|
|
30
|
+
"cn": "^0.4.0",
|
|
31
|
+
"lucide-react": "^1.48.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^19.2.8",
|
|
35
|
+
"react-dom": "^19.2.8"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/react": "^19.2.18",
|
|
39
|
+
"tsdown": "^0.23.1"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json && tsdown"
|
|
43
|
+
}
|
|
6
44
|
}
|