@crisp-ui-kit/crisp 0.54.1 → 0.54.3
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/chip.css +7 -1
- package/dist/chip.d.ts +2 -1
- package/dist/chip.layered.css +7 -1
- package/dist/cjs/components/chip/chip.js +3 -2
- package/dist/cjs/components/chip/chip.recipe.js +37 -1
- package/dist/cjs/components/datatable/datatable.js +490 -111
- package/dist/cjs/components/datatable/datatable.recipe.js +4 -0
- package/dist/cjs/components/emptystate/emptystate.js +3 -2
- package/dist/cjs/components/emptystate/emptystate.recipe.js +26 -1
- package/dist/cjs/components/mentionchip/index.js +7 -0
- package/dist/cjs/components/mentionchip/mentionchip.js +57 -0
- package/dist/cjs/components/mentionchip/mentionchip.recipe.js +38 -0
- package/dist/cjs/components/personchip/index.js +17 -0
- package/dist/cjs/components/personchip/personchip.js +50 -0
- package/dist/cjs/components/table/table.js +2 -2
- package/dist/cjs/components/table/table.recipe.js +15 -3
- package/dist/cjs/components/tabs/tabs.js +2 -2
- package/dist/cjs/components/tabs/tabs.recipe.js +30 -3
- package/dist/cjs/components/text/index.js +7 -0
- package/dist/cjs/components/text/text.js +55 -0
- package/dist/cjs/components/text/text.recipe.js +34 -0
- package/dist/cjs/core/floating-stack.js +18 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/product/formdialog/formdialog.js +171 -0
- package/dist/cjs/product/formdialog/formdialog.recipe.js +26 -0
- package/dist/cjs/product/formdialog/index.js +8 -0
- package/dist/cjs/product/headerbar/headerbar.recipe.js +9 -1
- package/dist/cjs/product/importdialog/importdialog.js +134 -0
- package/dist/cjs/product/importdialog/importdialog.recipe.js +92 -0
- package/dist/cjs/product/importdialog/index.js +18 -0
- package/dist/cjs/product/recordpage/recordpage.recipe.js +10 -1
- package/dist/cjs/product/recordstable/recordstable.js +89 -6
- package/dist/cjs/product/richtext/richtext.recipe.js +26 -1
- package/dist/cjs/product/savedviews/index.js +7 -0
- package/dist/cjs/product/savedviews/savedviews.js +207 -0
- package/dist/cjs/product/savedviews/savedviews.recipe.js +103 -0
- package/dist/cjs/product/taskstable/index.js +7 -0
- package/dist/cjs/product/taskstable/taskstable.js +27 -0
- package/dist/cjs/product/taskstable/taskstable.recipe.js +47 -0
- package/dist/cjs/product/themepicker/index.js +17 -0
- package/dist/cjs/product/themepicker/themepicker.js +32 -0
- package/dist/cjs/product/themepicker/themepicker.recipe.js +98 -0
- package/dist/cjs/tokens/palette.js +30 -13
- package/dist/cjs/tokens/semantic.js +6 -0
- package/dist/datatable.css +20 -21
- package/dist/datatable.layered.css +20 -21
- package/dist/emptystate.css +15 -1
- package/dist/emptystate.d.ts +2 -2
- package/dist/emptystate.layered.css +15 -1
- package/dist/esm/components/chip/chip.js +3 -2
- package/dist/esm/components/chip/chip.recipe.js +37 -1
- package/dist/esm/components/datatable/datatable.js +489 -111
- package/dist/esm/components/datatable/datatable.recipe.js +4 -0
- package/dist/esm/components/emptystate/emptystate.js +4 -3
- package/dist/esm/components/emptystate/emptystate.recipe.js +26 -1
- package/dist/esm/components/emptystate/index.js +1 -1
- package/dist/esm/components/mentionchip/index.js +2 -0
- package/dist/esm/components/mentionchip/mentionchip.js +21 -0
- package/dist/esm/components/mentionchip/mentionchip.recipe.js +35 -0
- package/dist/esm/components/personchip/index.js +1 -0
- package/dist/esm/components/personchip/personchip.js +47 -0
- package/dist/esm/components/table/table.js +2 -2
- package/dist/esm/components/table/table.recipe.js +15 -3
- package/dist/esm/components/tabs/tabs.js +2 -2
- package/dist/esm/components/tabs/tabs.recipe.js +30 -3
- package/dist/esm/components/text/index.js +2 -0
- package/dist/esm/components/text/text.js +19 -0
- package/dist/esm/components/text/text.recipe.js +31 -0
- package/dist/esm/core/floating-stack.js +17 -0
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/product/formdialog/formdialog.js +134 -0
- package/dist/esm/product/formdialog/formdialog.recipe.js +23 -0
- package/dist/esm/product/formdialog/index.js +2 -0
- package/dist/esm/product/headerbar/headerbar.recipe.js +9 -1
- package/dist/esm/product/importdialog/importdialog.js +97 -0
- package/dist/esm/product/importdialog/importdialog.recipe.js +89 -0
- package/dist/esm/product/importdialog/index.js +2 -0
- package/dist/esm/product/recordpage/recordpage.recipe.js +10 -1
- package/dist/esm/product/recordstable/recordstable.js +90 -8
- package/dist/esm/product/richtext/richtext.recipe.js +26 -1
- package/dist/esm/product/savedviews/index.js +2 -0
- package/dist/esm/product/savedviews/savedviews.js +171 -0
- package/dist/esm/product/savedviews/savedviews.recipe.js +100 -0
- package/dist/esm/product/taskstable/index.js +2 -0
- package/dist/esm/product/taskstable/taskstable.js +24 -0
- package/dist/esm/product/taskstable/taskstable.recipe.js +44 -0
- package/dist/esm/product/themepicker/index.js +1 -0
- package/dist/esm/product/themepicker/themepicker.js +29 -0
- package/dist/esm/product/themepicker/themepicker.recipe.js +95 -0
- package/dist/esm/tokens/palette.js +30 -13
- package/dist/esm/tokens/semantic.js +6 -0
- package/dist/formdialog.css +6 -0
- package/dist/formdialog.d.ts +7 -0
- package/dist/formdialog.layered.css +8 -0
- package/dist/headerbar.css +1 -1
- package/dist/headerbar.layered.css +1 -1
- package/dist/importdialog.css +38 -0
- package/dist/importdialog.d.ts +7 -0
- package/dist/importdialog.layered.css +40 -0
- package/dist/mentionchip.css +3 -0
- package/dist/mentionchip.d.ts +7 -0
- package/dist/mentionchip.layered.css +5 -0
- package/dist/native/tokens.d.ts +1 -1
- package/dist/native/tokens.js +14 -6
- package/dist/recordpage.css +13 -2
- package/dist/recordpage.layered.css +13 -2
- package/dist/richtext.css +11 -1
- package/dist/richtext.layered.css +11 -1
- package/dist/savedviews.css +78 -0
- package/dist/savedviews.d.ts +7 -0
- package/dist/savedviews.layered.css +80 -0
- package/dist/styles.css +287 -37
- package/dist/styles.layered.css +287 -37
- package/dist/table.css +15 -6
- package/dist/table.layered.css +15 -6
- package/dist/tabs.css +7 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.layered.css +7 -1
- package/dist/taskstable.css +23 -0
- package/dist/taskstable.d.ts +7 -0
- package/dist/taskstable.layered.css +25 -0
- package/dist/text.css +9 -0
- package/dist/text.d.ts +7 -0
- package/dist/text.layered.css +11 -0
- package/dist/themepicker.css +27 -0
- package/dist/themepicker.d.ts +7 -0
- package/dist/themepicker.layered.css +29 -0
- package/dist/tokens.css +7 -3
- package/dist/tokens.json +14 -6
- package/dist/types/components/chip/chip.d.ts +32 -0
- package/dist/types/components/chip/chip.recipe.d.ts +31 -0
- package/dist/types/components/datatable/datatable.d.ts +39 -4
- package/dist/types/components/emptystate/emptystate.d.ts +29 -4
- package/dist/types/components/emptystate/emptystate.recipe.d.ts +2 -0
- package/dist/types/components/emptystate/index.d.ts +1 -1
- package/dist/types/components/mentionchip/index.d.ts +2 -0
- package/dist/types/components/mentionchip/mentionchip.d.ts +20 -0
- package/dist/types/components/mentionchip/mentionchip.recipe.d.ts +18 -0
- package/dist/types/components/personchip/index.d.ts +1 -0
- package/dist/types/components/personchip/personchip.d.ts +37 -0
- package/dist/types/components/table/table.d.ts +36 -0
- package/dist/types/components/tabs/tabs.d.ts +4 -2
- package/dist/types/components/tabs/tabs.recipe.d.ts +18 -3
- package/dist/types/components/text/index.d.ts +2 -0
- package/dist/types/components/text/text.d.ts +32 -0
- package/dist/types/components/text/text.recipe.d.ts +40 -0
- package/dist/types/core/floating-stack.d.ts +14 -0
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/types/product/formdialog/formdialog.d.ts +57 -0
- package/dist/types/product/formdialog/formdialog.recipe.d.ts +3 -0
- package/dist/types/product/formdialog/index.d.ts +2 -0
- package/dist/types/product/importdialog/importdialog.d.ts +86 -0
- package/dist/types/product/importdialog/importdialog.recipe.d.ts +3 -0
- package/dist/types/product/importdialog/index.d.ts +2 -0
- package/dist/types/product/recordstable/recordstable.d.ts +24 -2
- package/dist/types/product/savedviews/index.d.ts +2 -0
- package/dist/types/product/savedviews/savedviews.d.ts +55 -0
- package/dist/types/product/savedviews/savedviews.recipe.d.ts +3 -0
- package/dist/types/product/taskstable/index.d.ts +2 -0
- package/dist/types/product/taskstable/taskstable.d.ts +54 -0
- package/dist/types/product/taskstable/taskstable.recipe.d.ts +3 -0
- package/dist/types/product/themepicker/index.d.ts +1 -0
- package/dist/types/product/themepicker/themepicker.d.ts +21 -0
- package/dist/types/product/themepicker/themepicker.recipe.d.ts +3 -0
- package/dist/types/tokens/contract.d.ts +2 -0
- package/dist/types/tokens/palette.d.ts +11 -3
- package/dist/types/tokens/semantic.d.ts +6 -0
- package/package.json +41 -1
|
@@ -69,6 +69,10 @@ const config = (0, core_1.defineRecipe)({
|
|
|
69
69
|
/* sticky first column(s) + horizontal scroll shadow — RecordsTable's feel */
|
|
70
70
|
& th[data-sticky], & td[data-sticky] { position: sticky; z-index: 1; background: ${tokens_1.contract.bgSurface}; }
|
|
71
71
|
& th[data-sticky] { z-index: 3; }
|
|
72
|
+
/* #554: a footer sticky-column cell sits in the bottom-sticky row (table.recipe.ts's
|
|
73
|
+
\`tfoot td { z-index: 2 }\`), which \`td[data-sticky]\`'s own higher-specificity
|
|
74
|
+
\`z-index: 1\` would otherwise undercut -- keep it level with the row it's in. */
|
|
75
|
+
& tfoot td[data-sticky] { z-index: 2; }
|
|
72
76
|
& tbody tr[data-selected] td[data-sticky] { background: color-mix(in srgb, ${tokens_1.contract.bgBrandSolid} 10%, ${tokens_1.contract.bgSurface}); }
|
|
73
77
|
& tbody tr:hover td[data-sticky] { background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 4%, ${tokens_1.contract.bgSurface}); }
|
|
74
78
|
& .crisp-table-scroll[data-scrolled-x] [data-sticky-edge] { clip-path: inset(0 -38px 0 0); box-shadow: 6px 0 16px 4px rgba(0,0,0,0.12); }
|
|
@@ -4,7 +4,8 @@ exports.EmptyState = EmptyState;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const emptystate_recipe_1 = require("./emptystate.recipe");
|
|
6
6
|
/** A centred empty-state panel — icon, title, description, optional action. */
|
|
7
|
-
function EmptyState({ icon, title, description, action, variant, className, ...rest }) {
|
|
8
|
-
|
|
7
|
+
function EmptyState({ icon, title, description, action, learnMore, variant, className, ...rest }) {
|
|
8
|
+
const learnMoreInner = learnMore && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "crisp-emptystate-learnmore-icon", children: learnMore.icon }), (0, jsx_runtime_1.jsx)("span", { className: "crisp-emptystate-learnmore-title", children: learnMore.title })] }));
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, emptystate_recipe_1.emptystateRecipe)({ variant, className }), ...rest, children: [icon && (0, jsx_runtime_1.jsx)("span", { className: "crisp-emptystate-icon", children: icon }), (0, jsx_runtime_1.jsx)("div", { className: "crisp-emptystate-title", children: title }), description != null && ((0, jsx_runtime_1.jsx)("div", { className: "crisp-emptystate-desc", children: description })), action && (0, jsx_runtime_1.jsx)("div", { className: "crisp-emptystate-action", children: action }), learnMore && ((0, jsx_runtime_1.jsxs)("div", { className: "crisp-emptystate-learnmore", children: [(0, jsx_runtime_1.jsx)("div", { className: "crisp-emptystate-learnmore-label", children: learnMore.label ?? "Learn more" }), learnMore.href ? ((0, jsx_runtime_1.jsx)("a", { className: "crisp-emptystate-learnmore-card", href: learnMore.href, onClick: learnMore.onClick, children: learnMoreInner })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "crisp-emptystate-learnmore-card", onClick: learnMore.onClick, children: learnMoreInner }))] }))] }));
|
|
9
10
|
}
|
|
10
11
|
EmptyState.displayName = "EmptyState";
|
|
@@ -10,7 +10,18 @@ const config = (0, core_1.defineRecipe)({
|
|
|
10
10
|
& .crisp-emptystate-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: ${tokens_1.contract.space["1"]}; border-radius: ${tokens_1.contract.radius.xl}; background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 5%, transparent); color: ${tokens_1.contract.fgMuted}; }
|
|
11
11
|
& .crisp-emptystate-title { font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.semibold}; color: ${tokens_1.contract.fgPrimary}; }
|
|
12
12
|
& .crisp-emptystate-desc { max-width: 320px; font-size: ${tokens_1.contract.text.md}; color: ${tokens_1.contract.fgMuted}; }
|
|
13
|
-
|
|
13
|
+
/* #603: measured 8px gap between "Import CSV"/"Connect data source" --
|
|
14
|
+
inline-flex so one action (the common case) or several lay out the
|
|
15
|
+
same way, wrapping if the container is narrow. */
|
|
16
|
+
& .crisp-emptystate-action { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: ${tokens_1.contract.space["2"]}; margin-top: ${tokens_1.contract.space["2"]}; }
|
|
17
|
+
/* #603: Attio's zero-records "Learn more" card -- a label above a
|
|
18
|
+
clickable icon+title tile. Left/start-aligned, unlike the rest of
|
|
19
|
+
this centred panel, so it overrides the base text-align. */
|
|
20
|
+
& .crisp-emptystate-learnmore { display: flex; flex-direction: column; align-items: stretch; gap: ${tokens_1.contract.space["2"]}; margin-top: ${tokens_1.contract.space["6"]}; text-align: start; }
|
|
21
|
+
& .crisp-emptystate-learnmore-label { font-size: ${tokens_1.contract.text.sm}; font-weight: ${tokens_1.contract.weight.medium}; color: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 50%, transparent); }
|
|
22
|
+
& .crisp-emptystate-learnmore-card { display: flex; align-items: center; gap: ${tokens_1.contract.space["2"]}; padding: ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["3"]} ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["2"]}; margin: 0; border: 1px solid ${tokens_1.contract.borderSubtle}; border-radius: 18px; background: ${tokens_1.contract.bgSurface}; font: inherit; text-align: start; text-decoration: none; color: inherit; cursor: pointer; }
|
|
23
|
+
& .crisp-emptystate-learnmore-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: ${tokens_1.contract.radius.xl}; background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 2%, transparent); color: ${tokens_1.contract.fgMuted}; }
|
|
24
|
+
& .crisp-emptystate-learnmore-title { font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.medium}; color: ${tokens_1.contract.fgPrimary}; }`,
|
|
14
25
|
variants: {
|
|
15
26
|
variant: {
|
|
16
27
|
// compact icon tile (default)
|
|
@@ -25,6 +36,20 @@ const config = (0, core_1.defineRecipe)({
|
|
|
25
36
|
& .crisp-emptystate-title { font-size: 20px; line-height: 24px; }
|
|
26
37
|
& .crisp-emptystate-desc { max-width: 266px; font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.medium}; line-height: 20px; }
|
|
27
38
|
& .crisp-emptystate-action { margin-top: ${tokens_1.contract.space["2"]}; }`,
|
|
39
|
+
// #603: Attio's zero-*records* table state (Users/Workspaces with
|
|
40
|
+
// nothing imported) -- the same dotted-grid backdrop `illustrated`
|
|
41
|
+
// uses, at its own measured 138x138 square (illustrated's is a
|
|
42
|
+
// 132x96 rectangle; different surface, not the same number).
|
|
43
|
+
// Attio's own illustration also draws four small "+" tick marks at
|
|
44
|
+
// the tile's corners -- a single proprietary SVG asset (confirmed
|
|
45
|
+
// by inspecting the live DOM: one <svg> with no separately
|
|
46
|
+
// measurable sub-elements), so not reproduced here per AUTHORING's
|
|
47
|
+
// "never copy Attio's icon set" rule; the icon itself is supplied
|
|
48
|
+
// by the consumer via the existing `icon` prop, same as every
|
|
49
|
+
// other variant.
|
|
50
|
+
records: `& .crisp-emptystate-icon { width: 138px; height: 138px; margin-bottom: ${tokens_1.contract.space["2"]}; border-radius: 0; color: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 22%, transparent); background: radial-gradient(circle, color-mix(in srgb, ${tokens_1.contract.fgPrimary} 12%, transparent) 1.2px, transparent 1.2px) 0 0 / 16px 16px; }
|
|
51
|
+
& .crisp-emptystate-title { font-size: 20px; line-height: 24px; }
|
|
52
|
+
& .crisp-emptystate-desc { max-width: 266px; font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.medium}; line-height: 20px; }`,
|
|
28
53
|
},
|
|
29
54
|
},
|
|
30
55
|
defaultVariants: { variant: "default" },
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mentionChipRecipe = exports.MentionChip = void 0;
|
|
4
|
+
var mentionchip_1 = require("./mentionchip");
|
|
5
|
+
Object.defineProperty(exports, "MentionChip", { enumerable: true, get: function () { return mentionchip_1.MentionChip; } });
|
|
6
|
+
var mentionchip_recipe_1 = require("./mentionchip.recipe");
|
|
7
|
+
Object.defineProperty(exports, "mentionChipRecipe", { enumerable: true, get: function () { return mentionchip_recipe_1.mentionChipRecipe; } });
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.MentionChip = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const core_1 = require("../../core");
|
|
40
|
+
const mentionchip_recipe_1 = require("./mentionchip.recipe");
|
|
41
|
+
/**
|
|
42
|
+
* A standalone "@mention" chip — the same look `RichTextEditor` draws
|
|
43
|
+
* inline while an editor is live (`.crisp-rte-mention`), exported on its
|
|
44
|
+
* own for a consumer rendering a mention OUTSIDE a mounted editor: a
|
|
45
|
+
* comment thread, a note's collapsed preview, anywhere a stored
|
|
46
|
+
* `@[Name](actor:id)`-shaped token needs to read as a person, not literal
|
|
47
|
+
* markup. Renders whatever `children` is given (the trigger character
|
|
48
|
+
* included, if the caller wants one, matching how `RichTextEditor`'s own
|
|
49
|
+
* chip includes it) rather than assuming an `@` prefix itself — plain text,
|
|
50
|
+
* no built-in click/remove behaviour (none was asked for; add one once a
|
|
51
|
+
* real interaction is measured, the same reasoning `Chip`'s own doc gives
|
|
52
|
+
* for not guessing a remove affordance).
|
|
53
|
+
*/
|
|
54
|
+
exports.MentionChip = React.forwardRef(({ className, asChild, ...props }, ref) => {
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Primitive.span, { ref: ref, asChild: asChild, className: (0, mentionchip_recipe_1.mentionChipRecipe)({ className }), ...props }));
|
|
56
|
+
});
|
|
57
|
+
exports.MentionChip.displayName = "MentionChip";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spec = exports.mentionChipRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// The exact same values `product/richtext`'s own inline "@mention" span
|
|
7
|
+
// uses (`.crisp-rte-mention`, richtext.recipe.ts) — not re-measured against
|
|
8
|
+
// Attio independently (#428's own doc: no live @mention was reachable to
|
|
9
|
+
// read computed styles from, and typing one to create one is off-limits),
|
|
10
|
+
// reused verbatim from the one measured "brand" tag/chip this repo already
|
|
11
|
+
// has (Chip's own `tone="brand"`). Pulled out to its own top-level recipe,
|
|
12
|
+
// rather than importing richtext's, because `.crisp-rte-mention`'s CSS is
|
|
13
|
+
// nested under richtext's own root selector (`&`, i.e. native CSS
|
|
14
|
+
// nesting) — it only resolves inside a mounted `RichTextEditor`. A
|
|
15
|
+
// standalone consumer rendering a mention OUTSIDE an editor (a comment
|
|
16
|
+
// thread, a note preview list) needs the same look with no such ancestor,
|
|
17
|
+
// which is what this recipe is for. Kept deliberately un-pill-shaped (no
|
|
18
|
+
// fixed height, no ring) unlike Chip's own `brand` tone: this reads as
|
|
19
|
+
// tinted text flowing inside a sentence, the same as a live mention does
|
|
20
|
+
// mid-edit, not a standalone tag sitting in its own table cell.
|
|
21
|
+
const spec = (0, core_1.defineSpec)({
|
|
22
|
+
name: "mention-chip",
|
|
23
|
+
base: {
|
|
24
|
+
display: "inline",
|
|
25
|
+
borderRadius: tokens_1.contract.radius.chip,
|
|
26
|
+
paddingInline: tokens_1.contract.space["1"],
|
|
27
|
+
background: `color-mix(in srgb, ${tokens_1.contract.bgBrandSolid} 14%, transparent)`,
|
|
28
|
+
color: `color-mix(in srgb, ${tokens_1.contract.bgBrandSolid} 82%, ${tokens_1.contract.fgPrimary})`,
|
|
29
|
+
fontWeight: tokens_1.contract.weight.medium,
|
|
30
|
+
cursor: "default",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
exports.spec = spec;
|
|
34
|
+
const config = (0, core_1.specToRecipe)(spec);
|
|
35
|
+
exports.mentionChipRecipe = Object.assign((0, core_1.resolveRecipe)(config), {
|
|
36
|
+
config,
|
|
37
|
+
});
|
|
38
|
+
exports.default = config;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./personchip"), exports);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PersonChip = PersonChip;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
const avatar_1 = require("../avatar");
|
|
7
|
+
const chip_1 = require("../chip");
|
|
8
|
+
// The same five hashed avatar tones DataTable's own `avatarTone="hashed"`
|
|
9
|
+
// picks from (datatable.tsx's private `TAG_TONES`, transcribed rather than
|
|
10
|
+
// imported — DataTable owns its own file, and this is a one-line pure
|
|
11
|
+
// function, not a visual value that could drift). `neutral`/`brand` are
|
|
12
|
+
// left out: `neutral` is Avatar's own no-photo default (wrong here, every
|
|
13
|
+
// name needs a colour to tell people apart) and `brand` is reserved for an
|
|
14
|
+
// entity that IS the record a cell points at (`RecordChip`'s own tone),
|
|
15
|
+
// which a person mention never is.
|
|
16
|
+
const HASH_TONES = ["brand", "orange", "cyan", "purple", "green"];
|
|
17
|
+
function hashTone(name) {
|
|
18
|
+
let h = 0;
|
|
19
|
+
for (let i = 0; i < name.length; i++)
|
|
20
|
+
h = (h * 31 + name.charCodeAt(i)) >>> 0;
|
|
21
|
+
return HASH_TONES[h % HASH_TONES.length];
|
|
22
|
+
}
|
|
23
|
+
function initials(name) {
|
|
24
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
25
|
+
if (parts.length === 0)
|
|
26
|
+
return "?";
|
|
27
|
+
return (parts[0][0] + (parts[1]?.[0] ?? "")).toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A person, as a chip: a small avatar (a photo, or hashed-colour initials)
|
|
31
|
+
* plus their name, truncating with an ellipsis when it doesn't fit — Attio's
|
|
32
|
+
* own actor chip (measured live on `techpartners`, Tasks page, "Assigned to"
|
|
33
|
+
* column): a 16px circular avatar in a neutral `Chip`, `gap: 3px` between
|
|
34
|
+
* avatar and name (now `Chip`'s own base — every multi-child `Chip` gets
|
|
35
|
+
* it). Every other value — the pill's height, padding, radius, ring and text
|
|
36
|
+
* — is already `Chip`'s, unchanged; `PersonChip` adds no recipe of its own.
|
|
37
|
+
*
|
|
38
|
+
* Ellipsis only, no `Tooltip` on hover (#623 — no Attio reference for one;
|
|
39
|
+
* a truncated cell there is revealed by its own click-to-expand, #579, a
|
|
40
|
+
* different, DataTable-specific interaction).
|
|
41
|
+
*
|
|
42
|
+
* Composes `Chip`'s `truncate` CSS directly rather than its string-only
|
|
43
|
+
* auto-wrap (children here is an avatar plus a name, not a single string),
|
|
44
|
+
* so the name gets its own `.crisp-chip-label` span while the avatar stays
|
|
45
|
+
* fixed-size.
|
|
46
|
+
*/
|
|
47
|
+
function PersonChip({ name, avatar, muted, className, ...props }) {
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(chip_1.Chip, { tone: "neutral", truncate: true, className: className, ...props, children: [(0, jsx_runtime_1.jsx)(avatar_1.Avatar, { size: "sm", shape: "circle", tone: avatar ? "neutral" : hashTone(name), children: avatar ? (0, jsx_runtime_1.jsx)("img", { src: avatar, alt: "" }) : initials(name) }), (0, jsx_runtime_1.jsx)("span", { className: "crisp-chip-label", style: muted ? { color: tokens_1.contract.fgNeutralMuted } : undefined, children: name })] }));
|
|
49
|
+
}
|
|
50
|
+
PersonChip.displayName = "PersonChip";
|
|
@@ -48,11 +48,11 @@ exports.Table = React.forwardRef(({ interactive, surface, className, wrapperClas
|
|
|
48
48
|
// on the root for the same reason as Textarea: the wrapper is the box a
|
|
49
49
|
// consumer sees and the scroll container they want to size. Native
|
|
50
50
|
// table attributes still reach the <table> below.
|
|
51
|
-
style, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { className: (0, table_recipe_1.tableRecipe)({
|
|
51
|
+
style, tableStyle, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { className: (0, table_recipe_1.tableRecipe)({
|
|
52
52
|
interactive,
|
|
53
53
|
surface,
|
|
54
54
|
className: wrapperClassName,
|
|
55
|
-
}), style: style, children: (0, jsx_runtime_1.jsx)("div", { ...scrollProps, className: `crisp-table-scroll${scrollProps?.className ? ` ${scrollProps.className}` : ""}`, children: (0, jsx_runtime_1.jsx)("table", { ref: ref, className: className, ...props, children: children }) }) })));
|
|
55
|
+
}), style: style, children: (0, jsx_runtime_1.jsx)("div", { ...scrollProps, className: `crisp-table-scroll${scrollProps?.className ? ` ${scrollProps.className}` : ""}`, children: (0, jsx_runtime_1.jsx)("table", { ref: ref, className: className, style: tableStyle, ...props, children: children }) }) })));
|
|
56
56
|
exports.Table.displayName = "Table";
|
|
57
57
|
exports.TableHeader = React.forwardRef((props, ref) => (0, jsx_runtime_1.jsx)("thead", { ref: ref, ...props }));
|
|
58
58
|
exports.TableHeader.displayName = "TableHeader";
|
|
@@ -11,18 +11,30 @@ const tokens_1 = require("../../tokens");
|
|
|
11
11
|
const config = (0, core_1.defineRecipe)({
|
|
12
12
|
name: "table",
|
|
13
13
|
base: `display: block; box-sizing: border-box; background: ${tokens_1.contract.bgSurface};
|
|
14
|
-
|
|
14
|
+
/* #554: both axes -- a consumer bounds the height via \`scrollProps\`
|
|
15
|
+
(style/className on this element), and the header/footer below pin
|
|
16
|
+
inside it exactly the way Attio's own grid does ("Both the header and
|
|
17
|
+
the summary row are sticky, on the scroll container rather than the
|
|
18
|
+
cells" -- docs/study/attio-table.md). Unbounded, \`overflow: auto\`
|
|
19
|
+
shows no vertical scrollbar and nothing sticks, so this is a no-op
|
|
20
|
+
for every existing consumer that never set a height. */
|
|
21
|
+
& .crisp-table-scroll { overflow: auto; }
|
|
15
22
|
& table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: ${tokens_1.contract.font.sans}; font-size: ${tokens_1.contract.text.lg}; color: ${tokens_1.contract.fgPrimary}; }
|
|
16
23
|
/* #465: 12px, not crisp's old 8px -- measured on a live header cell
|
|
17
24
|
(padding: 0 12px) and independently on a body cell's text inset
|
|
18
25
|
(getBoundingClientRect delta from the cell edge). Matches
|
|
19
26
|
ColumnCalc's own already-correct 12px trigger inset. */
|
|
20
27
|
& th, & td { position: relative; height: ${tokens_1.contract.size.tableRow}; padding: 0 ${tokens_1.contract.space["3"]}; border-bottom: 1px solid ${tokens_1.contract.borderSubtle}; border-inline-end: 1px solid ${tokens_1.contract.borderSubtle}; text-align: start; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
21
|
-
|
|
28
|
+
/* #554: sticky on the vertical axis, mirroring RecordsTable's own
|
|
29
|
+
\`.crisp-recordstable-th\`. z-index 2 sits above a plain body cell (auto)
|
|
30
|
+
and below a sticky-column corner cell (DataTable's \`th[data-sticky]\`,
|
|
31
|
+
z-index 3), so the corner always wins. */
|
|
32
|
+
& th { position: sticky; top: 0; z-index: 2; height: ${tokens_1.contract.size.tableHeader}; background: ${tokens_1.contract.bgSurface}; border-top: 1px solid ${tokens_1.contract.borderSubtle}; font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.medium}; letter-spacing: -0.14px; color: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 63%, transparent); user-select: none; }
|
|
22
33
|
& td { color: ${tokens_1.contract.fgPrimary}; background: ${tokens_1.contract.bgSurface}; }
|
|
23
34
|
& th:last-child, & td:last-child { border-inline-end: none; }
|
|
24
35
|
& tbody tr:last-child td { border-bottom: none; }
|
|
25
|
-
|
|
36
|
+
/* #554: sticky to the bottom, mirroring \`.crisp-recordstable-sum\`. */
|
|
37
|
+
& tfoot td { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid ${tokens_1.contract.borderSubtle}; border-bottom: 1px solid ${tokens_1.contract.borderSubtle}; font-weight: ${tokens_1.contract.weight.medium}; color: ${tokens_1.contract.fgMuted}; }
|
|
26
38
|
& caption { padding: ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["2"]}; text-align: start; font-size: ${tokens_1.contract.text.sm}; color: ${tokens_1.contract.fgMuted}; caption-side: bottom; }
|
|
27
39
|
& td[data-align="right"], & th[data-align="right"] { text-align: end; }
|
|
28
40
|
& td[data-align="center"], & th[data-align="center"] { text-align: center; }`,
|
|
@@ -44,7 +44,7 @@ const tabs_keyboard_1 = require("./tabs-keyboard");
|
|
|
44
44
|
* Home/End jump); activation follows focus. Controlled via
|
|
45
45
|
* `value`/`onValueChange`, or uncontrolled from `defaultValue`.
|
|
46
46
|
*/
|
|
47
|
-
function Tabs({ tabs, value, defaultValue, onValueChange, leading, children, className, "aria-label": ariaLabel, ...rest }) {
|
|
47
|
+
function Tabs({ tabs, value, defaultValue, onValueChange, leading, children, className, fill, "aria-label": ariaLabel, ...rest }) {
|
|
48
48
|
// Scoped to this instance: `tab-${value}` and `panel-${value}` are global,
|
|
49
49
|
// so two tab bars sharing a value mint the same id twice and every
|
|
50
50
|
// aria-labelledby resolves to the first one (#227).
|
|
@@ -83,7 +83,7 @@ function Tabs({ tabs, value, defaultValue, onValueChange, leading, children, cla
|
|
|
83
83
|
select,
|
|
84
84
|
listRef,
|
|
85
85
|
});
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tabs_recipe_1.tabsRecipe)({ className }), ...rest, children: [(0, jsx_runtime_1.jsxs)("div", { ref: listRef, className: "crisp-tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && (0, jsx_runtime_1.jsx)("span", { className: "crisp-tabs-leading", children: leading }), tabs.map((t) => {
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tabs_recipe_1.tabsRecipe)({ fill, className }), ...rest, children: [(0, jsx_runtime_1.jsxs)("div", { ref: listRef, className: "crisp-tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && (0, jsx_runtime_1.jsx)("span", { className: "crisp-tabs-leading", children: leading }), tabs.map((t) => {
|
|
87
87
|
const selected = t.value === active;
|
|
88
88
|
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "tab", id: tabId(t.value), "aria-selected": selected, "aria-controls": children && selected ? panelId(t.value) : undefined, tabIndex: tabIndexFor(t.value), "data-value": t.value, "data-selected": selected ? "" : undefined, disabled: t.disabled, className: "crisp-tabs-tab", onClick: () => select(t.value), children: [t.icon, (0, jsx_runtime_1.jsx)("span", { className: "tabs-tab-label", children: t.label }), t.badge != null && ((0, jsx_runtime_1.jsx)("span", { className: "crisp-tabs-tab-badge", children: t.badge }))] }, t.value));
|
|
89
89
|
}), indicator && ((0, jsx_runtime_1.jsx)("span", { className: "crisp-tabs-indicator", style: {
|
|
@@ -15,6 +15,22 @@ const tokens_1 = require("../../tokens");
|
|
|
15
15
|
// a 16px leading icon and an optional count badge. Measured from the live
|
|
16
16
|
// app: bar `padding: 0 12px 8px`, 28px pills, 4/8 padding, 6px icon-label
|
|
17
17
|
// gap, 14/500 labels, 10px badges (rgba(0,0,0,.04)).
|
|
18
|
+
//
|
|
19
|
+
// The panel's own `padding-top` (`c.space["8"]`, 32px) is measured
|
|
20
|
+
// separately, live, on a company record page (Overview tab): the gap from
|
|
21
|
+
// the tab row's own bottom to the content below it (the "Highlights"
|
|
22
|
+
// heading) is a clean 32px with zero margin/padding contributed by either
|
|
23
|
+
// boundary — not the 12px a GRC consumer had been carrying locally, which
|
|
24
|
+
// turned out (checking its own history) to have been measured against that
|
|
25
|
+
// app's own demo rendering, never against Attio itself.
|
|
26
|
+
//
|
|
27
|
+
// The panel is also `display: flex; flex-direction: column` (structural,
|
|
28
|
+
// not measured): a consumer's own content — a table sizing itself to "the
|
|
29
|
+
// rest of the space" — needs a flex-column ancestor with a real height to
|
|
30
|
+
// grow into. A GRC consumer used to supply that itself, wrapping every
|
|
31
|
+
// `children(active)` in its own `<div className="flex h-full min-h-0
|
|
32
|
+
// flex-col">`; dropping that wrapper in favour of `fill` without this would
|
|
33
|
+
// have silently broken every such table the moment the wrapper went away.
|
|
18
34
|
const config = (0, core_1.defineRecipe)({
|
|
19
35
|
name: "tabs",
|
|
20
36
|
base: `
|
|
@@ -32,11 +48,22 @@ const config = (0, core_1.defineRecipe)({
|
|
|
32
48
|
& .crisp-tabs-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 ${tokens_1.contract.space["1"]}; border-radius: ${tokens_1.contract.radius.sm}; background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 6%, transparent); font-size: ${tokens_1.contract.text.xs}; font-weight: ${tokens_1.contract.weight.medium}; color: ${tokens_1.contract.fgMuted}; }
|
|
33
49
|
& .crisp-tabs-tab[data-selected] .crisp-tabs-tab-badge { color: ${tokens_1.contract.fgPrimary}; }
|
|
34
50
|
& .crisp-tabs-indicator { position: absolute; bottom: 0; left: 0; z-index: 1; height: 1px; background: ${tokens_1.contract.fgPrimary}; border-radius: 2px 2px 0 0; transition: transform .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); pointer-events: none; }
|
|
35
|
-
& .crisp-tabs-panel { flex: 1; min-height: 0; }
|
|
51
|
+
& .crisp-tabs-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; padding-top: ${tokens_1.contract.space["8"]}; }
|
|
36
52
|
& .crisp-tabs-panel:focus-visible { outline: none; }
|
|
37
53
|
`,
|
|
38
|
-
variants: {
|
|
39
|
-
|
|
54
|
+
variants: {
|
|
55
|
+
// Opt-in: a `Tabs` dropped into a document-flow layout (a docs page, a
|
|
56
|
+
// demo) should size to its content like anything else. `fill` is for a
|
|
57
|
+
// consumer embedding it in a fixed-height shell — a record page, a full
|
|
58
|
+
// screen — matching the record page's own tab area, which visibly
|
|
59
|
+
// fills all available height (the same live check this file's panel
|
|
60
|
+
// measurement came from).
|
|
61
|
+
fill: {
|
|
62
|
+
true: `height: 100%;`,
|
|
63
|
+
false: "",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: { fill: false },
|
|
40
67
|
compoundVariants: [],
|
|
41
68
|
});
|
|
42
69
|
exports.tabsRecipe = Object.assign((0, core_1.resolveRecipe)(config), { config });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textRecipe = exports.Text = void 0;
|
|
4
|
+
var text_1 = require("./text");
|
|
5
|
+
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.Text; } });
|
|
6
|
+
var text_recipe_1 = require("./text.recipe");
|
|
7
|
+
Object.defineProperty(exports, "textRecipe", { enumerable: true, get: function () { return text_recipe_1.textRecipe; } });
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Text = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const core_1 = require("../../core");
|
|
40
|
+
const text_recipe_1 = require("./text.recipe");
|
|
41
|
+
/**
|
|
42
|
+
* Plain coloured text — `tone="default"` (the app's primary text colour) or
|
|
43
|
+
* `"muted"` — for the runs of text that aren't a Badge, a Chip, a link, or
|
|
44
|
+
* any of crisp's other typed things: a cell's own yes/no, an empty-state
|
|
45
|
+
* caption, a secondary line under a heading. One component so every such
|
|
46
|
+
* spot reaches for crisp's own tokens instead of each hand-writing its own
|
|
47
|
+
* colour utility for the same two values.
|
|
48
|
+
*
|
|
49
|
+
* Renders a `<span>` (inherits its size/weight/line-height from context —
|
|
50
|
+
* see `text.recipe.ts`'s doc for why `Text` sets none of those itself).
|
|
51
|
+
*/
|
|
52
|
+
exports.Text = React.forwardRef(({ tone, className, asChild, children, ...props }, ref) => {
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Primitive.span, { ref: ref, asChild: asChild, className: (0, text_recipe_1.textRecipe)({ tone, className }), ...props, children: children }));
|
|
54
|
+
});
|
|
55
|
+
exports.Text.displayName = "Text";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spec = exports.textRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// No new measurement — `tone` just names two colour tokens every other
|
|
7
|
+
// component already carries (`fgPrimary`/`fgNeutralMuted`), for the plain
|
|
8
|
+
// runs of text that aren't any of crisp's other typed things (a Badge, a
|
|
9
|
+
// Chip, a link). Font size/weight/line-height are deliberately NOT set here:
|
|
10
|
+
// unlike Badge or Chip, plain text has no single measured size across the
|
|
11
|
+
// app (a table cell, a label, a caption are all different sizes) — `Text`
|
|
12
|
+
// inherits type from its context, the same choice `MiddleTruncate` makes for
|
|
13
|
+
// the same reason (see its own doc).
|
|
14
|
+
const spec = (0, core_1.defineSpec)({
|
|
15
|
+
name: "text",
|
|
16
|
+
// `display: inline` -- a span's own default, stated rather than left
|
|
17
|
+
// implicit: an EMPTY base compiles to an empty string, and
|
|
18
|
+
// `core/resolve.ts`'s `if (base) classes.push(prefixedName)` treats that
|
|
19
|
+
// falsy string as "no base rule", which drops the `crisp-text` class
|
|
20
|
+
// itself, silently, from every instance (caught by this file's own
|
|
21
|
+
// tests going red on that exact class).
|
|
22
|
+
base: { display: "inline" },
|
|
23
|
+
variants: {
|
|
24
|
+
tone: {
|
|
25
|
+
default: { color: tokens_1.contract.fgPrimary },
|
|
26
|
+
muted: { color: tokens_1.contract.fgNeutralMuted },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: { tone: "default" },
|
|
30
|
+
});
|
|
31
|
+
exports.spec = spec;
|
|
32
|
+
const config = (0, core_1.specToRecipe)(spec);
|
|
33
|
+
exports.textRecipe = Object.assign((0, core_1.resolveRecipe)(config), { config });
|
|
34
|
+
exports.default = config;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerFloatingLayer = registerFloatingLayer;
|
|
4
4
|
exports.isInsideLaterFloatingLayer = isInsideLaterFloatingLayer;
|
|
5
|
+
exports.hasNestedFloatingLayer = hasNestedFloatingLayer;
|
|
5
6
|
exports.hasOpenFloatingLayer = hasOpenFloatingLayer;
|
|
6
7
|
/**
|
|
7
8
|
* Tracks every currently-open `FloatingPortal` layer, in open order, so a
|
|
@@ -53,6 +54,23 @@ function isInsideLaterFloatingLayer(target, self) {
|
|
|
53
54
|
}
|
|
54
55
|
return false;
|
|
55
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* True when a layer is registered strictly after `self` — i.e. `self` has
|
|
59
|
+
* spawned a still-open nested layer of its own (a row's kebab `Menu` inside
|
|
60
|
+
* `SavedViews`' own panel, e.g.).
|
|
61
|
+
*
|
|
62
|
+
* This is `hasOpenFloatingLayer`'s sibling for a caller that DOES register
|
|
63
|
+
* itself on this stack: `hasOpenFloatingLayer` reads "is the stack
|
|
64
|
+
* non-empty", which is always true for such a caller once its own layer is
|
|
65
|
+
* open — checking that before closing on Escape would defer to itself
|
|
66
|
+
* forever and Escape would never close it. `self`'s own position on the
|
|
67
|
+
* stack has to be excluded from the count, which `hasOpenFloatingLayer`
|
|
68
|
+
* cannot do since it takes no argument.
|
|
69
|
+
*/
|
|
70
|
+
function hasNestedFloatingLayer(self) {
|
|
71
|
+
const selfIndex = self ? stack.indexOf(self) : -1;
|
|
72
|
+
return selfIndex + 1 < stack.length;
|
|
73
|
+
}
|
|
56
74
|
/**
|
|
57
75
|
* True when at least one `Select`/`MultiSelect`/`Menu`/`Popover`/
|
|
58
76
|
* `ContextMenu` is currently open, anywhere (#361).
|
package/dist/cjs/core/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.usePrefersReducedMotion = exports.useMentionTrigger = exports.useLabelAssociation = exports.useFormReset = exports.useFocusAfterRemoval = exports.specToRecipe = exports.defineSpec = exports.resolveRecipe = exports.Primitive = exports.placeFloating = exports.matchMentionTrigger = exports.useCrispMessages = exports.useCrispMessage = exports.useCrispComponentDefaults = exports.CrispMessagesProvider = exports.formValueStyle = exports.registerFloatingLayer = exports.isInsideLaterFloatingLayer = exports.hasOpenFloatingLayer = exports.FloatingPortal = exports.isRtlElement = exports.withDescribedBy = exports.defineRecipe = exports.cx = exports.parseCellDate = exports.formatCellDate = exports.cellDatePrecision = exports.caretRectInField = void 0;
|
|
17
|
+
exports.usePrefersReducedMotion = exports.useMentionTrigger = exports.useLabelAssociation = exports.useFormReset = exports.useFocusAfterRemoval = exports.specToRecipe = exports.defineSpec = exports.resolveRecipe = exports.Primitive = exports.placeFloating = exports.matchMentionTrigger = exports.useCrispMessages = exports.useCrispMessage = exports.useCrispComponentDefaults = exports.CrispMessagesProvider = exports.formValueStyle = exports.registerFloatingLayer = exports.isInsideLaterFloatingLayer = exports.hasOpenFloatingLayer = exports.hasNestedFloatingLayer = exports.FloatingPortal = exports.isRtlElement = exports.withDescribedBy = exports.defineRecipe = exports.cx = exports.parseCellDate = exports.formatCellDate = exports.cellDatePrecision = exports.caretRectInField = void 0;
|
|
18
18
|
var caret_rect_1 = require("./caret-rect");
|
|
19
19
|
Object.defineProperty(exports, "caretRectInField", { enumerable: true, get: function () { return caret_rect_1.caretRectInField; } });
|
|
20
20
|
var cell_date_1 = require("./cell-date");
|
|
@@ -32,6 +32,7 @@ Object.defineProperty(exports, "isRtlElement", { enumerable: true, get: function
|
|
|
32
32
|
var floating_portal_1 = require("./floating-portal");
|
|
33
33
|
Object.defineProperty(exports, "FloatingPortal", { enumerable: true, get: function () { return floating_portal_1.FloatingPortal; } });
|
|
34
34
|
var floating_stack_1 = require("./floating-stack");
|
|
35
|
+
Object.defineProperty(exports, "hasNestedFloatingLayer", { enumerable: true, get: function () { return floating_stack_1.hasNestedFloatingLayer; } });
|
|
35
36
|
Object.defineProperty(exports, "hasOpenFloatingLayer", { enumerable: true, get: function () { return floating_stack_1.hasOpenFloatingLayer; } });
|
|
36
37
|
Object.defineProperty(exports, "isInsideLaterFloatingLayer", { enumerable: true, get: function () { return floating_stack_1.isInsideLaterFloatingLayer; } });
|
|
37
38
|
Object.defineProperty(exports, "registerFloatingLayer", { enumerable: true, get: function () { return floating_stack_1.registerFloatingLayer; } });
|
package/dist/cjs/index.js
CHANGED
|
@@ -49,9 +49,11 @@ __exportStar(require("./components/heatmapchart"), exports);
|
|
|
49
49
|
__exportStar(require("./components/input"), exports);
|
|
50
50
|
__exportStar(require("./components/kbd"), exports);
|
|
51
51
|
__exportStar(require("./components/linechart"), exports);
|
|
52
|
+
__exportStar(require("./components/mentionchip"), exports);
|
|
52
53
|
__exportStar(require("./components/menu"), exports);
|
|
53
54
|
__exportStar(require("./components/middletruncate"), exports);
|
|
54
55
|
__exportStar(require("./components/multiselect"), exports);
|
|
56
|
+
__exportStar(require("./components/personchip"), exports);
|
|
55
57
|
__exportStar(require("./components/popover"), exports);
|
|
56
58
|
__exportStar(require("./components/progress"), exports);
|
|
57
59
|
__exportStar(require("./components/quantitypicker"), exports);
|
|
@@ -69,6 +71,7 @@ __exportStar(require("./components/switch"), exports);
|
|
|
69
71
|
__exportStar(require("./components/table"), exports);
|
|
70
72
|
__exportStar(require("./components/tabletoolbar"), exports);
|
|
71
73
|
__exportStar(require("./components/tabs"), exports);
|
|
74
|
+
__exportStar(require("./components/text"), exports);
|
|
72
75
|
__exportStar(require("./components/textarea"), exports);
|
|
73
76
|
__exportStar(require("./components/textlink"), exports);
|
|
74
77
|
__exportStar(require("./components/timepicker"), exports);
|
|
@@ -88,7 +91,9 @@ __exportStar(require("./product/board"), exports);
|
|
|
88
91
|
__exportStar(require("./product/command"), exports);
|
|
89
92
|
__exportStar(require("./product/entitycard"), exports);
|
|
90
93
|
__exportStar(require("./product/flowcanvas"), exports);
|
|
94
|
+
__exportStar(require("./product/formdialog"), exports);
|
|
91
95
|
__exportStar(require("./product/headerbar"), exports);
|
|
96
|
+
__exportStar(require("./product/importdialog"), exports);
|
|
92
97
|
__exportStar(require("./product/inbox"), exports);
|
|
93
98
|
__exportStar(require("./product/listpage"), exports);
|
|
94
99
|
__exportStar(require("./product/navitem"), exports);
|
|
@@ -97,11 +102,14 @@ __exportStar(require("./product/recordpage"), exports);
|
|
|
97
102
|
__exportStar(require("./product/recordpanel"), exports);
|
|
98
103
|
__exportStar(require("./product/recordstable"), exports);
|
|
99
104
|
__exportStar(require("./product/richtext"), exports);
|
|
105
|
+
__exportStar(require("./product/savedviews"), exports);
|
|
100
106
|
__exportStar(require("./product/settingssection"), exports);
|
|
101
107
|
__exportStar(require("./product/settingsshell"), exports);
|
|
102
108
|
__exportStar(require("./product/sidebar"), exports);
|
|
103
109
|
__exportStar(require("./product/statlist"), exports);
|
|
104
110
|
__exportStar(require("./product/tasklist"), exports);
|
|
111
|
+
__exportStar(require("./product/taskstable"), exports);
|
|
112
|
+
__exportStar(require("./product/themepicker"), exports);
|
|
105
113
|
__exportStar(require("./product/trialbanner"), exports);
|
|
106
114
|
__exportStar(require("./product/viewtoggle"), exports);
|
|
107
115
|
// design tokens + recipe core (for building custom components)
|