@crewlethq/ui 0.99.0 → 0.100.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/dist/AddPill/index.js +1 -1
- package/dist/ArtifactBar/index.js +1 -1
- package/dist/DataGrid/index.js +2 -1
- package/dist/DeepWorkCard/index.js +2 -2
- package/dist/MarkdownEditor/index.js +1 -1
- package/dist/MergeConflicts/index.js +1 -1
- package/dist/OrgLabel/OrgLabel.d.ts +6 -0
- package/dist/OrgLabel/index.js +1 -1
- package/dist/{OrgLabel-6UGWHDQQ.css → OrgLabel-7UJKEDT3.css} +23 -0
- package/dist/OrgNode/index.js +2 -2
- package/dist/OrgTable/OrgTable.d.ts +2 -2
- package/dist/OrgTable/index.js +5 -4
- package/dist/{OrgTable-GBRYKTDH.css → OrgTable-3DXA23ZA.css} +28 -23
- package/dist/RunChip/index.js +2 -2
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-PWTB7KEE.css → SegmentedControl-MHZMS2JJ.css} +4 -1
- package/dist/SelectionBar/SelectionBar.d.ts +6 -1
- package/dist/SelectionBar/index.js +1 -1
- package/dist/{SelectionBar-SCAU6EBY.css → SelectionBar-54W5IFF5.css} +9 -0
- package/dist/SetupWizard/index.js +2 -2
- package/dist/StatusLegend/index.js +1 -1
- package/dist/{StatusLegend-7MS2SBVC.css → StatusLegend-HVMKJQFY.css} +3 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-YQBNYCIS.css → Stepper-S4RC4OZ3.css} +20 -2
- package/dist/ThemeSwitcher/index.js +1 -1
- package/dist/TimeRangePicker/index.js +1 -1
- package/dist/TreeGrid/TreeGrid.d.ts +15 -7
- package/dist/TreeGrid/index.js +2 -1
- package/dist/{TreeGrid-PZ3DFVRO.css → TreeGrid-H3GHMKZX.css} +74 -33
- package/dist/VersionCompare/index.js +1 -1
- package/dist/{chunk-JQCKRABK.js → chunk-2WQEHXXB.js} +1 -1
- package/dist/{chunk-6FS6W3P5.js → chunk-3QKJV3KE.js} +1 -1
- package/dist/{chunk-4XYKBZJE.js → chunk-44GFQ4O3.js} +24 -14
- package/dist/chunk-CTQZK5J3.js +8 -0
- package/dist/{chunk-SSN7Y3UY.js → chunk-DVRECWCB.js} +1 -1
- package/dist/{chunk-ROFAWLFS.js → chunk-ERESJG6C.js} +4 -3
- package/dist/{chunk-4FNAPCCK.js → chunk-KN4YCWWO.js} +1 -1
- package/dist/{chunk-KUMHQY2B.js → chunk-LIDKF3LL.js} +1 -1
- package/dist/{chunk-IX6CHGM4.js → chunk-MFZBLJYF.js} +1 -1
- package/dist/{chunk-3QBQY2XK.js → chunk-QIVLL5HB.js} +27 -20
- package/dist/{chunk-MYFSVZKZ.js → chunk-SJP7WYIV.js} +1 -1
- package/dist/{chunk-WSR4OB4T.js → chunk-XOVSHJTZ.js} +1 -1
- package/dist/{chunk-AHPMAPVN.js → chunk-Z346ESBB.js} +2 -5
- package/dist/{chunk-Z6E3WOWS.js → chunk-ZPNFWORS.js} +4 -4
- package/dist/generated/index.js +40 -39
- package/dist/index.js +40 -39
- package/dist/styles.css +168 -67
- package/dist/utils/tableTrack.d.ts +21 -0
- package/package.json +3 -3
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* A hierarchy as rows and columns (TreeGrid.tsx)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* without a table: a table row cannot be a focusable treegrid row with a
|
|
6
|
-
* level. The grid keeps a minimum width and scrolls sideways in its own box
|
|
7
|
-
* below that, so a phone width screen keeps every column readable and the page
|
|
8
|
-
* itself never scrolls sideways.
|
|
2
|
+
* A hierarchy as rows and columns (TreeGrid.tsx), on `DataGrid`'s table rules: one
|
|
3
|
+
* track list on the grid, which the head, body and rows pass through as `subgrid`.
|
|
4
|
+
* Below its minimum width it scrolls sideways in its own box, never the page's.
|
|
9
5
|
*/
|
|
10
6
|
|
|
11
7
|
.crewlet-tree-grid {
|
|
8
|
+
/* The inset between two columns, and the inset at the grid's two outer edges,
|
|
9
|
+
as `--crewlet-data-grid-edge`: the cells' own step standing alone, the card's
|
|
10
|
+
own in a flush card. */
|
|
11
|
+
--crewlet-tree-grid-inset: var(--spacing-3);
|
|
12
|
+
--crewlet-tree-grid-edge: var(--spacing-3);
|
|
13
|
+
|
|
12
14
|
position: relative;
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -43,15 +45,25 @@
|
|
|
43
45
|
* menus open in, which must not be clipped.
|
|
44
46
|
*/
|
|
45
47
|
background: var(--color-surface-subtle);
|
|
46
|
-
border: 1px solid var(--color-border-
|
|
47
|
-
border-radius: var(--radius-
|
|
48
|
+
border: 1px solid var(--color-border-hover);
|
|
49
|
+
border-radius: var(--radius-md);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
.crewlet-tree-grid__grid {
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-template-columns: var(--crewlet-tree-grid-columns, minmax(0, 1fr));
|
|
51
55
|
min-width: var(--crewlet-tree-grid-min-width, 45rem);
|
|
52
56
|
font-size: var(--font-size-compact);
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
.crewlet-tree-grid__head,
|
|
60
|
+
.crewlet-tree-grid__body,
|
|
61
|
+
.crewlet-tree-grid__row {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: subgrid;
|
|
64
|
+
grid-column: 1 / -1;
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/* A CONTAINER-WIDTH GRID never scrolls sideways: it leaves out the columns its
|
|
56
68
|
width cannot hold, so its header can hold at the top of the page's scroll. */
|
|
57
69
|
.crewlet-tree-grid--container .crewlet-tree-grid__scroller {
|
|
@@ -66,17 +78,21 @@
|
|
|
66
78
|
position: sticky;
|
|
67
79
|
top: 0;
|
|
68
80
|
z-index: var(--z-index-sticky);
|
|
69
|
-
|
|
70
|
-
border-start-
|
|
71
|
-
border-start-end-radius: calc(var(--radius-lg) - 1px);
|
|
81
|
+
border-start-start-radius: calc(var(--radius-md) - 1px);
|
|
82
|
+
border-start-end-radius: calc(var(--radius-md) - 1px);
|
|
72
83
|
}
|
|
73
84
|
|
|
74
85
|
/*
|
|
75
86
|
* INSIDE A FLUSH CARD THE CARD IS THE FRAME. A flush card exists so that a
|
|
76
87
|
* table's rows reach its edges (Card.css), and a grid that drew its own border
|
|
77
88
|
* and corner there was a second rounded box one pixel inside the first, with
|
|
78
|
-
* the card's footer hanging outside it. The rows keep their own hairlines
|
|
89
|
+
* the card's footer hanging outside it. The rows keep their own hairlines, and
|
|
90
|
+
* the outer cells take the card's inset.
|
|
79
91
|
*/
|
|
92
|
+
.crewlet-card--flush .crewlet-tree-grid {
|
|
93
|
+
--crewlet-tree-grid-edge: var(--spacing-4);
|
|
94
|
+
}
|
|
95
|
+
|
|
80
96
|
.crewlet-card--flush .crewlet-tree-grid__scroller {
|
|
81
97
|
background: none;
|
|
82
98
|
border: none;
|
|
@@ -84,22 +100,29 @@
|
|
|
84
100
|
}
|
|
85
101
|
|
|
86
102
|
.crewlet-tree-grid__row {
|
|
87
|
-
display: grid;
|
|
88
|
-
grid-template-columns: var(--crewlet-tree-grid-columns, minmax(0, 1fr));
|
|
89
103
|
align-items: center;
|
|
90
104
|
min-height: var(--size-row-md);
|
|
91
|
-
border-
|
|
105
|
+
border-bottom: 1px solid var(--color-border-default);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.crewlet-tree-grid__body > .crewlet-tree-grid__row:last-child {
|
|
109
|
+
border-bottom: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.crewlet-tree-grid__body > .crewlet-tree-grid__row:hover {
|
|
113
|
+
background: var(--color-surface-hover);
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
/*
|
|
95
|
-
* THE HEAD IS THE TABLE'S HEADER REGISTER, in full
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* different ways. It is one micro-label step, declared once, wherever a column
|
|
99
|
-
* is named.
|
|
117
|
+
* THE HEAD IS THE TABLE'S HEADER REGISTER, in full, on the raised ground under
|
|
118
|
+
* the stronger hairline `DataGrid` draws its head on. It is one micro-label
|
|
119
|
+
* step, declared once, wherever a column is named.
|
|
100
120
|
*/
|
|
101
121
|
.crewlet-tree-grid__head .crewlet-tree-grid__row {
|
|
102
|
-
|
|
122
|
+
background: var(--color-surface-elevated);
|
|
123
|
+
border-bottom: 1px solid var(--color-border-hover);
|
|
124
|
+
border-start-start-radius: inherit;
|
|
125
|
+
border-start-end-radius: inherit;
|
|
103
126
|
font-size: var(--font-size-2xs);
|
|
104
127
|
font-weight: var(--font-weight-medium);
|
|
105
128
|
letter-spacing: var(--font-letter-spacing-wide);
|
|
@@ -107,13 +130,37 @@
|
|
|
107
130
|
color: var(--color-text-tertiary);
|
|
108
131
|
}
|
|
109
132
|
|
|
133
|
+
/*
|
|
134
|
+
* A heading and its cells share one inline inset, so they start on one line. A cell
|
|
135
|
+
* is the row's full height and centres what it holds, so a value that changes never
|
|
136
|
+
* moves its box, and a focused cell's ring is the row's.
|
|
137
|
+
*/
|
|
110
138
|
.crewlet-tree-grid__row > [role='columnheader'],
|
|
111
139
|
.crewlet-tree-grid__cell {
|
|
140
|
+
--crewlet-tree-grid-cell-start: var(--crewlet-tree-grid-inset);
|
|
141
|
+
--crewlet-tree-grid-cell-end: var(--crewlet-tree-grid-inset);
|
|
142
|
+
|
|
112
143
|
display: flex;
|
|
144
|
+
align-self: stretch;
|
|
113
145
|
align-items: center;
|
|
114
146
|
gap: var(--spacing-2);
|
|
115
147
|
min-width: 0;
|
|
116
|
-
padding:
|
|
148
|
+
padding-block: var(--spacing-1);
|
|
149
|
+
padding-inline: var(--crewlet-tree-grid-cell-start) var(--crewlet-tree-grid-cell-end);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.crewlet-tree-grid__row > [role='columnheader'] {
|
|
153
|
+
padding-block: var(--spacing-2);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.crewlet-tree-grid__row > [role='columnheader']:first-child,
|
|
157
|
+
.crewlet-tree-grid__cell:first-child {
|
|
158
|
+
--crewlet-tree-grid-cell-start: var(--crewlet-tree-grid-edge);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.crewlet-tree-grid__row > [role='columnheader']:last-child,
|
|
162
|
+
.crewlet-tree-grid__cell:last-child {
|
|
163
|
+
--crewlet-tree-grid-cell-end: var(--crewlet-tree-grid-edge);
|
|
117
164
|
}
|
|
118
165
|
|
|
119
166
|
/* A COLUMN OF VALUES READ AFTER THE NAME takes the caption's size, a step under the name's. */
|
|
@@ -124,11 +171,11 @@
|
|
|
124
171
|
/*
|
|
125
172
|
* The indent is the row's own level, set on the row, ON TOP OF the inset every
|
|
126
173
|
* cell has. Replacing that inset left a top-level row's chevron flush against
|
|
127
|
-
* the frame, its hover ground touching the edge, and the column starting
|
|
128
|
-
*
|
|
174
|
+
* the frame, its hover ground touching the edge, and the column starting further
|
|
175
|
+
* out than its own heading and every other column.
|
|
129
176
|
*/
|
|
130
177
|
.crewlet-tree-grid__cell:first-child {
|
|
131
|
-
padding-inline-start: calc(var(--
|
|
178
|
+
padding-inline-start: calc(var(--crewlet-tree-grid-edge) + var(--spacing-5) * var(--crewlet-tree-grid-depth, 0));
|
|
132
179
|
}
|
|
133
180
|
|
|
134
181
|
/*
|
|
@@ -192,9 +239,7 @@
|
|
|
192
239
|
|
|
193
240
|
/*
|
|
194
241
|
* A HEADLESS GRID keeps its header row for a screen reader and draws no band:
|
|
195
|
-
* the row is taken out of the layout the way VisuallyHidden takes text out
|
|
196
|
-
* and the first row of the body loses the hairline that would otherwise sit
|
|
197
|
-
* under the frame's own edge as a second line.
|
|
242
|
+
* the row is taken out of the layout the way VisuallyHidden takes text out.
|
|
198
243
|
*/
|
|
199
244
|
.crewlet-tree-grid--headless .crewlet-tree-grid__head {
|
|
200
245
|
position: absolute;
|
|
@@ -205,10 +250,6 @@
|
|
|
205
250
|
white-space: nowrap;
|
|
206
251
|
}
|
|
207
252
|
|
|
208
|
-
.crewlet-tree-grid--headless .crewlet-tree-grid__head + [role='rowgroup'] > .crewlet-tree-grid__row:first-child {
|
|
209
|
-
border-top: 0;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
253
|
/* The selection is where the reader is, so it takes the accent. */
|
|
213
254
|
.crewlet-tree-grid__row[aria-selected='true'] {
|
|
214
255
|
box-shadow: inset 2px 0 0 var(--color-brand-accent);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { VERSION_COMPARE_LABELS, VERSION_COMPARE_LENSES, VersionCompare } from '../chunk-QND44ROZ.js';
|
|
2
2
|
import '../chunk-AOFVXE6V.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-XOVSHJTZ.js';
|
|
4
4
|
import '../chunk-FP6OFRAU.js';
|
|
5
5
|
import '../chunk-IYJCJOHW.js';
|
|
6
6
|
import '../chunk-EGMQURBR.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StatusDot } from './chunk-QRE6JCHS.js';
|
|
2
2
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
|
-
import './StatusLegend-
|
|
4
|
+
import './StatusLegend-HVMKJQFY.css';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
function StatusLegend({ label, items, value = null, onValueChange, countLabel = String, className }) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Avatar } from './chunk-XZY6S3UC.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './OrgLabel-
|
|
4
|
-
import {
|
|
3
|
+
import './OrgLabel-7UJKEDT3.css';
|
|
4
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function OrgLabel(props) {
|
|
7
7
|
const { layout = "node", className } = props;
|
|
8
|
-
const zone = props.avatar === void 0 ? /* @__PURE__ */
|
|
8
|
+
const zone = props.avatar === void 0 ? /* @__PURE__ */ jsxs(
|
|
9
9
|
"span",
|
|
10
10
|
{
|
|
11
11
|
className: cx(
|
|
@@ -14,18 +14,24 @@ function OrgLabel(props) {
|
|
|
14
14
|
props.iconRing === true && "crewlet-org-label__icon--ring"
|
|
15
15
|
),
|
|
16
16
|
"aria-hidden": "true",
|
|
17
|
-
children:
|
|
17
|
+
children: [
|
|
18
|
+
props.logo ? /* @__PURE__ */ jsx("img", { className: "crewlet-org-label__logo", src: props.logo.src, alt: props.logo.alt, draggable: false }) : props.icon,
|
|
19
|
+
/* @__PURE__ */ jsx(MarkStatus, { markStatus: props.markStatus })
|
|
20
|
+
]
|
|
18
21
|
}
|
|
19
|
-
) : /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
) : /* @__PURE__ */ jsxs("span", { className: "crewlet-org-label__icon", "aria-hidden": "true", children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Avatar,
|
|
25
|
+
{
|
|
26
|
+
name: props.avatar.name,
|
|
27
|
+
kind: props.avatar.kind,
|
|
28
|
+
src: props.avatar.src,
|
|
29
|
+
size: layout === "row" ? "xs" : "sm",
|
|
30
|
+
decorative: true
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(MarkStatus, { markStatus: props.markStatus })
|
|
34
|
+
] });
|
|
29
35
|
if (layout === "row") {
|
|
30
36
|
return /* @__PURE__ */ jsxs("span", { className: cx("crewlet-org-label", "crewlet-org-label--row", className), "data-tone": props.tone, children: [
|
|
31
37
|
zone,
|
|
@@ -58,6 +64,10 @@ function Words({
|
|
|
58
64
|
] })
|
|
59
65
|
] });
|
|
60
66
|
}
|
|
67
|
+
function MarkStatus({ markStatus }) {
|
|
68
|
+
if (markStatus === void 0 || markStatus === null || markStatus === false) return null;
|
|
69
|
+
return /* @__PURE__ */ jsx("span", { className: "crewlet-org-label__status", children: markStatus });
|
|
70
|
+
}
|
|
61
71
|
function Slot({ trailing }) {
|
|
62
72
|
if (trailing === void 0) return null;
|
|
63
73
|
return /* @__PURE__ */ jsx("span", { className: "crewlet-org-label__trailing", children: trailing });
|
|
@@ -74,6 +74,7 @@ function AddPill({
|
|
|
74
74
|
"data-layout": layout,
|
|
75
75
|
ref: group,
|
|
76
76
|
onBlur,
|
|
77
|
+
onMouseEnter: () => setPhase((was) => was === "locked" ? was : "preview"),
|
|
77
78
|
onMouseLeave: () => {
|
|
78
79
|
if (phase === "preview") close(false);
|
|
79
80
|
},
|
|
@@ -89,7 +90,6 @@ function AddPill({
|
|
|
89
90
|
tabIndex,
|
|
90
91
|
ref: mark,
|
|
91
92
|
onKeyDown,
|
|
92
|
-
onMouseEnter: () => setPhase((was) => was === "locked" ? was : "preview"),
|
|
93
93
|
onClick: press,
|
|
94
94
|
children: [
|
|
95
95
|
/* @__PURE__ */ jsx("span", { className: "crewlet-add-pill__disc", "aria-hidden": "true" }),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
|
|
2
|
+
import { tableTrack } from './chunk-CTQZK5J3.js';
|
|
2
3
|
import { LayerNodeBridge } from './chunk-X4HBZSXA.js';
|
|
3
4
|
import { IconButton } from './chunk-WDLAAZFZ.js';
|
|
4
5
|
import { LayerHost, LAYER_REPOSITION_EVENT } from './chunk-FIX72ZEC.js';
|
|
5
6
|
import { focusables } from './chunk-TUEM2XIW.js';
|
|
6
7
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
7
8
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
8
|
-
import './TreeGrid-
|
|
9
|
+
import './TreeGrid-H3GHMKZX.css';
|
|
9
10
|
import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
10
11
|
import { ChevronRightGlyph } from '@crewlethq/icons/glyphs';
|
|
11
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -237,7 +238,7 @@ function TreeGrid({
|
|
|
237
238
|
columnKey: (col) => drawn[col - 1]?.key,
|
|
238
239
|
shown: (key) => drawn.some((one) => one.key === key)
|
|
239
240
|
};
|
|
240
|
-
const template = drawn.map(
|
|
241
|
+
const template = drawn.map(tableTrack).join(" ");
|
|
241
242
|
return /* @__PURE__ */ jsx(
|
|
242
243
|
"div",
|
|
243
244
|
{
|
|
@@ -261,7 +262,7 @@ function TreeGrid({
|
|
|
261
262
|
onKeyDownCapture,
|
|
262
263
|
children: [
|
|
263
264
|
/* @__PURE__ */ jsx("div", { role: "rowgroup", className: "crewlet-tree-grid__head", children: /* @__PURE__ */ jsx("div", { role: "row", className: "crewlet-tree-grid__row", children: drawn.map((one, index) => /* @__PURE__ */ jsx("div", { role: "columnheader", "aria-colindex": index + 1, children: one.headerHidden ? /* @__PURE__ */ jsx(VisuallyHidden, { children: one.header }) : one.header }, one.key)) }) }),
|
|
264
|
-
/* @__PURE__ */ jsx("div", { role: "rowgroup", children: rows.map((id) => {
|
|
265
|
+
/* @__PURE__ */ jsx("div", { role: "rowgroup", className: "crewlet-tree-grid__body", children: rows.map((id) => {
|
|
265
266
|
const add = isAddRow(id);
|
|
266
267
|
const cells = add ? add.cells : drawn.length;
|
|
267
268
|
const expandable = treeExpandable(model, id);
|
|
@@ -2,7 +2,7 @@ import { StatusDot } from './chunk-QRE6JCHS.js';
|
|
|
2
2
|
import { Spinner } from './chunk-XSPCITPN.js';
|
|
3
3
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
|
-
import './Stepper-
|
|
5
|
+
import './Stepper-S4RC4OZ3.css';
|
|
6
6
|
import './StepList-OAJ45IBX.css';
|
|
7
7
|
import { CircleCheckGlyph, CircleAlertGlyph, LockGlyph, CircleStopGlyph, CircleDashedGlyph, ClockGlyph, CheckGlyph, TriangleAlertGlyph } from '@crewlethq/icons/glyphs';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -3,7 +3,7 @@ import { Button } from './chunk-6KUOHUY5.js';
|
|
|
3
3
|
import { returnFocus } from './chunk-4ITETIGZ.js';
|
|
4
4
|
import { announce } from './chunk-2G355KDJ.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
|
-
import './SelectionBar-
|
|
6
|
+
import './SelectionBar-54W5IFF5.css';
|
|
7
7
|
import { useRef, useEffect } from 'react';
|
|
8
8
|
import { XGlyph } from '@crewlethq/icons/glyphs';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -14,7 +14,7 @@ var LABELS = {
|
|
|
14
14
|
clear: "Clear",
|
|
15
15
|
label: "Selection"
|
|
16
16
|
};
|
|
17
|
-
function SelectionBar({ count, onClear, children, returnFocusRef, className, labels }) {
|
|
17
|
+
function SelectionBar({ count, onClear, children, returnFocusRef, size = "md", className, labels }) {
|
|
18
18
|
const text = { ...LABELS, ...labels };
|
|
19
19
|
const said = useRef(0);
|
|
20
20
|
const countWords = text.count(count);
|
|
@@ -27,24 +27,31 @@ function SelectionBar({ count, onClear, children, returnFocusRef, className, lab
|
|
|
27
27
|
else if (before > 0) announce(clearedWords);
|
|
28
28
|
}, [count, countWords, clearedWords]);
|
|
29
29
|
if (count <= 0) return null;
|
|
30
|
-
return /* @__PURE__ */ jsxs(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
Toolbar,
|
|
32
|
+
{
|
|
33
|
+
label: text.label,
|
|
34
|
+
className: cx("crewlet-selection-bar", size === "compact" && "crewlet-selection-bar--compact", className),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__count", children: countWords }),
|
|
37
|
+
children ? /* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__actions", children }) : null,
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-selection-bar__spacer", "aria-hidden": "true" }),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
Button,
|
|
41
|
+
{
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
size: "small",
|
|
44
|
+
leadingIcon: /* @__PURE__ */ jsx(XGlyph, { size: "sm" }),
|
|
45
|
+
onClick: () => {
|
|
46
|
+
onClear();
|
|
47
|
+
returnFocus(returnFocusRef?.current);
|
|
48
|
+
},
|
|
49
|
+
children: text.clear
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
export { SelectionBar };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tableTrack, SHRINK_SHARE } from './chunk-CTQZK5J3.js';
|
|
1
2
|
import { Checkbox } from './chunk-M6G7XLLP.js';
|
|
2
3
|
import { useMediaMatch } from './chunk-YJQXESOJ.js';
|
|
3
4
|
import { EmptyState } from './chunk-PPUR46MK.js';
|
|
@@ -86,8 +87,6 @@ function compare(a, b) {
|
|
|
86
87
|
}
|
|
87
88
|
return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
|
|
88
89
|
}
|
|
89
|
-
var SHRINK_CAP = "20%";
|
|
90
|
-
var SHRINK_SHARE = 0.2;
|
|
91
90
|
var SQUEEZE_SAMPLE_ROWS = 12;
|
|
92
91
|
var NO_DROPS = [];
|
|
93
92
|
var NO_FIT = { set: "", width: 0, dropped: NO_DROPS };
|
|
@@ -361,9 +360,7 @@ function DataGrid({
|
|
|
361
360
|
if (!column.sortValue || !onSortChange) return;
|
|
362
361
|
onSortChange(nextGridSort(column.key, sortRaw, defaultSort));
|
|
363
362
|
}
|
|
364
|
-
const template = drawnColumns.map(
|
|
365
|
-
(c) => c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : c.shrink ? `fit-content(${SHRINK_CAP})` : `minmax(${c.floor ?? 0}, 1fr)`)
|
|
366
|
-
).join(" ");
|
|
363
|
+
const template = drawnColumns.map((c) => tableTrack({ ...c, width: c.width ?? (c.icon ? DATA_GRID_ICON_TRACK : void 0) })).join(" ");
|
|
367
364
|
if (flat.length === 0 && !bands?.length && empty) {
|
|
368
365
|
return /* @__PURE__ */ jsx("div", { className: cx("crewlet-data-grid", className), "data-flush": flush || void 0, children: /* @__PURE__ */ jsx(
|
|
369
366
|
EmptyState,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TreeGrid } from './chunk-
|
|
1
|
+
import { TreeGrid } from './chunk-ERESJG6C.js';
|
|
2
2
|
import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
|
|
3
|
-
import { OrgLabel } from './chunk-
|
|
3
|
+
import { OrgLabel } from './chunk-44GFQ4O3.js';
|
|
4
4
|
import { Checkbox } from './chunk-M6G7XLLP.js';
|
|
5
|
-
import { AddPill } from './chunk-
|
|
5
|
+
import { AddPill } from './chunk-DVRECWCB.js';
|
|
6
6
|
import { IconButton } from './chunk-WDLAAZFZ.js';
|
|
7
7
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
8
|
-
import './OrgTable-
|
|
8
|
+
import './OrgTable-3DXA23ZA.css';
|
|
9
9
|
import { useMemo, useRef, useImperativeHandle, useCallback } from 'react';
|
|
10
10
|
import { ChevronDownGlyph, ChevronUpGlyph } from '@crewlethq/icons/glyphs';
|
|
11
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|