@robosophy/ui-react 1.0.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/AGENTS.md +86 -0
- package/README.md +197 -0
- package/dist/RsIcon.types-eBKVmRTF.d.ts +23 -0
- package/dist/chunk-AEWPQXHG.js +405 -0
- package/dist/chunk-D4ZW5VUU.js +12 -0
- package/dist/chunk-PEJOAJYL.js +115 -0
- package/dist/components/RsIcon/index.css +49 -0
- package/dist/components/RsIcon/index.d.ts +10 -0
- package/dist/components/RsIcon/index.js +10 -0
- package/dist/components/RsSidebar/index.css +360 -0
- package/dist/components/RsSidebar/index.d.ts +60 -0
- package/dist/components/RsSidebar/index.js +9 -0
- package/dist/index.css +360 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +14 -0
- package/dist/vite.d.ts +27 -0
- package/dist/vite.js +1026 -0
- package/package.json +82 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/* src/components/RsSidebar/RsSidebar.css */
|
|
2
|
+
.rs-sidebar {
|
|
3
|
+
--rs-sidebar-background: var(--rs-color-surface-primary, #ffffff);
|
|
4
|
+
--rs-sidebar-border: var(--rs-color-stroke-default, #d1d1d1);
|
|
5
|
+
--rs-sidebar-color: var(--rs-color-text-primary, #000000);
|
|
6
|
+
--rs-sidebar-muted: var(--rs-color-text-secondary, #909090);
|
|
7
|
+
--rs-sidebar-active: var(--rs-color-text-button-tertiary, #48a0d4);
|
|
8
|
+
--rs-sidebar-hover: var(--rs-color-button-blue-surface, #e6f6fb);
|
|
9
|
+
--rs-sidebar-width-collapsed: 75px;
|
|
10
|
+
--rs-sidebar-width-expanded: 286px;
|
|
11
|
+
background: var(--rs-sidebar-background);
|
|
12
|
+
border-right: 1px solid var(--rs-sidebar-border);
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
color: var(--rs-sidebar-color);
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
font-family: var(--rs-font-family, "Inter", sans-serif);
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
gap: 52px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
transition: width 0.3s ease-in-out;
|
|
25
|
+
will-change: width;
|
|
26
|
+
width: var(--rs-sidebar-width-collapsed);
|
|
27
|
+
}
|
|
28
|
+
.rs-sidebar--pc {
|
|
29
|
+
--rs-sidebar-active: var(--rs-color-icon-project-pc, #014a9f);
|
|
30
|
+
--rs-sidebar-hover: var(--rs-color-darkblue-100, #e5ecf5);
|
|
31
|
+
}
|
|
32
|
+
.rs-sidebar--alta {
|
|
33
|
+
--rs-sidebar-active: var(--rs-color-icon-project-alta, #65ac1e);
|
|
34
|
+
--rs-sidebar-hover: var(--rs-color-green-100, #edf7e6);
|
|
35
|
+
}
|
|
36
|
+
.rs-sidebar--cc {
|
|
37
|
+
--rs-sidebar-active: var(--rs-color-icon-project-cc, #49a0d4);
|
|
38
|
+
--rs-sidebar-hover: var(--rs-color-blue-100, #e6f6fb);
|
|
39
|
+
}
|
|
40
|
+
.rs-sidebar--pog {
|
|
41
|
+
--rs-sidebar-active: var(--rs-color-icon-project-pog, #007c2f);
|
|
42
|
+
--rs-sidebar-hover: var(--rs-color-navygreen-100, #e5f1ea);
|
|
43
|
+
}
|
|
44
|
+
.rs-sidebar--cyo {
|
|
45
|
+
--rs-sidebar-active: var(--rs-color-icon-project-cyo, #49a0d4);
|
|
46
|
+
--rs-sidebar-hover: var(--rs-color-blue-100, #e6f6fb);
|
|
47
|
+
}
|
|
48
|
+
.rs-sidebar--expanded,
|
|
49
|
+
.rs-sidebar--mobile-open {
|
|
50
|
+
overflow: visible;
|
|
51
|
+
width: var(--rs-sidebar-width-expanded);
|
|
52
|
+
}
|
|
53
|
+
.rs-sidebar__header {
|
|
54
|
+
align-items: center;
|
|
55
|
+
position: relative;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: 10px;
|
|
59
|
+
justify-content: flex-start;
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
.rs-sidebar__brand {
|
|
63
|
+
align-items: center;
|
|
64
|
+
display: flex;
|
|
65
|
+
color: var(--rs-sidebar-active);
|
|
66
|
+
flex: 1;
|
|
67
|
+
gap: 10px;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
padding: 32px 24px;
|
|
70
|
+
}
|
|
71
|
+
.rs-sidebar__module-trigger {
|
|
72
|
+
align-items: center;
|
|
73
|
+
background: transparent;
|
|
74
|
+
border: 0;
|
|
75
|
+
color: inherit;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
justify-content: flex-start;
|
|
79
|
+
font: inherit;
|
|
80
|
+
gap: 10px;
|
|
81
|
+
min-width: 0;
|
|
82
|
+
appearance: none;
|
|
83
|
+
-webkit-appearance: none;
|
|
84
|
+
padding: 0;
|
|
85
|
+
text-align: left;
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
.rs-sidebar__module-trigger:hover:not(:disabled),
|
|
89
|
+
.rs-sidebar__module-trigger:active:not(:disabled) {
|
|
90
|
+
background: transparent;
|
|
91
|
+
color: inherit;
|
|
92
|
+
}
|
|
93
|
+
.rs-sidebar__module-trigger:focus-visible {
|
|
94
|
+
outline: 2px solid var(--rs-color-stroke-focused, #48a0d4);
|
|
95
|
+
outline-offset: 2px;
|
|
96
|
+
}
|
|
97
|
+
.rs-sidebar--expanded .rs-sidebar__module-chevron,
|
|
98
|
+
.rs-sidebar--mobile-open .rs-sidebar__module-chevron {
|
|
99
|
+
margin-left: auto;
|
|
100
|
+
}
|
|
101
|
+
.rs-sidebar__module-trigger > .rs-icon:first-child {
|
|
102
|
+
margin-left: 0;
|
|
103
|
+
}
|
|
104
|
+
.rs-sidebar__brand > .rs-icon:first-child {
|
|
105
|
+
margin-left: 0;
|
|
106
|
+
}
|
|
107
|
+
.rs-sidebar__title,
|
|
108
|
+
.rs-sidebar__item-label,
|
|
109
|
+
.rs-sidebar__item-chevron,
|
|
110
|
+
.rs-sidebar__module-chevron {
|
|
111
|
+
max-width: 0;
|
|
112
|
+
opacity: 0;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
transition: max-width 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
}
|
|
117
|
+
.rs-sidebar--expanded .rs-sidebar__title,
|
|
118
|
+
.rs-sidebar--expanded .rs-sidebar__item-label,
|
|
119
|
+
.rs-sidebar--expanded .rs-sidebar__item-chevron,
|
|
120
|
+
.rs-sidebar--expanded .rs-sidebar__module-chevron,
|
|
121
|
+
.rs-sidebar--mobile-open .rs-sidebar__title,
|
|
122
|
+
.rs-sidebar--mobile-open .rs-sidebar__item-label,
|
|
123
|
+
.rs-sidebar--mobile-open .rs-sidebar__item-chevron,
|
|
124
|
+
.rs-sidebar--mobile-open .rs-sidebar__module-chevron {
|
|
125
|
+
max-width: 220px;
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
.rs-sidebar__title {
|
|
129
|
+
color: var(--rs-sidebar-color);
|
|
130
|
+
font-family: var(--rs-font-family, "Inter", sans-serif);
|
|
131
|
+
font-weight: 400;
|
|
132
|
+
line-height: 1;
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
}
|
|
135
|
+
.rs-sidebar__module-menu.p-menu {
|
|
136
|
+
background: var(--rs-sidebar-background);
|
|
137
|
+
border: 1px solid var(--rs-sidebar-border);
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
|
|
140
|
+
left: 16px;
|
|
141
|
+
min-width: calc(var(--rs-sidebar-width-expanded) - 32px);
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
padding: 0;
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 88px;
|
|
146
|
+
z-index: 20;
|
|
147
|
+
}
|
|
148
|
+
.rs-sidebar__module-menu .p-menu-list {
|
|
149
|
+
gap: 0;
|
|
150
|
+
padding: 0;
|
|
151
|
+
}
|
|
152
|
+
.rs-sidebar__module-option .p-menu-item-content {
|
|
153
|
+
color: var(--rs-sidebar-color);
|
|
154
|
+
border-radius: 0;
|
|
155
|
+
}
|
|
156
|
+
.rs-sidebar__module-option .p-menu-item-link {
|
|
157
|
+
font-family: inherit;
|
|
158
|
+
font-size: inherit;
|
|
159
|
+
line-height: 1;
|
|
160
|
+
min-height: 38px;
|
|
161
|
+
padding: 10px 14px;
|
|
162
|
+
}
|
|
163
|
+
.rs-sidebar__module-option:not(.p-disabled) .p-menu-item-content:hover,
|
|
164
|
+
.rs-sidebar__module-option--active .p-menu-item-content {
|
|
165
|
+
background: var(--rs-sidebar-hover);
|
|
166
|
+
color: var(--rs-sidebar-color);
|
|
167
|
+
}
|
|
168
|
+
.rs-sidebar__module-option--disabled .p-menu-item-content {
|
|
169
|
+
color: var(--rs-sidebar-muted);
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
.rs-sidebar__module-option--disabled .p-menu-item-content:hover {
|
|
173
|
+
background: transparent;
|
|
174
|
+
}
|
|
175
|
+
.rs-sidebar__module-option.p-focus .p-menu-item-content {
|
|
176
|
+
background: var(--rs-sidebar-hover);
|
|
177
|
+
color: var(--rs-sidebar-color);
|
|
178
|
+
}
|
|
179
|
+
.rs-sidebar__module-option.p-focus .p-menu-item-link {
|
|
180
|
+
outline: 2px solid var(--rs-color-stroke-focused, #48a0d4);
|
|
181
|
+
outline-offset: -2px;
|
|
182
|
+
}
|
|
183
|
+
.rs-sidebar__header-button {
|
|
184
|
+
align-items: center;
|
|
185
|
+
background: transparent;
|
|
186
|
+
border: 0;
|
|
187
|
+
border-radius: 999px;
|
|
188
|
+
color: var(--rs-color-icon-secondary, #000000);
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
display: inline-flex;
|
|
191
|
+
flex: 0 0 auto;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
appearance: none;
|
|
194
|
+
-webkit-appearance: none;
|
|
195
|
+
min-height: 24px;
|
|
196
|
+
min-width: 24px;
|
|
197
|
+
padding: 2px;
|
|
198
|
+
}
|
|
199
|
+
.rs-sidebar .rs-sidebar__header-button:hover:not(:disabled),
|
|
200
|
+
.rs-sidebar .rs-sidebar__header-button:active:not(:disabled) {
|
|
201
|
+
background: var(--rs-sidebar-hover);
|
|
202
|
+
color: var(--rs-color-icon-secondary, #000000);
|
|
203
|
+
}
|
|
204
|
+
.rs-sidebar__header-button:focus-visible,
|
|
205
|
+
.rs-sidebar__item:focus-visible {
|
|
206
|
+
outline: 2px solid var(--rs-color-stroke-focused, #48a0d4);
|
|
207
|
+
outline-offset: -2px;
|
|
208
|
+
}
|
|
209
|
+
.rs-sidebar__content {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
flex: 1;
|
|
213
|
+
min-height: 0;
|
|
214
|
+
}
|
|
215
|
+
.rs-sidebar__nav {
|
|
216
|
+
flex: 1;
|
|
217
|
+
min-height: 0;
|
|
218
|
+
}
|
|
219
|
+
.rs-sidebar__list {
|
|
220
|
+
list-style: none;
|
|
221
|
+
margin: 0;
|
|
222
|
+
padding: 0;
|
|
223
|
+
}
|
|
224
|
+
.rs-sidebar__item {
|
|
225
|
+
align-items: center;
|
|
226
|
+
background: transparent;
|
|
227
|
+
border: 0;
|
|
228
|
+
border-right: 4px solid transparent;
|
|
229
|
+
box-sizing: border-box;
|
|
230
|
+
color: var(--rs-sidebar-active);
|
|
231
|
+
cursor: pointer;
|
|
232
|
+
display: flex;
|
|
233
|
+
justify-content: flex-start;
|
|
234
|
+
font: inherit;
|
|
235
|
+
font-weight: 300;
|
|
236
|
+
gap: 10px;
|
|
237
|
+
appearance: none;
|
|
238
|
+
-webkit-appearance: none;
|
|
239
|
+
padding: 10px 24px;
|
|
240
|
+
text-align: left;
|
|
241
|
+
width: 100%;
|
|
242
|
+
}
|
|
243
|
+
.rs-sidebar .rs-sidebar__item:not(.rs-sidebar__item--footer):hover:not(:disabled),
|
|
244
|
+
.rs-sidebar .rs-sidebar__item:not(.rs-sidebar__item--footer):active:not(:disabled) {
|
|
245
|
+
background: var(--rs-sidebar-hover);
|
|
246
|
+
}
|
|
247
|
+
.rs-sidebar__item:disabled {
|
|
248
|
+
color: var(--rs-sidebar-muted);
|
|
249
|
+
cursor: not-allowed;
|
|
250
|
+
opacity: 1;
|
|
251
|
+
}
|
|
252
|
+
.rs-sidebar .rs-sidebar__item--active {
|
|
253
|
+
background: var(--rs-sidebar-hover);
|
|
254
|
+
border-right-color: var(--rs-sidebar-active);
|
|
255
|
+
}
|
|
256
|
+
.rs-sidebar__footer {
|
|
257
|
+
align-items: center;
|
|
258
|
+
display: flex;
|
|
259
|
+
margin-top: 52px;
|
|
260
|
+
}
|
|
261
|
+
.rs-sidebar__item--footer {
|
|
262
|
+
color: var(--rs-sidebar-color);
|
|
263
|
+
padding: 32px 24px;
|
|
264
|
+
}
|
|
265
|
+
.rs-sidebar__item--footer .rs-icon {
|
|
266
|
+
color: inherit;
|
|
267
|
+
}
|
|
268
|
+
.rs-sidebar__item-icon {
|
|
269
|
+
flex: 0 0 auto;
|
|
270
|
+
color: var(--rs-sidebar-active);
|
|
271
|
+
margin-left: 0;
|
|
272
|
+
width: 24px;
|
|
273
|
+
height: 24px;
|
|
274
|
+
}
|
|
275
|
+
.rs-sidebar__brand .rs-icon {
|
|
276
|
+
width: 24px;
|
|
277
|
+
height: 24px;
|
|
278
|
+
}
|
|
279
|
+
.rs-sidebar__item-label {
|
|
280
|
+
color: var(--rs-sidebar-color);
|
|
281
|
+
font-family: var(--rs-font-family, "Inter", sans-serif);
|
|
282
|
+
min-width: 0;
|
|
283
|
+
text-overflow: ellipsis;
|
|
284
|
+
}
|
|
285
|
+
.rs-sidebar__item-chevron {
|
|
286
|
+
margin-left: auto;
|
|
287
|
+
}
|
|
288
|
+
.rs-sidebar--mobile-open {
|
|
289
|
+
border-right: 0;
|
|
290
|
+
bottom: 0;
|
|
291
|
+
gap: clamp(8px, 4vh, 52px);
|
|
292
|
+
left: 0;
|
|
293
|
+
position: fixed;
|
|
294
|
+
right: 0;
|
|
295
|
+
top: 0;
|
|
296
|
+
width: 100%;
|
|
297
|
+
z-index: 10000;
|
|
298
|
+
}
|
|
299
|
+
.rs-sidebar--mobile-open .rs-sidebar__module-menu {
|
|
300
|
+
left: 16px;
|
|
301
|
+
min-width: min(320px, calc(100% - 32px));
|
|
302
|
+
top: 88px;
|
|
303
|
+
}
|
|
304
|
+
.rs-sidebar--mobile-open .rs-sidebar__item {
|
|
305
|
+
font-size: 16px;
|
|
306
|
+
padding: 20px 24px;
|
|
307
|
+
}
|
|
308
|
+
.rs-sidebar--mobile-open .rs-sidebar__item--footer {
|
|
309
|
+
padding: 32px 24px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* src/components/RsIcon/RsIcon.css */
|
|
313
|
+
.rs-icon {
|
|
314
|
+
align-items: center;
|
|
315
|
+
color: var(--rs-icon-color, currentColor);
|
|
316
|
+
display: inline-flex;
|
|
317
|
+
flex: 0 0 auto;
|
|
318
|
+
flex-shrink: 0;
|
|
319
|
+
height: var(--rs-icon-size, 24px);
|
|
320
|
+
justify-content: center;
|
|
321
|
+
user-select: none;
|
|
322
|
+
width: var(--rs-icon-size, 24px);
|
|
323
|
+
}
|
|
324
|
+
.rs-icon--interactive {
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
}
|
|
327
|
+
.rs-icon--primary {
|
|
328
|
+
color: var(--rs-color-icon-primary, #48a0d4);
|
|
329
|
+
}
|
|
330
|
+
.rs-icon--secondary {
|
|
331
|
+
color: var(--rs-color-icon-secondary, #000000);
|
|
332
|
+
}
|
|
333
|
+
.rs-icon--success {
|
|
334
|
+
color: var(--rs-color-icon-success, #4EAE01);
|
|
335
|
+
}
|
|
336
|
+
.rs-icon--warning {
|
|
337
|
+
color: var(--rs-color-icon-warning, #FF9001);
|
|
338
|
+
}
|
|
339
|
+
.rs-icon--danger {
|
|
340
|
+
color: var(--rs-color-icon-danger, #d80115);
|
|
341
|
+
}
|
|
342
|
+
.rs-icon--inherit {
|
|
343
|
+
color: currentColor;
|
|
344
|
+
}
|
|
345
|
+
.rs-icon-wrap {
|
|
346
|
+
position: relative;
|
|
347
|
+
display: inline-flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
vertical-align: middle;
|
|
351
|
+
}
|
|
352
|
+
.rs-icon__notification {
|
|
353
|
+
position: absolute;
|
|
354
|
+
top: 0;
|
|
355
|
+
right: 0;
|
|
356
|
+
width: 10px;
|
|
357
|
+
height: 10px;
|
|
358
|
+
border-radius: 50%;
|
|
359
|
+
background-color: var(--rs-color-yellow-500, #ff9001);
|
|
360
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// AUTO-GENERATED FILE. DO NOT EDIT MANUALLY.
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
type RsSidebarVariant = "pc" | "alta" | "cc" | "pog" | "cyo";
|
|
6
|
+
type RsSidebarModule = {
|
|
7
|
+
text: string;
|
|
8
|
+
link: string;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type RsSidebarItem = {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
visible?: boolean;
|
|
19
|
+
children?: RsSidebarItem[];
|
|
20
|
+
};
|
|
21
|
+
type RsSidebarProps = {
|
|
22
|
+
items: RsSidebarItem[];
|
|
23
|
+
footerItems?: RsSidebarItem[];
|
|
24
|
+
modules?: RsSidebarModule[];
|
|
25
|
+
navigateOnModuleSelect?: boolean;
|
|
26
|
+
title?: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
expanded?: boolean;
|
|
29
|
+
expandOnHover?: boolean;
|
|
30
|
+
mobileOpen?: boolean;
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
variant?: RsSidebarVariant;
|
|
33
|
+
onItemClick?: (item: RsSidebarItem) => void;
|
|
34
|
+
onCloseMobile?: () => void;
|
|
35
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
36
|
+
onModuleSelect?: (module: RsSidebarModule) => void;
|
|
37
|
+
header?: ReactNode | ((props: RsSidebarHeaderSlotProps) => ReactNode);
|
|
38
|
+
headerAction?: ReactNode | ((props: RsSidebarHeaderActionSlotProps) => ReactNode);
|
|
39
|
+
renderItem?: (item: RsSidebarItem, expanded: boolean) => ReactNode;
|
|
40
|
+
footer?: ReactNode | ((props: RsSidebarFooterSlotProps) => ReactNode);
|
|
41
|
+
};
|
|
42
|
+
type RsSidebarHeaderSlotProps = {
|
|
43
|
+
expanded: boolean;
|
|
44
|
+
activeParent: RsSidebarItem | null;
|
|
45
|
+
closeMobile: () => void;
|
|
46
|
+
goBack: () => void;
|
|
47
|
+
};
|
|
48
|
+
type RsSidebarHeaderActionSlotProps = {
|
|
49
|
+
activeParent: RsSidebarItem | null;
|
|
50
|
+
closeMobile: () => void;
|
|
51
|
+
goBack: () => void;
|
|
52
|
+
};
|
|
53
|
+
type RsSidebarFooterSlotProps = {
|
|
54
|
+
items: RsSidebarItem[];
|
|
55
|
+
expanded: boolean;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare const RsSidebar: react.ForwardRefExoticComponent<RsSidebarProps & react.RefAttributes<HTMLElement>>;
|
|
59
|
+
|
|
60
|
+
export { type RsSidebarFooterSlotProps, type RsSidebarHeaderActionSlotProps, type RsSidebarHeaderSlotProps, type RsSidebarItem, type RsSidebarModule, type RsSidebarProps, type RsSidebarVariant, RsSidebar as default };
|