@brickclay-org/ui 0.1.92 → 0.1.94

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.1.92",
3
+ "version": "0.1.94",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -0,0 +1,11 @@
1
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_256_95)">
3
+ <path d="M10.9997 10.9301C10.8123 11.1163 10.5589 11.2209 10.2947 11.2209C10.0305 11.2209 9.77707 11.1163 9.5897 10.9301L1.0497 2.49009C0.955976 2.39713 0.881582 2.28653 0.830813 2.16467C0.780044 2.04281 0.753906 1.9121 0.753906 1.78009C0.753906 1.64808 0.780044 1.51737 0.830813 1.39551C0.881582 1.27365 0.955976 1.16305 1.0497 1.07009C1.23707 0.883839 1.49052 0.779297 1.7547 0.779297C2.01889 0.779297 2.27234 0.883839 2.4597 1.07009L10.9997 9.51009C11.0934 9.60305 11.1678 9.71365 11.2186 9.83551C11.2694 9.95737 11.2955 10.0881 11.2955 10.2201C11.2955 10.3521 11.2694 10.4828 11.2186 10.6047C11.1678 10.7265 11.0934 10.8371 10.9997 10.9301Z" fill="white"/>
4
+ <path d="M2.45845 11.0007C2.2675 11.1943 2.00745 11.3041 1.73553 11.306C1.4636 11.3078 1.20206 11.2016 1.00845 11.0107C0.814846 10.8197 0.705025 10.5597 0.703149 10.2877C0.701274 10.0158 0.807498 9.75425 0.998454 9.56064L9.53845 1.00064C9.72941 0.807034 9.98945 0.697212 10.2614 0.695337C10.5333 0.693461 10.7948 0.799686 10.9885 0.990641C11.1821 1.1816 11.2919 1.44164 11.2938 1.71357C11.2956 1.9855 11.1894 2.24704 10.9985 2.44064L2.45845 11.0007Z" fill="white"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="clip0_256_95">
8
+ <rect width="12" height="12" fill="white"/>
9
+ </clipPath>
10
+ </defs>
11
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.9997 10.9301C10.8123 11.1163 10.5589 11.2209 10.2947 11.2209C10.0305 11.2209 9.77707 11.1163 9.5897 10.9301L1.0497 2.49009C0.955976 2.39713 0.881582 2.28653 0.830813 2.16467C0.780044 2.04281 0.753906 1.9121 0.753906 1.78009C0.753906 1.64808 0.780044 1.51737 0.830813 1.39551C0.881582 1.27365 0.955976 1.16305 1.0497 1.07009C1.23707 0.883839 1.49052 0.779297 1.7547 0.779297C2.01889 0.779297 2.27234 0.883839 2.4597 1.07009L10.9997 9.51009C11.0934 9.60305 11.1678 9.71365 11.2186 9.83551C11.2694 9.95737 11.2955 10.0881 11.2955 10.2201C11.2955 10.3521 11.2694 10.4828 11.2186 10.6047C11.1678 10.7265 11.0934 10.8371 10.9997 10.9301Z" fill="#A1A5B7"/>
3
+ <path d="M2.45845 11.0002C2.2675 11.1938 2.00745 11.3036 1.73553 11.3055C1.4636 11.3073 1.20206 11.2011 1.00845 11.0102C0.814846 10.8192 0.705025 10.5592 0.703149 10.2872C0.701274 10.0153 0.807498 9.75376 0.998454 9.56015L9.53845 1.00015C9.72941 0.806546 9.98945 0.696724 10.2614 0.694849C10.5333 0.692973 10.7948 0.799198 10.9885 0.990153C11.1821 1.18111 11.2919 1.44115 11.2938 1.71308C11.2956 1.98501 11.1894 2.24655 10.9985 2.44015L2.45845 11.0002Z" fill="#A1A5B7"/>
4
+ </svg>
@@ -0,0 +1,342 @@
1
+ /* =====================================================================
2
+ bk-kanban
3
+
4
+ Visual language matches bk-table / bk-grid: #EBEDF3 rules, #F9FAFA header
5
+ fill, #15191E / #60646C text, 0.75rem corners. WIP-limit feedback reuses
6
+ Tailwind's amber-* scale — the same family table-demo already reaches for
7
+ on its tree-drag refusal message — rather than inventing a new warning
8
+ color for this one control.
9
+
10
+ Styles are global (ViewEncapsulation.None): `cardTemplate`'s content is
11
+ projected in from the consumer and never carries this component's scope
12
+ attribute, so column/card chrome has to be reachable without it. Every
13
+ class is namespaced `bk-kanban-` to keep that safe.
14
+ ===================================================================== */
15
+
16
+ .bk-kanban-host {
17
+ display: block;
18
+ height: 100%;
19
+ }
20
+
21
+ /* ---------- Board ----------
22
+
23
+ Three nested boxes now, each with exactly one job:
24
+
25
+ .bk-kanban-host — structural passthrough only (above). Never styled.
26
+ .bk-kanban-board — `boardClass` lands here. Purely decorative: a
27
+ background, a border, padding around the whole
28
+ board. Never scrolls, never sized by CDK.
29
+ .bk-kanban — the scroll container. Holds every column, owns
30
+ `overflow-x`/`overflow-y`, and is what
31
+ `cdkDropList` (column reordering) attaches to.
32
+
33
+ Collapsing `boardClass` onto the same box that scrolls was the bug this
34
+ split fixes: a consumer's `padding` became part of what had to be
35
+ scrolled past, and the scrollbar itself ended up sitting inside that
36
+ padding instead of at the board's true content edge. Keeping
37
+ `.bk-kanban-board` between `boardClass` and the scrolling box means
38
+ nothing a consumer passes in can ever change *which* element owns
39
+ scrolling, or where its scrollbar sits — `.bk-kanban` fills
40
+ `.bk-kanban-board`'s content box (`w-full h-full`, below), correctly
41
+ inset by whatever padding/border `boardClass` added, and scrolls entirely
42
+ on its own from there.
43
+
44
+ `:where(...)` here (and on `.bk-kanban-column`/`.bk-kanban-column-header`
45
+ below) drops this rule's specificity to zero — Angular injects this
46
+ component's own stylesheet *after* the app's global Tailwind bundle, so
47
+ without it a same-specificity utility class passed through `boardClass`
48
+ would lose to whatever's declared here regardless of source order (a
49
+ plain class selector always beats a zero-specificity one, load order
50
+ doesn't matter). Wrapping the *base* rule instead of fighting that with
51
+ `!important` means any class `boardClass` supplies just wins outright,
52
+ no per-property workaround needed. */
53
+ :where(.bk-kanban-board) {
54
+ display: block;
55
+ height: 100%;
56
+ }
57
+
58
+ /* `height: 100%` resolves against whatever the host was given: a container
59
+ with an explicit height (e.g. `class="h-[calc(100vh-200px)]"` on
60
+ <bk-kanban>) makes the board itself bounded; against an auto-height
61
+ ancestor it computes as auto instead (ordinary CSS behaviour for a
62
+ percentage height), so the board just grows with its content when nothing
63
+ constrains it. No JS measurement needed either way.
64
+
65
+ `overflow-x: auto` is what makes the board responsive on its own — always
66
+ on, regardless of `columnScrollMode` — and stays on `.bk-kanban` in both
67
+ modes: columns never shrink below their own min-width, so a narrow
68
+ viewport (or ten columns' worth of width) scrolls the row horizontally
69
+ (the standard kanban pattern) rather than squeezing every column
70
+ unreadably thin. `columnScrollMode` only ever decides where the *vertical*
71
+ scroll lives.
72
+
73
+ `items-stretch` is what makes `columnScrollMode: 'body'` (the default,
74
+ see below) actually work rather than being aspirational: every column
75
+ stretches to fill `.bk-kanban`'s own cross-axis size, so once that size is
76
+ *definite* (host given an explicit height) each column is bounded too,
77
+ and `.bk-kanban-column-body`'s own `overflow-y: auto` has something to
78
+ clip against. `.bk-kanban--scroll-wrapper` (also below) overrides this for
79
+ `'wrapper'` mode, where columns go back to their own natural height and
80
+ the board handles scrolling instead. */
81
+ .bk-kanban {
82
+ @apply flex items-stretch gap-4 w-full h-full overflow-x-auto;
83
+ scroll-snap-type: x proximity;
84
+ }
85
+
86
+ /* `columnScrollMode: 'wrapper'` (`BkKanbanColumnScrollMode`) — moves
87
+ vertical scrolling from each column's own body up to the board itself, so
88
+ every column (header *and* body, all of them, together) scrolls as one
89
+ region instead of each column scrolling independently. `align-items:
90
+ flex-start` undoes the stretch above: columns no longer need bounding
91
+ individually now that the board itself is the bounded, scrollable one.
92
+ `overflow-x` stays `auto` (inherited from `.bk-kanban` — nothing here
93
+ touches it), so horizontal scrolling across columns keeps working exactly
94
+ as it does in `'body'` mode; this box just scrolls on both axes now. */
95
+ .bk-kanban--scroll-wrapper {
96
+ align-items: flex-start;
97
+ overflow-y: auto;
98
+ }
99
+
100
+ /* Columns are naturally-sized in this mode (no `items-stretch` to fill), so
101
+ a column's own body never actually has surplus space to overflow into —
102
+ this is mostly documentation of that fact rather than a fix for a real
103
+ collision, kept explicit so nobody re-adds a per-column scrollbar here by
104
+ accident later. */
105
+ .bk-kanban--scroll-wrapper .bk-kanban-column-body {
106
+ overflow-y: visible;
107
+ }
108
+
109
+ /* ---------- Column ---------- */
110
+
111
+ /*
112
+ `:where(...)` — see `.bk-kanban-board`'s own comment above for why. A
113
+ plain `columnClass="bg-red-500"` (or `border-2 border-red-500`,
114
+ `rounded-none`, anything this rule also declares) now reliably wins, the
115
+ same as it always did for properties this rule *doesn't* touch.
116
+
117
+ `background` still reads `--bk-kanban-column-bg` with a fallback rather
118
+ than a hardcoded `#f9fafa` — that's not the specificity workaround it used
119
+ to be (the `:where()` above already solves that for a plain `bg-*` utility
120
+ too), just a convenient second way in: set the custom property directly
121
+ (inline style, a global CSS rule, whatever) without needing to know this
122
+ component's exact Tailwind class name.
123
+ */
124
+ :where(.bk-kanban-column) {
125
+ @apply flex flex-col shrink-0 w-[300px] max-w-[85vw] rounded-xl border border-[#EBEDF3] overflow-hidden;
126
+ background: var(--bk-kanban-column-bg, #f9fafa);
127
+ scroll-snap-align: start;
128
+ }
129
+
130
+ /* Same `:where()` + custom-property-as-convenience reasoning as
131
+ `.bk-kanban-column` above, so `columns[].colHeaderClass` reliably wins on
132
+ any property here — background included, same trick `bk-dialog` uses for
133
+ `--bk-dialog-panel-bg` via `panelClass`. */
134
+ :where(.bk-kanban-column-header) {
135
+ @apply flex items-center justify-between gap-2 px-3 py-2.5;
136
+ background: var(--bk-kanban-header-bg, #f9fafa);
137
+ border-bottom: 1px solid #ebedf3;
138
+ }
139
+
140
+ /* `dragColumn` makes this the drag handle (see kanban.html) — cursor
141
+ feedback only shows up once dragging is actually possible, and switches to
142
+ `grabbing` mid-drag the same way `.bk-kanban-card` does for cards. CDK adds
143
+ `cdk-drag-disabled` to the `cdkDrag` host itself (`.bk-kanban-column`), not
144
+ this handle, hence scoping through the parent rather than the class living
145
+ here directly. */
146
+ .bk-kanban-column:not(.cdk-drag-disabled) > .bk-kanban-column-header {
147
+ cursor: grab;
148
+ }
149
+
150
+ .bk-kanban-column.cdk-drag-dragging > .bk-kanban-column-header {
151
+ cursor: grabbing;
152
+ }
153
+
154
+ .bk-kanban-column-title {
155
+ @apply text-[13px] font-semibold text-[#15191E] truncate;
156
+ }
157
+
158
+ .bk-kanban-column-count {
159
+ @apply shrink-0;
160
+ }
161
+
162
+ /* No `ms-auto` here — `justify-between` on `.bk-kanban-column-header` above
163
+ already spreads title, count badge, and this slot apart on its own; a
164
+ `margin-inline-start: auto` on top of that would claim all the header's
165
+ leftover space for itself before `justify-content` ever sees it, silently
166
+ cancelling the spread between title and badge whenever an actions
167
+ template renders. */
168
+ .bk-kanban-column-actions {
169
+ @apply shrink-0 flex items-center;
170
+ }
171
+
172
+ /* ---------- Column body / drop list ---------- */
173
+
174
+ .bk-kanban-column-body {
175
+ @apply flex-1 flex flex-col gap-2 p-2.5 overflow-y-auto;
176
+ min-height: 96px;
177
+ }
178
+
179
+ .bk-kanban-empty {
180
+ @apply flex flex-1 flex-col items-center justify-center py-6 text-center;
181
+ }
182
+
183
+ .bk-kanban-empty-text {
184
+ @apply text-xs font-medium text-[#78829D];
185
+ }
186
+
187
+ /* ---------- Header add button (showAddItem) ----------
188
+
189
+ `bk-button` (`variant="primary"`, `size="xxsm"`) supplies its own bg/
190
+ border/rounded/active/disabled chrome as-is — `buttonClass` (kanban.html)
191
+ only ever covers the two things `bk-button` itself doesn't: a fixed
192
+ square size (`size-6`, in place of the size's own text-button padding)
193
+ and a hover state (`.btn-primary` in `ui-button.css` defines
194
+ `active:`/`focus-visible:` but no `hover:` of its own — this is the
195
+ per-instance override that input exists for, not a reason to touch the
196
+ shared component). The remove button below takes a different approach
197
+ (`bk-icon-button` + a hover-driven icon swap) — the two aren't meant to
198
+ match, this one just didn't need it. This class only ever places the
199
+ button: sits in the same header row as the title/count/actions-template
200
+ slot, and `justify-between` on `.bk-kanban-column-header` already spreads
201
+ everything in that row apart, so `shrink-0` is the only thing this needs,
202
+ same reasoning as `.bk-kanban-column-actions` just above. */
203
+
204
+ .bk-kanban-add-btn {
205
+ @apply shrink-0;
206
+ }
207
+
208
+ /* ---------- Card ---------- */
209
+
210
+ .bk-kanban-card {
211
+ @apply relative bg-white rounded-lg border border-[#EBEDF3] p-3 cursor-pointer;
212
+ box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
213
+ transition:
214
+ box-shadow 150ms ease,
215
+ border-color 150ms ease;
216
+ }
217
+
218
+ /* ---------- Card remove button (showRemoveItem) ----------
219
+
220
+ Absolutely positioned over the card's own top-right corner rather than
221
+ flowed into `cardTemplate`'s content — it's board-owned chrome, present
222
+ regardless of what a consumer's own card body renders, so click/drag
223
+ isolation (stopped in the template before either reaches this button's
224
+ ancestors — see kanban.ts's onRemoveButtonClick doc comment) is
225
+ guaranteed by the board itself rather than left to every consumer to get
226
+ right. `.bk-kanban-card` picked up `relative` above specifically so this
227
+ has something to position against. `bk-icon-button` here, not `bk-button`
228
+ — `removeButtonVariant()`/`removeButtonIcon()` in kanban.ts swap `variant`
229
+ and the icon asset itself on `(hovered)`, mirroring `AddFleet`'s own close
230
+ button exactly (down to reusing its `popup-cross`/`popup-cross-white`
231
+ icon pair) — `bk-icon-button` has no real `:hover` of its own either, only
232
+ `active:`. This class only ever places it. */
233
+ .bk-kanban-remove-btn {
234
+ @apply absolute top-1.5 right-1.5 z-10;
235
+ }
236
+
237
+ .bk-kanban-card:hover {
238
+ @apply border-[#C4CADA];
239
+ box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08);
240
+ }
241
+
242
+ /* CDK holds the dragged card at a fixed pointer offset while it flies to its
243
+ drop position; a stray transition on `transform` during that flight reads
244
+ as lag rather than motion. `cdk-drag-animating` (added only for the
245
+ settle-into-place snap after release) is what should transition. */
246
+ .bk-kanban-card.cdk-drag-dragging {
247
+ transition: none;
248
+ }
249
+
250
+ /* ---------- WIP limit feedback ----------
251
+
252
+ `-warn` is the persistent, post-drop state (`wipLimitBehavior: 'warn'`,
253
+ §6). `-live-over` is the transient one drawn while a card is being
254
+ dragged over a column that would exceed its limit (§12) — independent of
255
+ `wipLimitBehavior`, since it's pure information shown before anything has
256
+ actually happened. Both can theoretically apply at once (a column already
257
+ over limit being hovered again); the rules simply stack. */
258
+
259
+ .bk-kanban-column-warn {
260
+ @apply border-amber-300 bg-amber-50;
261
+ }
262
+
263
+ .bk-kanban-column-warn .bk-kanban-column-header {
264
+ @apply bg-amber-50 border-amber-200;
265
+ }
266
+
267
+ .bk-kanban-column-live-over {
268
+ @apply border-amber-400 bg-amber-50;
269
+ outline: 2px dashed theme('colors.amber.400');
270
+ outline-offset: -2px;
271
+ }
272
+
273
+ .bk-kanban-column-live-over .bk-kanban-column-header {
274
+ @apply bg-amber-50 border-amber-200;
275
+ }
276
+
277
+ /* ---------- Drag sorting ----------
278
+
279
+ Deliberately scoped to `.bk-kanban-card` rather than the bare
280
+ `.cdk-drag-preview` / `.cdk-drag-placeholder` selectors bk-table and
281
+ bk-grid already publish globally (ViewEncapsulation.None puts all three
282
+ stylesheets in the same global scope) — CDK's `display: table` there is
283
+ right for a cloned `<tr>` and wrong for a card `<div>`; the extra class
284
+ also just wins on specificity, so which stylesheet loads last can't flip
285
+ this component's own drag visuals. */
286
+
287
+ .bk-kanban-card.cdk-drag-preview {
288
+ @apply rounded-lg;
289
+ box-shadow:
290
+ 0 5px 5px -3px rgba(0, 0, 0, 0.2),
291
+ 0 8px 10px 1px rgba(0, 0, 0, 0.14),
292
+ 0 3px 14px 2px rgba(0, 0, 0, 0.12);
293
+ cursor: grabbing;
294
+ }
295
+
296
+ .bk-kanban-card.cdk-drag-placeholder {
297
+ @apply border-dashed border-[#C4CADA] bg-[#F1F2F4];
298
+ box-shadow: none;
299
+ opacity: 0.6;
300
+ }
301
+
302
+ .bk-kanban-column-body.cdk-drop-list-dragging .bk-kanban-card:not(.cdk-drag-placeholder) {
303
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
304
+ }
305
+
306
+ /* Same treatment one level up, for `dragColumn` — a column being
307
+ dragged gets the heavier shadow a whole column's worth of chrome warrants
308
+ (cards use a lighter one, being the smaller unit), and its placeholder
309
+ reuses the exact dashed-border look `.bk-kanban-card`'s placeholder uses,
310
+ just sized to a column instead. */
311
+ .bk-kanban-column.cdk-drag-preview {
312
+ box-shadow:
313
+ 0 8px 10px -6px rgba(0, 0, 0, 0.2),
314
+ 0 20px 25px -5px rgba(0, 0, 0, 0.14);
315
+ }
316
+
317
+ .bk-kanban-column.cdk-drag-placeholder {
318
+ @apply border-dashed border-[#C4CADA] bg-[#F1F2F4];
319
+ box-shadow: none;
320
+ opacity: 0.5;
321
+ }
322
+
323
+ .bk-kanban-column.cdk-drag-placeholder .bk-kanban-column-header,
324
+ .bk-kanban-column.cdk-drag-placeholder .bk-kanban-column-body {
325
+ visibility: hidden;
326
+ }
327
+
328
+ .bk-kanban.cdk-drop-list-dragging .bk-kanban-column:not(.cdk-drag-placeholder) {
329
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
330
+ }
331
+
332
+ /* ---------- Responsive ----------
333
+
334
+ Below tablet width, a fixed 300px column plus its neighbours peeking in
335
+ reads as clutter rather than an obvious "swipe for more" board — one
336
+ column at a time (minus a sliver of the next, so the horizontal scroll is
337
+ still discoverable) reads better on a phone-width viewport. */
338
+ @media (max-width: 640px) {
339
+ .bk-kanban-column {
340
+ width: 86vw;
341
+ }
342
+ }
package/src/styles.css CHANGED
@@ -44,7 +44,7 @@
44
44
  @import './lib/menu/menu.css';
45
45
  @import './lib/ui-avatar-group/ui-avatar-group.css';
46
46
  @import './lib/table/table.css';
47
- @import './lib/kanban/kanban.css';
47
+ @import './lib/kanban/component/kanban/kanban.css';
48
48
  @import './lib/calender/components/custom-calendar/custom-calendar.component.css';
49
49
  @import './lib/calender/components/scheduled-date-picker/scheduled-date-picker.component.css';
50
50
  @import './lib/calender/components/time-picker/time-picker.component.css';