@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
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);
|