@crisp-ui-kit/crisp 0.54.2 → 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 +489 -111
- package/dist/cjs/components/emptystate/emptystate.js +3 -2
- package/dist/cjs/components/emptystate/emptystate.recipe.js +26 -1
- 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/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/index.js +2 -0
- package/dist/cjs/product/headerbar/headerbar.recipe.js +9 -1
- 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/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 +488 -111
- 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/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/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/index.js +2 -0
- package/dist/esm/product/headerbar/headerbar.recipe.js +9 -1
- 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/headerbar.css +1 -1
- package/dist/headerbar.layered.css +1 -1
- 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/styles.css +64 -7
- package/dist/styles.layered.css +64 -7
- package/dist/tabs.css +7 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.layered.css +7 -1
- package/dist/text.css +9 -0
- package/dist/text.d.ts +7 -0
- package/dist/text.layered.css +11 -0
- 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 +28 -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/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/index.d.ts +2 -0
- package/dist/types/product/recordstable/recordstable.d.ts +24 -2
- package/package.json +11 -1
package/dist/chip.css
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
.crisp-chip {
|
|
2
|
-
display: inline-flex; align-items: center; height: var(--crisp-size-chip); padding-inline: var(--crisp-space-1); border-radius: var(--crisp-radius-chip); font-size: var(--crisp-text-lg); line-height: 20px; font-weight: var(--crisp-weight-medium); white-space: nowrap;
|
|
2
|
+
display: inline-flex; align-items: center; gap: 3px; height: var(--crisp-size-chip); min-width: 0; padding-inline: var(--crisp-space-1); border-radius: var(--crisp-radius-chip); font-size: var(--crisp-text-lg); line-height: 20px; font-weight: var(--crisp-weight-medium); white-space: nowrap;
|
|
3
|
+
}
|
|
4
|
+
.crisp-chip--truncate_true {
|
|
5
|
+
& .crisp-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
|
|
6
|
+
}
|
|
7
|
+
.crisp-chip--truncate_false {
|
|
8
|
+
|
|
3
9
|
}
|
|
4
10
|
.crisp-chip--tone_neutral {
|
|
5
11
|
background: color-mix(in srgb, var(--crisp-fg-primary) 6%, transparent); color: color-mix(in srgb, var(--crisp-fg-primary) 82%, transparent); box-shadow: inset 0 0 0 1px var(--crisp-border-subtle);
|
package/dist/chip.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RecipeFn } from "../core/types";
|
|
2
2
|
|
|
3
3
|
export interface ChipVariants {
|
|
4
|
+
truncate?: boolean;
|
|
4
5
|
tone?: "neutral" | "brand" | "success" | "warning" | "danger" | "purple" | "cyan" | "orange";
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
export declare const chipRecipe: RecipeFn<{ tone: { neutral: string; brand: string; success: string; warning: string; danger: string; purple: string; cyan: string; orange: string } }>;
|
|
8
|
+
export declare const chipRecipe: RecipeFn<{ truncate: { true: string; false: string }; tone: { neutral: string; brand: string; success: string; warning: string; danger: string; purple: string; cyan: string; orange: string } }>;
|
package/dist/chip.layered.css
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
@layer crisp-components {
|
|
2
2
|
.crisp-chip {
|
|
3
|
-
display: inline-flex; align-items: center; height: var(--crisp-size-chip); padding-inline: var(--crisp-space-1); border-radius: var(--crisp-radius-chip); font-size: var(--crisp-text-lg); line-height: 20px; font-weight: var(--crisp-weight-medium); white-space: nowrap;
|
|
3
|
+
display: inline-flex; align-items: center; gap: 3px; height: var(--crisp-size-chip); min-width: 0; padding-inline: var(--crisp-space-1); border-radius: var(--crisp-radius-chip); font-size: var(--crisp-text-lg); line-height: 20px; font-weight: var(--crisp-weight-medium); white-space: nowrap;
|
|
4
|
+
}
|
|
5
|
+
.crisp-chip--truncate_true {
|
|
6
|
+
& .crisp-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
|
|
7
|
+
}
|
|
8
|
+
.crisp-chip--truncate_false {
|
|
9
|
+
|
|
4
10
|
}
|
|
5
11
|
.crisp-chip--tone_neutral {
|
|
6
12
|
background: color-mix(in srgb, var(--crisp-fg-primary) 6%, transparent); color: color-mix(in srgb, var(--crisp-fg-primary) 82%, transparent); box-shadow: inset 0 0 0 1px var(--crisp-border-subtle);
|
|
@@ -52,7 +52,8 @@ const chip_recipe_1 = require("./chip.recipe");
|
|
|
52
52
|
* that surface can be measured; don't guess the icon, its hit target, or its
|
|
53
53
|
* spacing from the label.
|
|
54
54
|
*/
|
|
55
|
-
exports.Chip = React.forwardRef(({ tone, className, asChild, children, ...props }, ref) => {
|
|
56
|
-
|
|
55
|
+
exports.Chip = React.forwardRef(({ tone, truncate, className, asChild, children, ...props }, ref) => {
|
|
56
|
+
const content = truncate && !asChild && typeof children === "string" ? ((0, jsx_runtime_1.jsx)("span", { className: "crisp-chip-label", children: children })) : (children);
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Primitive.span, { ref: ref, asChild: asChild, className: (0, chip_recipe_1.chipRecipe)({ tone, truncate, className }), ...props, children: content }));
|
|
57
58
|
});
|
|
58
59
|
exports.Chip.displayName = "Chip";
|
|
@@ -20,7 +20,16 @@ const spec = (0, core_1.defineSpec)({
|
|
|
20
20
|
base: {
|
|
21
21
|
display: "inline-flex",
|
|
22
22
|
alignItems: "center",
|
|
23
|
+
// Measured on Attio's own multi-child chip (Tasks page, "Assigned to"
|
|
24
|
+
// column: a 16px avatar + name in a neutral chip) -- the 3px gap between
|
|
25
|
+
// them. A single plain-text child (the only case before PersonChip) is
|
|
26
|
+
// unaffected, since `gap` does nothing with one flex child.
|
|
27
|
+
gap: "3px",
|
|
23
28
|
height: tokens_1.contract.size.chip,
|
|
29
|
+
// Lets the chip shrink below its content width inside a flex/grid cell
|
|
30
|
+
// -- `inline-flex` items don't by default -- which `truncate` below
|
|
31
|
+
// depends on and any consumer constraining a Chip's width already needs.
|
|
32
|
+
minWidth: 0,
|
|
24
33
|
paddingInline: tokens_1.contract.space["1"],
|
|
25
34
|
borderRadius: tokens_1.contract.radius.chip,
|
|
26
35
|
fontSize: tokens_1.contract.text.lg,
|
|
@@ -29,6 +38,33 @@ const spec = (0, core_1.defineSpec)({
|
|
|
29
38
|
whiteSpace: "nowrap",
|
|
30
39
|
},
|
|
31
40
|
variants: {
|
|
41
|
+
truncate: {
|
|
42
|
+
// Ellipsis + `min-width: 0`, the same convention crisp's own
|
|
43
|
+
// `.crisp-datatable-entity-name`/`.crisp-datatable-th-label` already
|
|
44
|
+
// use for cramped text -- there is no single-overflowing-chip pattern
|
|
45
|
+
// to measure from Attio itself (its multi-value fields show a "+N"
|
|
46
|
+
// badge instead of truncating one chip's own text: Categories,
|
|
47
|
+
// Companies). Targets `.crisp-chip-label`, the inner span `Chip`
|
|
48
|
+
// wraps its string children in when `truncate` is set, not the root
|
|
49
|
+
// -- the root stays a flex row so a leading icon/avatar never shrinks
|
|
50
|
+
// alongside the text.
|
|
51
|
+
true: {
|
|
52
|
+
decls: {},
|
|
53
|
+
parts: [
|
|
54
|
+
{
|
|
55
|
+
selector: "& .crisp-chip-label",
|
|
56
|
+
decls: {
|
|
57
|
+
minWidth: 0,
|
|
58
|
+
overflow: "hidden",
|
|
59
|
+
textOverflow: "ellipsis",
|
|
60
|
+
whiteSpace: "nowrap",
|
|
61
|
+
display: "block",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
false: {},
|
|
67
|
+
},
|
|
32
68
|
tone: {
|
|
33
69
|
neutral: {
|
|
34
70
|
background: soft(tokens_1.contract.fgPrimary, 6),
|
|
@@ -72,7 +108,7 @@ const spec = (0, core_1.defineSpec)({
|
|
|
72
108
|
},
|
|
73
109
|
},
|
|
74
110
|
},
|
|
75
|
-
defaultVariants: { tone: "neutral" },
|
|
111
|
+
defaultVariants: { tone: "neutral", truncate: false },
|
|
76
112
|
});
|
|
77
113
|
exports.spec = spec;
|
|
78
114
|
const config = (0, core_1.specToRecipe)(spec);
|