@crisp-ui-kit/crisp 0.54.8 → 0.54.9
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/board.css +32 -8
- package/dist/board.layered.css +32 -8
- package/dist/cjs/components/contextmenu/contextmenu.js +2 -2
- package/dist/cjs/components/contextmenu/contextmenu.recipe.js +24 -0
- package/dist/cjs/components/datatable/datatable.js +541 -51
- package/dist/cjs/components/datatable/datatable.recipe.js +61 -3
- package/dist/cjs/components/dialog/dialog.js +65 -1
- package/dist/cjs/components/tabletoolbar/tabletoolbar.chrome.js +37 -2
- package/dist/cjs/components/tabletoolbar/tabletoolbar.js +148 -15
- package/dist/cjs/components/tabletoolbar/tabletoolbar.recipe.js +35 -1
- package/dist/cjs/product/board/board.js +62 -28
- package/dist/cjs/product/board/board.recipe.js +42 -2
- package/dist/cjs/product/comments/comments.js +11 -2
- package/dist/cjs/product/comments/comments.recipe.js +14 -4
- package/dist/cjs/product/recordstable/recordstable.js +1 -17
- package/dist/cjs/product/savedviews/savedviews.js +55 -24
- package/dist/cjs/product/savedviews/savedviews.recipe.js +27 -0
- package/dist/comments.css +14 -4
- package/dist/comments.layered.css +14 -4
- package/dist/contextmenu.css +24 -0
- package/dist/contextmenu.layered.css +24 -0
- package/dist/datatable.css +103 -77
- package/dist/datatable.layered.css +103 -77
- package/dist/esm/components/contextmenu/contextmenu.js +2 -2
- package/dist/esm/components/contextmenu/contextmenu.recipe.js +24 -0
- package/dist/esm/components/datatable/datatable.js +541 -52
- package/dist/esm/components/datatable/datatable.recipe.js +62 -4
- package/dist/esm/components/dialog/dialog.js +65 -1
- package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +37 -2
- package/dist/esm/components/tabletoolbar/tabletoolbar.js +149 -16
- package/dist/esm/components/tabletoolbar/tabletoolbar.recipe.js +37 -3
- package/dist/esm/product/board/board.js +63 -29
- package/dist/esm/product/board/board.recipe.js +42 -2
- package/dist/esm/product/comments/comments.js +12 -3
- package/dist/esm/product/comments/comments.recipe.js +14 -4
- package/dist/esm/product/recordstable/recordstable.js +2 -18
- package/dist/esm/product/savedviews/savedviews.js +57 -26
- package/dist/esm/product/savedviews/savedviews.recipe.js +27 -0
- package/dist/recordstable.css +33 -31
- package/dist/recordstable.layered.css +33 -31
- package/dist/savedviews.css +27 -0
- package/dist/savedviews.layered.css +27 -0
- package/dist/styles.css +266 -124
- package/dist/styles.layered.css +266 -124
- package/dist/tabletoolbar.css +33 -4
- package/dist/tabletoolbar.layered.css +33 -4
- package/dist/types/components/contextmenu/contextmenu.d.ts +8 -1
- package/dist/types/components/datatable/datatable.d.ts +90 -2
- package/dist/types/components/tabletoolbar/tabletoolbar.d.ts +72 -2
- package/dist/types/product/board/board.d.ts +48 -2
- package/dist/types/product/comments/comments.d.ts +6 -1
- package/dist/types/product/recordstable/recordstable.d.ts +0 -1
- package/dist/types/product/savedviews/savedviews.d.ts +45 -8
- package/package.json +1 -1
package/dist/board.css
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
.crisp-board {
|
|
2
|
-
display: flex; gap: var(--crisp-space-2); height: 100%; box-sizing: border-box;
|
|
3
|
-
|
|
2
|
+
display: flex; flex-direction: column; gap: var(--crisp-space-2); height: 100%; box-sizing: border-box; font-family: var(--crisp-font-sans); /* #718: the density toolbar's own row -- everything that used to be on
|
|
3
|
+
the root (padding/overflow/the columns themselves) moves to
|
|
4
|
+
.crisp-board-row below so this can sit above it, unscrolled. */
|
|
5
|
+
& .crisp-board-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--crisp-space-2); padding: 0 var(--crisp-space-3); flex-shrink: 0; }
|
|
6
|
+
/* Measured live (Deals pipeline): a 54×28px group, 24×24px buttons,
|
|
7
|
+
2px padding/gap -- an 8px gap between the two groups comes from the
|
|
8
|
+
toolbar's own `gap` above. */
|
|
9
|
+
& .crisp-board-density { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
10
|
+
& .crisp-board-density button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 8px; background: none; color: color-mix(in srgb, var(--crisp-fg-primary) 63%, transparent); font-family: inherit; cursor: pointer; }
|
|
11
|
+
& .crisp-board-density button[data-state="on"] { background: var(--crisp-bg-surface); color: var(--crisp-fg-primary); }
|
|
12
|
+
& .crisp-board-row { display: flex; gap: var(--crisp-space-2); flex: 1; min-height: 0; box-sizing: border-box; padding: var(--crisp-space-3); overflow-x: auto; align-items: flex-start; }
|
|
13
|
+
& .crisp-board-col { display: flex; flex-direction: column; width: 268px; flex-shrink: 0; max-height: 100%; box-sizing: border-box; transition: width 0.15s; }
|
|
14
|
+
/* #718: a collapsed column is a 52px vertical rail -- header only (dot + count stacked above a vertical-rl title), body/footer hidden entirely. Measured live: 52px width, 8px 0 padding on the header, 14px/600 title text. */
|
|
15
|
+
& .crisp-board-col[data-density="collapse"] { width: 52px; }
|
|
16
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-header { flex-direction: column; align-items: center; height: auto; padding: var(--crisp-space-2) 0; gap: var(--crisp-space-1); }
|
|
17
|
+
/* Measured stacking order (top to bottom): dot, count, THEN the vertical title -- reordered visually via `order`, not by changing the JSX/DOM order, which stays dot/title/count (reading order, unaffected by density). */
|
|
18
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-title { order: 1; writing-mode: vertical-rl; font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-semibold); }
|
|
19
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-count { order: 0; }
|
|
20
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-body, & .crisp-board-col[data-density="collapse"] .crisp-board-col-footer { display: none; }
|
|
4
21
|
& .crisp-board-col-header { display: flex; align-items: center; gap: var(--crisp-space-2); height: 36px; padding: 0 var(--crisp-space-1); flex-shrink: 0; }
|
|
5
22
|
& .crisp-board-col-dot { width: 12px; height: 12px; border-radius: var(--crisp-radius-full); flex-shrink: 0; }
|
|
6
23
|
& .crisp-board-col-title { font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-semibold); color: var(--crisp-fg-primary); }
|
|
@@ -15,23 +32,30 @@
|
|
|
15
32
|
& .crisp-board-newcard { display: flex; align-items: center; justify-content: center; gap: var(--crisp-space-1-5); height: 32px; flex-shrink: 0; border: none; border-radius: var(--crisp-radius-md); background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); color: var(--crisp-fg-muted); font-family: inherit; font-size: var(--crisp-text-md); font-weight: var(--crisp-weight-medium); cursor: pointer; }
|
|
16
33
|
& .crisp-board-newcard:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 7%, transparent); color: var(--crisp-fg-primary); }
|
|
17
34
|
& .crisp-board-card { display: flex; flex-direction: column; gap: var(--crisp-space-2); box-sizing: border-box; padding: var(--crisp-space-2-5) var(--crisp-space-3); border-radius: var(--crisp-radius-xl); background: var(--crisp-bg-surface); box-shadow: inset 0 0 0 1px var(--crisp-border-subtle); cursor: grab; touch-action: none; }
|
|
35
|
+
/* #718: a collapsed card is a single 40px row -- measured live and independent of `c.size.tableRow`/`tableHeader` (36/40px) even though it happens to match the latter; a plain literal, not a cross-reference to a token measured for a different surface. `renderCard`'s own second argument is what actually decides what a
|
|
36
|
+
collapsed card SHOWS (Board never sees inside its opaque output);
|
|
37
|
+
this only supplies the row-shaped box that content sits in. */
|
|
38
|
+
& .crisp-board-card[data-density="collapse"] { flex-direction: row; align-items: center; height: 40px; padding: 0 var(--crisp-space-3); }
|
|
18
39
|
& .crisp-board-card:active { cursor: grabbing; }
|
|
19
40
|
& .crisp-board-card[data-dragging] { opacity: 0.4; }
|
|
20
41
|
& .crisp-board-card:focus { outline: none; }
|
|
21
42
|
& .crisp-board-card:focus-visible { outline: 2px solid var(--crisp-bg-brand-solid); outline-offset: 1px; }
|
|
22
|
-
/* #674: the pointer-events drag's own drag image -- the same card
|
|
23
|
-
surface above, just pinned to the pointer instead of the flex flow.
|
|
24
|
-
No shadow lift or scale: neither was measured against Attio, and this
|
|
25
|
-
is the same card, momentarily somewhere else, not a new look. */
|
|
43
|
+
/* #674: the pointer-events drag's own drag image -- the same card surface above, just pinned to the pointer instead of the flex flow. No shadow lift or scale: neither was measured against Attio, and this is the same card, momentarily somewhere else, not a new look. */
|
|
26
44
|
& .crisp-board-ghost { position: fixed; z-index: 1; pointer-events: none; cursor: grabbing; }
|
|
27
|
-
/* #604: a per-column calc footer, mirroring the table's own (measured
|
|
28
|
-
|
|
45
|
+
/* #604: a per-column calc footer, mirroring the table's own (measured
|
|
46
|
+
live, Deals pipeline). Sits below the scrollable card body, not
|
|
47
|
+
inside it or pinned to it -- Attio's own is position: static, not sticky, so it's a plain flex-shrink:0 sibling here too. */
|
|
29
48
|
& .crisp-board-col-footer { flex-shrink: 0; padding: var(--crisp-space-1) 0; }
|
|
30
49
|
& .crisp-board-col-calc { display: flex; align-items: center; justify-content: center; gap: var(--crisp-space-1); width: 100%; height: 28px; padding: var(--crisp-space-1) var(--crisp-space-2); margin: 0; border: none; border-radius: var(--crisp-radius-md); background: none; font-family: inherit; font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-medium); color: color-mix(in srgb, var(--crisp-fg-primary) 63%, transparent); cursor: pointer; }
|
|
31
50
|
& .crisp-board-col-calc:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
32
51
|
& .crisp-board-col-calc[data-empty] { opacity: 0.7; }
|
|
33
52
|
& .crisp-board-col-calc-label { text-transform: capitalize; }
|
|
34
53
|
& .crisp-board-col-calc-value { color: var(--crisp-fg-primary); font-variant-numeric: tabular-nums; }
|
|
54
|
+
/* #718: "Add stage" -- measured live: 52×52px, transparent, a 1px
|
|
55
|
+
dashed border (rgb(230,231,234), exactly `borderDropzone`/`line150`
|
|
56
|
+
-- the same dashed-border colour ImportDialog's own dropzone already uses, not borderSubtle/line100, a close but different value), radius.xl (16px), a centered 16px "+". */
|
|
57
|
+
& .crisp-board-addstage { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex-shrink: 0; border: 1px dashed var(--crisp-border-dropzone); border-radius: var(--crisp-radius-xl); background: none; color: var(--crisp-fg-primary); font-family: inherit; cursor: pointer; }
|
|
58
|
+
& .crisp-board-addstage:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
35
59
|
/* announced, never drawn */
|
|
36
60
|
& .crisp-board-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
37
61
|
}
|
package/dist/board.layered.css
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
@layer crisp-components {
|
|
2
2
|
.crisp-board {
|
|
3
|
-
display: flex; gap: var(--crisp-space-2); height: 100%; box-sizing: border-box;
|
|
4
|
-
|
|
3
|
+
display: flex; flex-direction: column; gap: var(--crisp-space-2); height: 100%; box-sizing: border-box; font-family: var(--crisp-font-sans); /* #718: the density toolbar's own row -- everything that used to be on
|
|
4
|
+
the root (padding/overflow/the columns themselves) moves to
|
|
5
|
+
.crisp-board-row below so this can sit above it, unscrolled. */
|
|
6
|
+
& .crisp-board-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--crisp-space-2); padding: 0 var(--crisp-space-3); flex-shrink: 0; }
|
|
7
|
+
/* Measured live (Deals pipeline): a 54×28px group, 24×24px buttons,
|
|
8
|
+
2px padding/gap -- an 8px gap between the two groups comes from the
|
|
9
|
+
toolbar's own `gap` above. */
|
|
10
|
+
& .crisp-board-density { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
11
|
+
& .crisp-board-density button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 8px; background: none; color: color-mix(in srgb, var(--crisp-fg-primary) 63%, transparent); font-family: inherit; cursor: pointer; }
|
|
12
|
+
& .crisp-board-density button[data-state="on"] { background: var(--crisp-bg-surface); color: var(--crisp-fg-primary); }
|
|
13
|
+
& .crisp-board-row { display: flex; gap: var(--crisp-space-2); flex: 1; min-height: 0; box-sizing: border-box; padding: var(--crisp-space-3); overflow-x: auto; align-items: flex-start; }
|
|
14
|
+
& .crisp-board-col { display: flex; flex-direction: column; width: 268px; flex-shrink: 0; max-height: 100%; box-sizing: border-box; transition: width 0.15s; }
|
|
15
|
+
/* #718: a collapsed column is a 52px vertical rail -- header only (dot + count stacked above a vertical-rl title), body/footer hidden entirely. Measured live: 52px width, 8px 0 padding on the header, 14px/600 title text. */
|
|
16
|
+
& .crisp-board-col[data-density="collapse"] { width: 52px; }
|
|
17
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-header { flex-direction: column; align-items: center; height: auto; padding: var(--crisp-space-2) 0; gap: var(--crisp-space-1); }
|
|
18
|
+
/* Measured stacking order (top to bottom): dot, count, THEN the vertical title -- reordered visually via `order`, not by changing the JSX/DOM order, which stays dot/title/count (reading order, unaffected by density). */
|
|
19
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-title { order: 1; writing-mode: vertical-rl; font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-semibold); }
|
|
20
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-count { order: 0; }
|
|
21
|
+
& .crisp-board-col[data-density="collapse"] .crisp-board-col-body, & .crisp-board-col[data-density="collapse"] .crisp-board-col-footer { display: none; }
|
|
5
22
|
& .crisp-board-col-header { display: flex; align-items: center; gap: var(--crisp-space-2); height: 36px; padding: 0 var(--crisp-space-1); flex-shrink: 0; }
|
|
6
23
|
& .crisp-board-col-dot { width: 12px; height: 12px; border-radius: var(--crisp-radius-full); flex-shrink: 0; }
|
|
7
24
|
& .crisp-board-col-title { font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-semibold); color: var(--crisp-fg-primary); }
|
|
@@ -16,23 +33,30 @@
|
|
|
16
33
|
& .crisp-board-newcard { display: flex; align-items: center; justify-content: center; gap: var(--crisp-space-1-5); height: 32px; flex-shrink: 0; border: none; border-radius: var(--crisp-radius-md); background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); color: var(--crisp-fg-muted); font-family: inherit; font-size: var(--crisp-text-md); font-weight: var(--crisp-weight-medium); cursor: pointer; }
|
|
17
34
|
& .crisp-board-newcard:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 7%, transparent); color: var(--crisp-fg-primary); }
|
|
18
35
|
& .crisp-board-card { display: flex; flex-direction: column; gap: var(--crisp-space-2); box-sizing: border-box; padding: var(--crisp-space-2-5) var(--crisp-space-3); border-radius: var(--crisp-radius-xl); background: var(--crisp-bg-surface); box-shadow: inset 0 0 0 1px var(--crisp-border-subtle); cursor: grab; touch-action: none; }
|
|
36
|
+
/* #718: a collapsed card is a single 40px row -- measured live and independent of `c.size.tableRow`/`tableHeader` (36/40px) even though it happens to match the latter; a plain literal, not a cross-reference to a token measured for a different surface. `renderCard`'s own second argument is what actually decides what a
|
|
37
|
+
collapsed card SHOWS (Board never sees inside its opaque output);
|
|
38
|
+
this only supplies the row-shaped box that content sits in. */
|
|
39
|
+
& .crisp-board-card[data-density="collapse"] { flex-direction: row; align-items: center; height: 40px; padding: 0 var(--crisp-space-3); }
|
|
19
40
|
& .crisp-board-card:active { cursor: grabbing; }
|
|
20
41
|
& .crisp-board-card[data-dragging] { opacity: 0.4; }
|
|
21
42
|
& .crisp-board-card:focus { outline: none; }
|
|
22
43
|
& .crisp-board-card:focus-visible { outline: 2px solid var(--crisp-bg-brand-solid); outline-offset: 1px; }
|
|
23
|
-
/* #674: the pointer-events drag's own drag image -- the same card
|
|
24
|
-
surface above, just pinned to the pointer instead of the flex flow.
|
|
25
|
-
No shadow lift or scale: neither was measured against Attio, and this
|
|
26
|
-
is the same card, momentarily somewhere else, not a new look. */
|
|
44
|
+
/* #674: the pointer-events drag's own drag image -- the same card surface above, just pinned to the pointer instead of the flex flow. No shadow lift or scale: neither was measured against Attio, and this is the same card, momentarily somewhere else, not a new look. */
|
|
27
45
|
& .crisp-board-ghost { position: fixed; z-index: 1; pointer-events: none; cursor: grabbing; }
|
|
28
|
-
/* #604: a per-column calc footer, mirroring the table's own (measured
|
|
29
|
-
|
|
46
|
+
/* #604: a per-column calc footer, mirroring the table's own (measured
|
|
47
|
+
live, Deals pipeline). Sits below the scrollable card body, not
|
|
48
|
+
inside it or pinned to it -- Attio's own is position: static, not sticky, so it's a plain flex-shrink:0 sibling here too. */
|
|
30
49
|
& .crisp-board-col-footer { flex-shrink: 0; padding: var(--crisp-space-1) 0; }
|
|
31
50
|
& .crisp-board-col-calc { display: flex; align-items: center; justify-content: center; gap: var(--crisp-space-1); width: 100%; height: 28px; padding: var(--crisp-space-1) var(--crisp-space-2); margin: 0; border: none; border-radius: var(--crisp-radius-md); background: none; font-family: inherit; font-size: var(--crisp-text-lg); font-weight: var(--crisp-weight-medium); color: color-mix(in srgb, var(--crisp-fg-primary) 63%, transparent); cursor: pointer; }
|
|
32
51
|
& .crisp-board-col-calc:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
33
52
|
& .crisp-board-col-calc[data-empty] { opacity: 0.7; }
|
|
34
53
|
& .crisp-board-col-calc-label { text-transform: capitalize; }
|
|
35
54
|
& .crisp-board-col-calc-value { color: var(--crisp-fg-primary); font-variant-numeric: tabular-nums; }
|
|
55
|
+
/* #718: "Add stage" -- measured live: 52×52px, transparent, a 1px
|
|
56
|
+
dashed border (rgb(230,231,234), exactly `borderDropzone`/`line150`
|
|
57
|
+
-- the same dashed-border colour ImportDialog's own dropzone already uses, not borderSubtle/line100, a close but different value), radius.xl (16px), a centered 16px "+". */
|
|
58
|
+
& .crisp-board-addstage { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex-shrink: 0; border: 1px dashed var(--crisp-border-dropzone); border-radius: var(--crisp-radius-xl); background: none; color: var(--crisp-fg-primary); font-family: inherit; cursor: pointer; }
|
|
59
|
+
& .crisp-board-addstage:hover { background: color-mix(in srgb, var(--crisp-fg-primary) 4%, transparent); }
|
|
36
60
|
/* announced, never drawn */
|
|
37
61
|
& .crisp-board-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
38
62
|
}
|
|
@@ -45,7 +45,7 @@ const contextmenu_recipe_1 = require("./contextmenu.recipe");
|
|
|
45
45
|
* Wrap the target; right-clicking it opens the menu (flipping at the viewport
|
|
46
46
|
* edges), closing on select, outside pointer-down, and Escape.
|
|
47
47
|
*/
|
|
48
|
-
function ContextMenu({ children, items, menuLabel: menuLabelProp, className, asChild = false, }) {
|
|
48
|
+
function ContextMenu({ children, items, menuLabel: menuLabelProp, className, asChild = false, variant = "light", }) {
|
|
49
49
|
// crisp/#471: same resolution order as Breadcrumb's own.
|
|
50
50
|
const menuLabel = (0, core_1.useCrispMessage)(menuLabelProp, "Context menu");
|
|
51
51
|
const rootRef = React.useRef(null);
|
|
@@ -112,7 +112,7 @@ function ContextMenu({ children, items, menuLabel: menuLabelProp, className, asC
|
|
|
112
112
|
document.removeEventListener("keydown", onKey);
|
|
113
113
|
};
|
|
114
114
|
}, [pos, close]);
|
|
115
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [asChild ? ((0, jsx_runtime_1.jsx)(react_slot_1.Slot, { ref: rootRef, className: className, onContextMenu: open, children: children })) : ((0, jsx_runtime_1.jsx)("div", { ref: rootRef, className: (0, contextmenu_recipe_1.contextmenuRecipe)({ className }), children: (0, jsx_runtime_1.jsx)("div", { onContextMenu: open, children: children }) })), pos && ((0, jsx_runtime_1.jsx)(core_1.FloatingPortal, { sourceRef: rootRef, children: (0, jsx_runtime_1.jsx)("div", { ref: menuRef, className: "crisp-contextmenu-content", role: "menu", "aria-label": menuLabel, style: { left: pos.x, top: pos.y }, onKeyDown: onMenuKeyDown, children: items.map((item, i) => item.separator ? ((0, jsx_runtime_1.jsx)("hr", { className: "crisp-contextmenu-sep" }, i)) : ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "menuitem", disabled: item.disabled, className: item.danger
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [asChild ? ((0, jsx_runtime_1.jsx)(react_slot_1.Slot, { ref: rootRef, className: className, onContextMenu: open, children: children })) : ((0, jsx_runtime_1.jsx)("div", { ref: rootRef, className: (0, contextmenu_recipe_1.contextmenuRecipe)({ className }), children: (0, jsx_runtime_1.jsx)("div", { onContextMenu: open, children: children }) })), pos && ((0, jsx_runtime_1.jsx)(core_1.FloatingPortal, { sourceRef: rootRef, children: (0, jsx_runtime_1.jsx)("div", { ref: menuRef, className: "crisp-contextmenu-content", "data-variant": variant === "dark" ? "dark" : undefined, role: "menu", "aria-label": menuLabel, style: { left: pos.x, top: pos.y }, onKeyDown: onMenuKeyDown, children: items.map((item, i) => item.separator ? ((0, jsx_runtime_1.jsx)("hr", { className: "crisp-contextmenu-sep" }, i)) : ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "menuitem", disabled: item.disabled, className: item.danger
|
|
116
116
|
? "crisp-contextmenu-item crisp-contextmenu-item--danger"
|
|
117
117
|
: "crisp-contextmenu-item", tabIndex: -1, onClick: () => {
|
|
118
118
|
item.onSelect?.();
|
|
@@ -35,6 +35,30 @@ const config = (0, core_1.defineRecipe)({
|
|
|
35
35
|
.crisp-contextmenu-item--danger:hover { background: color-mix(in srgb, ${tokens_1.contract.bgDanger} 10%, transparent); }
|
|
36
36
|
.crisp-contextmenu-shortcut { margin-inline-start: auto; padding-inline-start: ${tokens_1.contract.space["3"]}; color: ${tokens_1.contract.fgMuted}; font-size: ${tokens_1.contract.text.sm}; }
|
|
37
37
|
.crisp-contextmenu-sep { height: 1px; margin: ${tokens_1.contract.space["1"]} 0; border: none; background: ${tokens_1.contract.borderSubtle}; }
|
|
38
|
+
/* crisp/#598: Attio's OWN cell-level context menu, measured live on
|
|
39
|
+
app.attio.com/techpartners/companies (right-click a data cell) --
|
|
40
|
+
theme-INDEPENDENT dark chrome, not this app's dark THEME (every
|
|
41
|
+
geometry value above -- 12px/8px radius, 4px/8px padding, 32px item
|
|
42
|
+
height, item gap included below -- already matched what was
|
|
43
|
+
measured here; only the colour pair differs, so only colours are
|
|
44
|
+
overridden). Same "#101112 / #eeeff1" dark-pill ink Tooltip
|
|
45
|
+
already hardcodes for the identical reason (that surface is ALSO
|
|
46
|
+
theme-independent). */
|
|
47
|
+
.crisp-contextmenu-content[data-variant="dark"] { background: #101112; box-shadow: none; }
|
|
48
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item { gap: ${tokens_1.contract.space["1.5"]}; color: #eeeff1; }
|
|
49
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item svg { color: #898a8d; }
|
|
50
|
+
/* Plain-item hover re-measured live on the same cell menu (right-click
|
|
51
|
+
"Description" on app.attio.com/techpartners/companies, hover the
|
|
52
|
+
"Copy" row): getComputedStyle on the row is rgba(255,255,255,0.1),
|
|
53
|
+
not the 0.08 this used to guess at. The danger row's own hover
|
|
54
|
+
(hovering "Clear value") still didn't get re-measured -- that one
|
|
55
|
+
remains the derived red-on-black translation below, flagged on
|
|
56
|
+
crisp#598 for someone to confirm live. */
|
|
57
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item:hover { background: rgba(255,255,255,0.1); }
|
|
58
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item--danger { color: #ff5454; }
|
|
59
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item--danger svg { color: #ff5454; }
|
|
60
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-item--danger:hover { background: rgba(255,84,84,0.12); }
|
|
61
|
+
.crisp-contextmenu-content[data-variant="dark"] .crisp-contextmenu-sep { background: rgba(255,255,255,0.1); }
|
|
38
62
|
`,
|
|
39
63
|
variants: {},
|
|
40
64
|
defaultVariants: {},
|