@brickclay-org/ui 0.1.70 → 0.1.72
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/fesm2022/brickclay-org-ui.mjs +991 -174
- package/fesm2022/brickclay-org-ui.mjs.map +1 -1
- package/index.d.ts +278 -24
- package/package.json +1 -1
- package/src/assets/icons/alert-circle-red.svg +12 -0
- package/src/lib/menu/menu.css +255 -0
- package/src/lib/tabs/tabs.css +22 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/* =========================================================================
|
|
2
|
+
bk-menu — simple responsive navigation menu.
|
|
3
|
+
Single light theme, matching the default bk-tabs styling:
|
|
4
|
+
text #141414, hover #EDEEF0, active #141414 bg with white text.
|
|
5
|
+
========================================================================= */
|
|
6
|
+
|
|
7
|
+
.bk-menu {
|
|
8
|
+
--menu-bg: #ffffff;
|
|
9
|
+
--menu-text: #141414;
|
|
10
|
+
--menu-subtext: #6b7080;
|
|
11
|
+
--menu-hover-bg: #edeef0;
|
|
12
|
+
--menu-hover-text: #141414;
|
|
13
|
+
--menu-active-bg: #141414;
|
|
14
|
+
--menu-active-text: #ffffff;
|
|
15
|
+
--menu-border: #efeff1;
|
|
16
|
+
--menu-shadow: 0 7px 18px 0 rgba(0, 0, 0, 0.09);
|
|
17
|
+
--menu-radius: 8px;
|
|
18
|
+
--menu-disabled: 0.5;
|
|
19
|
+
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
line-height: 1.25rem;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
letter-spacing: -0.28px;
|
|
26
|
+
background: var(--menu-bg);
|
|
27
|
+
color: var(--menu-text);
|
|
28
|
+
border: 1px solid var(--menu-border);
|
|
29
|
+
border-radius: var(--menu-radius);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Clip rounded corners for inline/default menus. Pop-up menus must NOT clip,
|
|
33
|
+
otherwise the fly-out panels get cut off at the menu's edge. */
|
|
34
|
+
.bk-menu:not(.bk-menu--popup) {
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Round the first/last top-level buttons in pop-up mode so the active/hover
|
|
39
|
+
background still respects the menu's corners without clipping fly-outs. */
|
|
40
|
+
.bk-menu--popup.bk-menu--vertical > .bk-menu__list > .bk-menu__item:first-child > .bk-menu__button {
|
|
41
|
+
border-radius: 8px 8px 0 0;
|
|
42
|
+
}
|
|
43
|
+
.bk-menu--popup.bk-menu--vertical > .bk-menu__list > .bk-menu__item:last-child > .bk-menu__button {
|
|
44
|
+
border-radius: 0 0 8px 8px;
|
|
45
|
+
}
|
|
46
|
+
.bk-menu--popup.bk-menu--horizontal > .bk-menu__list > .bk-menu__item:first-child > .bk-menu__button {
|
|
47
|
+
border-radius: 8px 0 0 8px;
|
|
48
|
+
}
|
|
49
|
+
.bk-menu--popup.bk-menu--horizontal > .bk-menu__list > .bk-menu__item:last-child > .bk-menu__button {
|
|
50
|
+
border-radius: 0 8px 8px 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ---- Lists ---- */
|
|
54
|
+
.bk-menu__list,
|
|
55
|
+
.bk-menu__submenu {
|
|
56
|
+
list-style: none;
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Horizontal top-level row (menubar). */
|
|
62
|
+
.bk-menu--horizontal > .bk-menu__list {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
align-items: stretch;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Scroll a crowded row only when NOT in pop-up mode — `overflow-x: auto`
|
|
69
|
+
forces `overflow-y` to `auto`, which would clip the drop-down fly-outs. */
|
|
70
|
+
.bk-menu--horizontal:not(.bk-menu--popup) > .bk-menu__list {
|
|
71
|
+
overflow-x: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ---- Item / button ---- */
|
|
75
|
+
.bk-menu__item {
|
|
76
|
+
position: relative; /* anchor for pop-up submenus */
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.bk-menu__button {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 8px;
|
|
83
|
+
width: 100%;
|
|
84
|
+
padding: 10px 12px;
|
|
85
|
+
margin: 0;
|
|
86
|
+
border: 0;
|
|
87
|
+
background: transparent;
|
|
88
|
+
color: inherit;
|
|
89
|
+
font: inherit;
|
|
90
|
+
letter-spacing: inherit;
|
|
91
|
+
text-align: left;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
border-radius: 6px;
|
|
95
|
+
transition: background 0.1s ease, color 0.1s ease;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button {
|
|
99
|
+
width: auto;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.bk-menu__button:hover:not(:disabled):not(.bk-menu__button--active) {
|
|
103
|
+
background: var(--menu-hover-bg);
|
|
104
|
+
color: var(--menu-hover-text);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bk-menu__button--active {
|
|
108
|
+
background: var(--menu-active-bg);
|
|
109
|
+
color: var(--menu-active-text);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.bk-menu__button--disabled,
|
|
113
|
+
.bk-menu__button:disabled {
|
|
114
|
+
opacity: var(--menu-disabled);
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Nested (child) items use the muted sub-text colour. */
|
|
119
|
+
.bk-menu__submenu .bk-menu__button {
|
|
120
|
+
color: var(--menu-subtext);
|
|
121
|
+
font-weight: 400;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.bk-menu__submenu .bk-menu__button--active {
|
|
125
|
+
color: var(--menu-active-text);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* ---- Icon (optional). Tinted monochrome when .bk-menu--tint. ---- */
|
|
129
|
+
.bk-menu__icon {
|
|
130
|
+
width: 16px;
|
|
131
|
+
height: 16px;
|
|
132
|
+
flex-shrink: 0;
|
|
133
|
+
object-fit: contain;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.bk-menu--tint .bk-menu__icon {
|
|
137
|
+
filter: brightness(0) saturate(0); /* → near-black, matches #141414 text */
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Active row has a dark background → force a white icon for contrast. */
|
|
141
|
+
.bk-menu--tint .bk-menu__button--active .bk-menu__icon {
|
|
142
|
+
filter: brightness(0) invert(1);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bk-menu__label {
|
|
146
|
+
flex: 1 1 auto;
|
|
147
|
+
min-width: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button > .bk-menu__label {
|
|
151
|
+
flex: 0 0 auto;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* ---- Chevron ---- */
|
|
155
|
+
.bk-menu__chevron {
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
transition: transform 0.18s ease;
|
|
158
|
+
opacity: 0.8;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Inline: rotate down → up on open. */
|
|
162
|
+
.bk-menu__chevron--open {
|
|
163
|
+
transform: rotate(180deg);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Pop-up fly-out: static caret pointing to where the panel opens (right). */
|
|
167
|
+
.bk-menu__chevron--right {
|
|
168
|
+
transform: rotate(-90deg);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* =========================================================================
|
|
172
|
+
Inline submenus (accordion) — expand in place.
|
|
173
|
+
========================================================================= */
|
|
174
|
+
.bk-menu__submenu--inline {
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
max-height: 0;
|
|
177
|
+
transition: max-height 0.2s ease;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.bk-menu__submenu--inline.bk-menu__submenu--open {
|
|
181
|
+
max-height: 1000px; /* large enough to reveal nested content */
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* =========================================================================
|
|
185
|
+
Pop-up submenus — floating panels, hidden until open.
|
|
186
|
+
========================================================================= */
|
|
187
|
+
.bk-menu__submenu--popup {
|
|
188
|
+
position: absolute;
|
|
189
|
+
z-index: 50;
|
|
190
|
+
min-width: 200px;
|
|
191
|
+
background: var(--menu-bg);
|
|
192
|
+
border: 1px solid var(--menu-border);
|
|
193
|
+
border-radius: 12px;
|
|
194
|
+
box-shadow: var(--menu-shadow);
|
|
195
|
+
padding: 4px;
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.bk-menu__submenu--popup.bk-menu__submenu--open {
|
|
200
|
+
display: block;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Fly out to the right (vertical menus and all deeper levels). */
|
|
204
|
+
.bk-menu__submenu--popup-right {
|
|
205
|
+
top: 0;
|
|
206
|
+
left: 100%;
|
|
207
|
+
margin-left: 4px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Drop down below (horizontal top-level items). */
|
|
211
|
+
.bk-menu__submenu--popup-down {
|
|
212
|
+
top: 100%;
|
|
213
|
+
left: 0;
|
|
214
|
+
margin-top: 4px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Invisible bridges spanning the gap between a parent and its fly-out, so the
|
|
218
|
+
pointer stays "inside" the item while crossing — prevents hover flicker. */
|
|
219
|
+
.bk-menu__submenu--popup-right::before {
|
|
220
|
+
content: '';
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: 0;
|
|
223
|
+
left: -6px;
|
|
224
|
+
width: 6px;
|
|
225
|
+
height: 100%;
|
|
226
|
+
}
|
|
227
|
+
.bk-menu__submenu--popup-down::before {
|
|
228
|
+
content: '';
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: -6px;
|
|
231
|
+
left: 0;
|
|
232
|
+
width: 100%;
|
|
233
|
+
height: 6px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* =========================================================================
|
|
237
|
+
Responsive: stack a horizontal menu into a vertical one on small screens.
|
|
238
|
+
========================================================================= */
|
|
239
|
+
@media (max-width: 640px) {
|
|
240
|
+
.bk-menu--horizontal > .bk-menu__list {
|
|
241
|
+
flex-direction: column;
|
|
242
|
+
overflow-x: visible;
|
|
243
|
+
}
|
|
244
|
+
.bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button {
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
/* On small screens, horizontal pop-ups behave like inline sections. */
|
|
248
|
+
.bk-menu--horizontal .bk-menu__submenu--popup-down {
|
|
249
|
+
position: static;
|
|
250
|
+
box-shadow: none;
|
|
251
|
+
border: 0;
|
|
252
|
+
margin: 0;
|
|
253
|
+
border-radius: 0;
|
|
254
|
+
}
|
|
255
|
+
}
|
package/src/lib/tabs/tabs.css
CHANGED
|
@@ -121,6 +121,28 @@
|
|
|
121
121
|
color: #15191E;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/* Segmented error pill — an icon alone reads too subtly here, so give the pill
|
|
125
|
+
a red tint, border and text. Placed after the base/active segmented rules so
|
|
126
|
+
it wins on equal specificity; the active+error combo uses 3 classes to win. */
|
|
127
|
+
.tabs-button--segmented.tabs-button--error {
|
|
128
|
+
background: #FEE2E2;
|
|
129
|
+
border-color: #FCA5A5;
|
|
130
|
+
color: #C10007;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.tabs-button--segmented.tabs-button--error.tabs-button--active {
|
|
134
|
+
background: #FFFFFF;
|
|
135
|
+
border-color: #C10007;
|
|
136
|
+
color: #C10007;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Keep the error look on hover (the generic pill hover would otherwise win). */
|
|
140
|
+
.tabs-button--segmented.tabs-button--error:hover:not(:disabled):not(.tabs-button--active) {
|
|
141
|
+
background: #FEE2E2;
|
|
142
|
+
border-color: #C10007;
|
|
143
|
+
color: #C10007;
|
|
144
|
+
}
|
|
145
|
+
|
|
124
146
|
/* Segmented + vertical: single-column grid = stacked full-width pills.
|
|
125
147
|
Placed after the base segmented rules so it wins on equal specificity. */
|
|
126
148
|
.tabs-list--segmented-vertical {
|
|
@@ -132,4 +154,3 @@
|
|
|
132
154
|
@apply justify-start text-left;
|
|
133
155
|
}
|
|
134
156
|
|
|
135
|
-
/* Testing */
|