@crisp-ui-kit/crisp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/accordion.css +13 -0
- package/dist/accordion.d.ts +7 -0
- package/dist/appshell.css +13 -0
- package/dist/appshell.d.ts +7 -0
- package/dist/avatar.css +39 -0
- package/dist/avatar.d.ts +9 -0
- package/dist/avatargroup.css +5 -0
- package/dist/avatargroup.d.ts +7 -0
- package/dist/badge.css +49 -0
- package/dist/badge.d.ts +9 -0
- package/dist/barchart.css +15 -0
- package/dist/barchart.d.ts +7 -0
- package/dist/board.css +17 -0
- package/dist/board.d.ts +7 -0
- package/dist/breadcrumb.css +9 -0
- package/dist/breadcrumb.d.ts +7 -0
- package/dist/button.css +30 -0
- package/dist/button.d.ts +9 -0
- package/dist/callout.css +16 -0
- package/dist/callout.d.ts +7 -0
- package/dist/card.css +20 -0
- package/dist/card.d.ts +8 -0
- package/dist/checkbox.css +3 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/command.css +3 -0
- package/dist/command.d.ts +7 -0
- package/dist/contextmenu.css +12 -0
- package/dist/contextmenu.d.ts +7 -0
- package/dist/datepicker.css +21 -0
- package/dist/datepicker.d.ts +7 -0
- package/dist/dialog.css +19 -0
- package/dist/dialog.d.ts +7 -0
- package/dist/divider.css +5 -0
- package/dist/divider.d.ts +7 -0
- package/dist/donutchart.css +16 -0
- package/dist/donutchart.d.ts +7 -0
- package/dist/drawer.css +17 -0
- package/dist/drawer.d.ts +7 -0
- package/dist/emptystate.css +20 -0
- package/dist/emptystate.d.ts +7 -0
- package/dist/entitycard.css +18 -0
- package/dist/entitycard.d.ts +7 -0
- package/dist/flowcanvas.css +15 -0
- package/dist/flowcanvas.d.ts +7 -0
- package/dist/formfield.css +8 -0
- package/dist/formfield.d.ts +7 -0
- package/dist/inbox.css +31 -0
- package/dist/inbox.d.ts +7 -0
- package/dist/index.js +9653 -0
- package/dist/input.css +15 -0
- package/dist/input.d.ts +8 -0
- package/dist/kbd.css +3 -0
- package/dist/kbd.d.ts +7 -0
- package/dist/linechart.css +15 -0
- package/dist/linechart.d.ts +7 -0
- package/dist/listpage.css +31 -0
- package/dist/listpage.d.ts +7 -0
- package/dist/menu.css +38 -0
- package/dist/menu.d.ts +7 -0
- package/dist/multiselect.css +53 -0
- package/dist/multiselect.d.ts +7 -0
- package/dist/navitem.css +3 -0
- package/dist/navitem.d.ts +7 -0
- package/dist/onboarding.css +29 -0
- package/dist/onboarding.d.ts +7 -0
- package/dist/popover.css +6 -0
- package/dist/popover.d.ts +7 -0
- package/dist/progress.css +7 -0
- package/dist/progress.d.ts +7 -0
- package/dist/radiogroup.css +23 -0
- package/dist/radiogroup.d.ts +7 -0
- package/dist/recordpage.css +141 -0
- package/dist/recordpage.d.ts +7 -0
- package/dist/recordpanel.css +38 -0
- package/dist/recordpanel.d.ts +7 -0
- package/dist/recordstable.css +194 -0
- package/dist/recordstable.d.ts +7 -0
- package/dist/richtext.css +28 -0
- package/dist/richtext.d.ts +7 -0
- package/dist/segmented.css +10 -0
- package/dist/segmented.d.ts +7 -0
- package/dist/select.css +56 -0
- package/dist/select.d.ts +7 -0
- package/dist/settingssection.css +9 -0
- package/dist/settingssection.d.ts +7 -0
- package/dist/settingsshell.css +27 -0
- package/dist/settingsshell.d.ts +7 -0
- package/dist/sidebar.css +3 -0
- package/dist/sidebar.d.ts +7 -0
- package/dist/skeleton.css +5 -0
- package/dist/skeleton.d.ts +7 -0
- package/dist/spinner.css +4 -0
- package/dist/spinner.d.ts +7 -0
- package/dist/stagebar.css +4 -0
- package/dist/stagebar.d.ts +7 -0
- package/dist/statcard.css +13 -0
- package/dist/statcard.d.ts +7 -0
- package/dist/styles.css +1421 -0
- package/dist/switch.css +12 -0
- package/dist/switch.d.ts +7 -0
- package/dist/tabs.css +19 -0
- package/dist/tabs.d.ts +7 -0
- package/dist/tasklist.css +24 -0
- package/dist/tasklist.d.ts +7 -0
- package/dist/textarea.css +20 -0
- package/dist/textarea.d.ts +7 -0
- package/dist/toast.css +17 -0
- package/dist/toast.d.ts +7 -0
- package/dist/tokens.css +70 -0
- package/dist/tooltip.css +3 -0
- package/dist/tooltip.d.ts +7 -0
- package/dist/trialbanner.css +18 -0
- package/dist/trialbanner.d.ts +7 -0
- package/dist/types/components/accordion/accordion.d.ts +23 -0
- package/dist/types/components/accordion/accordion.recipe.d.ts +3 -0
- package/dist/types/components/accordion/index.d.ts +2 -0
- package/dist/types/components/avatar/avatar.d.ts +56 -0
- package/dist/types/components/avatar/avatar.recipe.d.ts +69 -0
- package/dist/types/components/avatar/index.d.ts +2 -0
- package/dist/types/components/avatargroup/avatargroup.d.ts +21 -0
- package/dist/types/components/avatargroup/avatargroup.recipe.d.ts +3 -0
- package/dist/types/components/avatargroup/index.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +57 -0
- package/dist/types/components/badge/badge.recipe.d.ts +64 -0
- package/dist/types/components/badge/index.d.ts +2 -0
- package/dist/types/components/barchart/barchart.d.ts +30 -0
- package/dist/types/components/barchart/barchart.recipe.d.ts +3 -0
- package/dist/types/components/barchart/index.d.ts +2 -0
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +22 -0
- package/dist/types/components/breadcrumb/breadcrumb.recipe.d.ts +3 -0
- package/dist/types/components/breadcrumb/index.d.ts +2 -0
- package/dist/types/components/button/button.d.ts +57 -0
- package/dist/types/components/button/button.recipe.d.ts +63 -0
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/callout/callout.d.ts +20 -0
- package/dist/types/components/callout/callout.recipe.d.ts +3 -0
- package/dist/types/components/callout/index.d.ts +2 -0
- package/dist/types/components/card/card.d.ts +26 -0
- package/dist/types/components/card/card.recipe.d.ts +21 -0
- package/dist/types/components/card/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +17 -0
- package/dist/types/components/checkbox/checkbox.recipe.d.ts +11 -0
- package/dist/types/components/checkbox/index.d.ts +2 -0
- package/dist/types/components/contextmenu/contextmenu.d.ts +27 -0
- package/dist/types/components/contextmenu/contextmenu.recipe.d.ts +3 -0
- package/dist/types/components/contextmenu/index.d.ts +2 -0
- package/dist/types/components/datepicker/datepicker.d.ts +22 -0
- package/dist/types/components/datepicker/datepicker.recipe.d.ts +3 -0
- package/dist/types/components/datepicker/index.d.ts +2 -0
- package/dist/types/components/dialog/dialog.d.ts +30 -0
- package/dist/types/components/dialog/dialog.recipe.d.ts +3 -0
- package/dist/types/components/dialog/index.d.ts +2 -0
- package/dist/types/components/divider/divider.d.ts +9 -0
- package/dist/types/components/divider/divider.recipe.d.ts +3 -0
- package/dist/types/components/divider/index.d.ts +2 -0
- package/dist/types/components/donutchart/donutchart.d.ts +32 -0
- package/dist/types/components/donutchart/donutchart.recipe.d.ts +3 -0
- package/dist/types/components/donutchart/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +26 -0
- package/dist/types/components/drawer/drawer.recipe.d.ts +3 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/emptystate/emptystate.d.ts +19 -0
- package/dist/types/components/emptystate/emptystate.recipe.d.ts +15 -0
- package/dist/types/components/emptystate/index.d.ts +2 -0
- package/dist/types/components/formfield/formfield.d.ts +26 -0
- package/dist/types/components/formfield/formfield.recipe.d.ts +3 -0
- package/dist/types/components/formfield/index.d.ts +2 -0
- package/dist/types/components/input/index.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +32 -0
- package/dist/types/components/input/input.recipe.d.ts +39 -0
- package/dist/types/components/kbd/index.d.ts +2 -0
- package/dist/types/components/kbd/kbd.d.ts +7 -0
- package/dist/types/components/kbd/kbd.recipe.d.ts +12 -0
- package/dist/types/components/linechart/index.d.ts +2 -0
- package/dist/types/components/linechart/linechart.d.ts +35 -0
- package/dist/types/components/linechart/linechart.recipe.d.ts +3 -0
- package/dist/types/components/menu/index.d.ts +2 -0
- package/dist/types/components/menu/menu.d.ts +55 -0
- package/dist/types/components/menu/menu.recipe.d.ts +5 -0
- package/dist/types/components/multiselect/index.d.ts +2 -0
- package/dist/types/components/multiselect/multiselect.d.ts +29 -0
- package/dist/types/components/multiselect/multiselect.recipe.d.ts +5 -0
- package/dist/types/components/popover/index.d.ts +2 -0
- package/dist/types/components/popover/popover.d.ts +23 -0
- package/dist/types/components/popover/popover.recipe.d.ts +3 -0
- package/dist/types/components/progress/index.d.ts +2 -0
- package/dist/types/components/progress/progress.d.ts +19 -0
- package/dist/types/components/progress/progress.recipe.d.ts +3 -0
- package/dist/types/components/radiogroup/index.d.ts +2 -0
- package/dist/types/components/radiogroup/radiogroup.d.ts +35 -0
- package/dist/types/components/radiogroup/radiogroup.recipe.d.ts +5 -0
- package/dist/types/components/segmented/index.d.ts +2 -0
- package/dist/types/components/segmented/segmented.d.ts +27 -0
- package/dist/types/components/segmented/segmented.recipe.d.ts +3 -0
- package/dist/types/components/select/index.d.ts +2 -0
- package/dist/types/components/select/select.d.ts +38 -0
- package/dist/types/components/select/select.recipe.d.ts +20 -0
- package/dist/types/components/skeleton/index.d.ts +2 -0
- package/dist/types/components/skeleton/skeleton.d.ts +13 -0
- package/dist/types/components/skeleton/skeleton.recipe.d.ts +3 -0
- package/dist/types/components/spinner/index.d.ts +2 -0
- package/dist/types/components/spinner/spinner.d.ts +11 -0
- package/dist/types/components/spinner/spinner.recipe.d.ts +3 -0
- package/dist/types/components/stagebar/index.d.ts +2 -0
- package/dist/types/components/stagebar/stagebar.d.ts +20 -0
- package/dist/types/components/stagebar/stagebar.recipe.d.ts +3 -0
- package/dist/types/components/statcard/index.d.ts +2 -0
- package/dist/types/components/statcard/statcard.d.ts +24 -0
- package/dist/types/components/statcard/statcard.recipe.d.ts +3 -0
- package/dist/types/components/switch/index.d.ts +2 -0
- package/dist/types/components/switch/switch.d.ts +19 -0
- package/dist/types/components/switch/switch.recipe.d.ts +14 -0
- package/dist/types/components/tabs/index.d.ts +2 -0
- package/dist/types/components/tabs/tabs.d.ts +33 -0
- package/dist/types/components/tabs/tabs.recipe.d.ts +5 -0
- package/dist/types/components/textarea/index.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +18 -0
- package/dist/types/components/textarea/textarea.recipe.d.ts +5 -0
- package/dist/types/components/toast/index.d.ts +2 -0
- package/dist/types/components/toast/toast.d.ts +31 -0
- package/dist/types/components/toast/toast.recipe.d.ts +3 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/components/tooltip/tooltip.d.ts +21 -0
- package/dist/types/components/tooltip/tooltip.recipe.d.ts +3 -0
- package/dist/types/core/cx.d.ts +1 -0
- package/dist/types/core/define.d.ts +2 -0
- package/dist/types/core/index.d.ts +5 -0
- package/dist/types/core/primitive.d.ts +11 -0
- package/dist/types/core/resolve.d.ts +2 -0
- package/dist/types/core/types.d.ts +33 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/product/appshell/appshell.d.ts +24 -0
- package/dist/types/product/appshell/appshell.recipe.d.ts +10 -0
- package/dist/types/product/appshell/index.d.ts +2 -0
- package/dist/types/product/board/board.d.ts +32 -0
- package/dist/types/product/board/board.recipe.d.ts +3 -0
- package/dist/types/product/board/index.d.ts +2 -0
- package/dist/types/product/command/command.d.ts +29 -0
- package/dist/types/product/command/command.recipe.d.ts +11 -0
- package/dist/types/product/command/index.d.ts +2 -0
- package/dist/types/product/entitycard/entitycard.d.ts +24 -0
- package/dist/types/product/entitycard/entitycard.recipe.d.ts +3 -0
- package/dist/types/product/entitycard/index.d.ts +2 -0
- package/dist/types/product/flowcanvas/flowcanvas.d.ts +32 -0
- package/dist/types/product/flowcanvas/flowcanvas.recipe.d.ts +3 -0
- package/dist/types/product/flowcanvas/index.d.ts +2 -0
- package/dist/types/product/inbox/inbox.d.ts +41 -0
- package/dist/types/product/inbox/inbox.recipe.d.ts +3 -0
- package/dist/types/product/inbox/index.d.ts +2 -0
- package/dist/types/product/listpage/index.d.ts +2 -0
- package/dist/types/product/listpage/listpage.d.ts +46 -0
- package/dist/types/product/listpage/listpage.recipe.d.ts +3 -0
- package/dist/types/product/navitem/index.d.ts +1 -0
- package/dist/types/product/navitem/navitem.d.ts +17 -0
- package/dist/types/product/navitem/navitem.recipe.d.ts +13 -0
- package/dist/types/product/onboarding/index.d.ts +2 -0
- package/dist/types/product/onboarding/onboarding.d.ts +31 -0
- package/dist/types/product/onboarding/onboarding.recipe.d.ts +3 -0
- package/dist/types/product/recordpage/index.d.ts +2 -0
- package/dist/types/product/recordpage/recordpage.d.ts +25 -0
- package/dist/types/product/recordpage/recordpage.recipe.d.ts +5 -0
- package/dist/types/product/recordpanel/index.d.ts +2 -0
- package/dist/types/product/recordpanel/recordpanel.d.ts +19 -0
- package/dist/types/product/recordpanel/recordpanel.recipe.d.ts +10 -0
- package/dist/types/product/recordstable/index.d.ts +2 -0
- package/dist/types/product/recordstable/recordstable.d.ts +63 -0
- package/dist/types/product/recordstable/recordstable.recipe.d.ts +11 -0
- package/dist/types/product/richtext/index.d.ts +2 -0
- package/dist/types/product/richtext/richtext.d.ts +24 -0
- package/dist/types/product/richtext/richtext.recipe.d.ts +3 -0
- package/dist/types/product/settingssection/index.d.ts +2 -0
- package/dist/types/product/settingssection/settingssection.d.ts +18 -0
- package/dist/types/product/settingssection/settingssection.recipe.d.ts +3 -0
- package/dist/types/product/settingsshell/index.d.ts +2 -0
- package/dist/types/product/settingsshell/settingsshell.d.ts +34 -0
- package/dist/types/product/settingsshell/settingsshell.recipe.d.ts +3 -0
- package/dist/types/product/sidebar/index.d.ts +2 -0
- package/dist/types/product/sidebar/sidebar.d.ts +11 -0
- package/dist/types/product/sidebar/sidebar.recipe.d.ts +10 -0
- package/dist/types/product/tasklist/index.d.ts +2 -0
- package/dist/types/product/tasklist/tasklist.d.ts +36 -0
- package/dist/types/product/tasklist/tasklist.recipe.d.ts +3 -0
- package/dist/types/product/trialbanner/index.d.ts +2 -0
- package/dist/types/product/trialbanner/trialbanner.d.ts +21 -0
- package/dist/types/product/trialbanner/trialbanner.recipe.d.ts +3 -0
- package/dist/types/product/viewtoggle/index.d.ts +2 -0
- package/dist/types/product/viewtoggle/viewtoggle.d.ts +24 -0
- package/dist/types/product/viewtoggle/viewtoggle.recipe.d.ts +3 -0
- package/dist/types/tokens/contract.d.ts +27 -0
- package/dist/types/tokens/index.d.ts +5 -0
- package/dist/types/tokens/palette.d.ts +67 -0
- package/dist/types/tokens/scale.d.ts +48 -0
- package/dist/types/tokens/semantic.d.ts +19 -0
- package/dist/viewtoggle.css +13 -0
- package/dist/viewtoggle.d.ts +7 -0
- package/package.json +77 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type IconType = React.ComponentType<{
|
|
3
|
+
size?: number;
|
|
4
|
+
strokeWidth?: number;
|
|
5
|
+
}>;
|
|
6
|
+
export type ColumnType = "entity" | "text" | "tags" | "number" | "url" | "date" | "currency" | "status" | "reference";
|
|
7
|
+
export type StatusOption = {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
color: string;
|
|
11
|
+
};
|
|
12
|
+
export type ReferenceOption = {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
avatar?: string;
|
|
16
|
+
};
|
|
17
|
+
export type Column = {
|
|
18
|
+
key: string;
|
|
19
|
+
label: string;
|
|
20
|
+
type?: ColumnType;
|
|
21
|
+
icon?: IconType;
|
|
22
|
+
width?: number;
|
|
23
|
+
/** Currency symbol for `currency` columns (default "$"). */
|
|
24
|
+
symbol?: string;
|
|
25
|
+
/** Choices for a `status` column (each a coloured dot + label). */
|
|
26
|
+
options?: StatusOption[];
|
|
27
|
+
/** Choices for a `reference` column (a searchable record picker). */
|
|
28
|
+
refOptions?: ReferenceOption[];
|
|
29
|
+
};
|
|
30
|
+
export type EntityValue = {
|
|
31
|
+
name: string;
|
|
32
|
+
avatar?: string;
|
|
33
|
+
};
|
|
34
|
+
export type Row = {
|
|
35
|
+
id: string;
|
|
36
|
+
} & Record<string, any>;
|
|
37
|
+
export type RecordsTableProps = {
|
|
38
|
+
columns?: Column[];
|
|
39
|
+
rows?: Row[];
|
|
40
|
+
/** Controlled selection — omit for self-managed selection state. */
|
|
41
|
+
selectedIds?: string[];
|
|
42
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
43
|
+
/** Show the toolbar's "New" button (hide it when the page provides its own). */
|
|
44
|
+
showNew?: boolean;
|
|
45
|
+
/** Called when a row's open (↗) button is pressed — opens a record panel. */
|
|
46
|
+
onOpenRecord?: (row: Row) => void;
|
|
47
|
+
/** Called when a row's entity name is clicked — navigate to its full record page. */
|
|
48
|
+
onOpenRecordPage?: (row: Row) => void;
|
|
49
|
+
className?: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function tagTone(t: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Attio-style record grid — fully featured. Toolbar (search / sort status /
|
|
54
|
+
* count / New), sticky checkbox + entity columns, 36px rows, typed cells,
|
|
55
|
+
* click-to-sort headers, column resize by dragging a header edge, inline cell
|
|
56
|
+
* editing (double-click a text/number/url/date cell), add-row and add-column,
|
|
57
|
+
* and a floating bulk-action bar (delete / deselect) when rows are selected.
|
|
58
|
+
* Selection can be controlled via `selectedIds`/`onSelectionChange`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function RecordsTable({ columns: columnsProp, rows: rowsProp, selectedIds, onSelectionChange, showNew, onOpenRecord, onOpenRecordPage, className, }: RecordsTableProps): React.JSX.Element;
|
|
61
|
+
export declare const defaultColumns: Column[];
|
|
62
|
+
export declare const defaultRows: Row[];
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const config: import("../..").RecipeConfig<{}>;
|
|
2
|
+
export declare const recordstableRecipe: import("../..").RecipeFn<{}> & {
|
|
3
|
+
config: import("../..").RecipeConfig<{}>;
|
|
4
|
+
meta: {
|
|
5
|
+
row: {
|
|
6
|
+
height: string;
|
|
7
|
+
gridLine: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default config;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type RichTextValue = {
|
|
3
|
+
title: string;
|
|
4
|
+
html: string;
|
|
5
|
+
};
|
|
6
|
+
export type RichTextEditorProps = {
|
|
7
|
+
defaultTitle?: string;
|
|
8
|
+
/** Initial body HTML. */
|
|
9
|
+
defaultHtml?: string;
|
|
10
|
+
titlePlaceholder?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
onChange?: (value: RichTextValue) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A block rich-text editor — measured from Attio's Notes editor. A large title,
|
|
17
|
+
* a prose body (headings, lists, quote, marks, links), and a floating toolbar
|
|
18
|
+
* that appears over a text selection. Built on contentEditable, dependency-free.
|
|
19
|
+
* Uncontrolled: seed with `defaultTitle`/`defaultHtml`, read via `onChange`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function RichTextEditor({ defaultTitle, defaultHtml, titlePlaceholder, placeholder, onChange, className, }: RichTextEditorProps): React.JSX.Element;
|
|
22
|
+
export declare namespace RichTextEditor {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type SettingsSectionProps = {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
/** Trailing action on the title row (e.g. a Button). */
|
|
6
|
+
action?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A settings section — measured from Attio's Settings pages. A title + optional
|
|
12
|
+
* subtitle and trailing action, then a gapped stack of rows (pair with
|
|
13
|
+
* FormField). Compose several inside a settings content pane.
|
|
14
|
+
*/
|
|
15
|
+
export declare function SettingsSection({ title, description, action, children, className, }: SettingsSectionProps): React.JSX.Element;
|
|
16
|
+
export declare namespace SettingsSection {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SettingsNavItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type SettingsNavGroup = {
|
|
8
|
+
/** Group header (omit for an ungrouped block). */
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
items: SettingsNavItem[];
|
|
11
|
+
};
|
|
12
|
+
export type SettingsShellProps = {
|
|
13
|
+
/** Back-header title (default "Settings"). */
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
onBack?: () => void;
|
|
16
|
+
groups: SettingsNavGroup[];
|
|
17
|
+
activeItem: string;
|
|
18
|
+
onSelect: (id: string) => void;
|
|
19
|
+
/** Show the "Search settings…" filter (default true). */
|
|
20
|
+
searchable?: boolean;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
/** The content pane. */
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The Settings layout — measured from Attio's Settings. A left nav (back header,
|
|
28
|
+
* search, grouped items) beside a scrolling content pane. The search filters the
|
|
29
|
+
* nav by label. Fills the height its container gives it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SettingsShell({ title, onBack, groups, activeItem, onSelect, searchable, searchPlaceholder, children, className, }: SettingsShellProps): React.JSX.Element;
|
|
32
|
+
export declare namespace SettingsShell {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SidebarProps = React.ComponentPropsWithoutRef<"nav"> & {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
/** Called when the collapse-panel button in the header is pressed. */
|
|
5
|
+
onToggleCollapse?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
/** Called when the collapse-panel button in the header is pressed. */
|
|
10
|
+
onToggleCollapse?: () => void;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type Task = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
done?: boolean;
|
|
6
|
+
/** Due-date label, e.g. "Due 5 days ago". */
|
|
7
|
+
due?: React.ReactNode;
|
|
8
|
+
/** Render the due date in red (overdue). */
|
|
9
|
+
overdue?: boolean;
|
|
10
|
+
/** Trailing meta (record chip, assignee avatar …), right-aligned. */
|
|
11
|
+
meta?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export type TaskGroup = {
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
tasks: Task[];
|
|
16
|
+
};
|
|
17
|
+
export type TaskListProps = {
|
|
18
|
+
/** Flat list of tasks (use `groups` for grouped sections). */
|
|
19
|
+
tasks?: Task[];
|
|
20
|
+
/** Grouped sections, each with a header + count. */
|
|
21
|
+
groups?: TaskGroup[];
|
|
22
|
+
/** Toggle handler (checkbox). */
|
|
23
|
+
onToggle?: (id: string, done: boolean) => void;
|
|
24
|
+
/** Empty-state text when there are no tasks. */
|
|
25
|
+
emptyLabel?: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A task list — measured from Attio's Tasks page. Optional group headers with a
|
|
30
|
+
* count, then rows of a round complete-checkbox + title + trailing meta.
|
|
31
|
+
* Completed rows strike through; overdue dates go red.
|
|
32
|
+
*/
|
|
33
|
+
export declare function TaskList({ tasks, groups, onToggle, emptyLabel, className, }: TaskListProps): React.JSX.Element;
|
|
34
|
+
export declare namespace TaskList {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type TrialBannerProps = {
|
|
3
|
+
/** Leading icon. */
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
/** The message (children). */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Action label on the right; renders a small pill button (fires onAction). */
|
|
8
|
+
action?: React.ReactNode;
|
|
9
|
+
onAction?: () => void;
|
|
10
|
+
/** Tints the icon (default neutral). */
|
|
11
|
+
tone?: "neutral" | "warning" | "danger";
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A compact trial / upgrade banner — measured from Attio's sidebar footer.
|
|
16
|
+
* Icon + message + an optional small action pill (soft-glow outlined button).
|
|
17
|
+
*/
|
|
18
|
+
export declare function TrialBanner({ icon, children, action, onAction, tone, className, }: TrialBannerProps): React.JSX.Element;
|
|
19
|
+
export declare namespace TrialBanner {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type ViewToggleOption<T extends string = string> = {
|
|
3
|
+
value: T;
|
|
4
|
+
/** Icon shown in the tile. */
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
/** Accessible label. */
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export type ViewToggleProps<T extends string = string> = {
|
|
10
|
+
options: ViewToggleOption<T>[];
|
|
11
|
+
value: T;
|
|
12
|
+
onChange: (value: T) => void;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A compact icon toggle — measured from Attio's list/grid switch. A padded track
|
|
18
|
+
* of icon tiles; the selected tile is raised. Use for view-mode switches (list ⇄
|
|
19
|
+
* grid) or any small mutually-exclusive icon choice.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ViewToggle<T extends string = string>({ options, value, onChange, "aria-label": ariaLabel, className, }: ViewToggleProps<T>): React.JSX.Element;
|
|
22
|
+
export declare namespace ViewToggle {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MapLeafNodes } from "../core/types";
|
|
2
|
+
export type Theme = "light" | "dark";
|
|
3
|
+
export declare const contract: MapLeafNodes<{
|
|
4
|
+
bgBrandSolid: "brand600";
|
|
5
|
+
bgBrandSolidPressed: "brand700";
|
|
6
|
+
fgOnBrand: "white";
|
|
7
|
+
bgSurface: "gray00";
|
|
8
|
+
bgRaised: "gray50";
|
|
9
|
+
borderDefault: "line200";
|
|
10
|
+
borderSubtle: "line100";
|
|
11
|
+
fgPrimary: "gray900";
|
|
12
|
+
fgMuted: "gray400";
|
|
13
|
+
bgDanger: "red600";
|
|
14
|
+
bgSuccess: "green600";
|
|
15
|
+
bgWarning: "amber600";
|
|
16
|
+
bgOrange: "orange600";
|
|
17
|
+
bgCyan: "cyan600";
|
|
18
|
+
bgPurple: "purple600";
|
|
19
|
+
bgSidebar: "graySidebar";
|
|
20
|
+
}, `var(--${string})`> & {
|
|
21
|
+
space: Record<"0.5" | "1" | "1.5" | "2" | "2.5" | "3" | "4" | "5" | "6" | "8" | "px", `var(--${string})`>;
|
|
22
|
+
radius: Record<"2xl" | "full" | "lg" | "md" | "sm" | "xl", `var(--${string})`>;
|
|
23
|
+
size: Record<"header" | "icon" | "row" | "tableRow", `var(--${string})`>;
|
|
24
|
+
font: Record<"sans", `var(--${string})`>;
|
|
25
|
+
text: Record<"lg" | "md" | "sm" | "xl" | "xs", `var(--${string})`>;
|
|
26
|
+
weight: Record<"medium" | "regular" | "semibold", `var(--${string})`>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { contract, type Theme } from "./contract";
|
|
2
|
+
export { palette } from "./palette";
|
|
3
|
+
export { type FontKey, font, type RadiusKey, radius, type SizeKey, type SpaceKey, size, space, type TextKey, text, type WeightKey, weight, } from "./scale";
|
|
4
|
+
export type { Tokens } from "./semantic";
|
|
5
|
+
export { semantic } from "./semantic";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const palette: {
|
|
2
|
+
readonly gray00: {
|
|
3
|
+
readonly light: "#ffffff";
|
|
4
|
+
readonly dark: "#0a0a0a";
|
|
5
|
+
};
|
|
6
|
+
readonly white: {
|
|
7
|
+
readonly light: "#ffffff";
|
|
8
|
+
readonly dark: "#ffffff";
|
|
9
|
+
};
|
|
10
|
+
readonly gray50: {
|
|
11
|
+
readonly light: "#f4f4f5";
|
|
12
|
+
readonly dark: "#101112";
|
|
13
|
+
};
|
|
14
|
+
readonly gray900: {
|
|
15
|
+
readonly light: "#101112";
|
|
16
|
+
readonly dark: "#f5f5f5";
|
|
17
|
+
};
|
|
18
|
+
readonly line200: {
|
|
19
|
+
readonly light: "#e4e4e7";
|
|
20
|
+
readonly dark: "#212224";
|
|
21
|
+
};
|
|
22
|
+
readonly line100: {
|
|
23
|
+
readonly light: "#eeeff1";
|
|
24
|
+
readonly dark: "#1c1d1f";
|
|
25
|
+
};
|
|
26
|
+
readonly gray400: {
|
|
27
|
+
readonly light: "#71717a";
|
|
28
|
+
readonly dark: "#9a9aa2";
|
|
29
|
+
};
|
|
30
|
+
readonly brand600: {
|
|
31
|
+
readonly light: "#266df0";
|
|
32
|
+
readonly dark: "#266df0";
|
|
33
|
+
};
|
|
34
|
+
readonly brand700: {
|
|
35
|
+
readonly light: "#1f5fd6";
|
|
36
|
+
readonly dark: "#1f5fd6";
|
|
37
|
+
};
|
|
38
|
+
readonly red600: {
|
|
39
|
+
readonly light: "#e5484d";
|
|
40
|
+
readonly dark: "#ff5a5f";
|
|
41
|
+
};
|
|
42
|
+
readonly green600: {
|
|
43
|
+
readonly light: "#1f9d57";
|
|
44
|
+
readonly dark: "#2ea968";
|
|
45
|
+
};
|
|
46
|
+
readonly amber600: {
|
|
47
|
+
readonly light: "#b5730f";
|
|
48
|
+
readonly dark: "#e0982a";
|
|
49
|
+
};
|
|
50
|
+
readonly orange600: {
|
|
51
|
+
readonly light: "#f97514";
|
|
52
|
+
readonly dark: "#f97514";
|
|
53
|
+
};
|
|
54
|
+
readonly cyan600: {
|
|
55
|
+
readonly light: "#00b9eb";
|
|
56
|
+
readonly dark: "#00b9eb";
|
|
57
|
+
};
|
|
58
|
+
readonly purple600: {
|
|
59
|
+
readonly light: "#9b69ff";
|
|
60
|
+
readonly dark: "#9b69ff";
|
|
61
|
+
};
|
|
62
|
+
readonly graySidebar: {
|
|
63
|
+
readonly light: "#fbfbfb";
|
|
64
|
+
readonly dark: "#0e0f10";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type PaletteKey = keyof typeof palette;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const space: {
|
|
2
|
+
readonly px: "1px";
|
|
3
|
+
readonly "0.5": "2px";
|
|
4
|
+
readonly "1": "4px";
|
|
5
|
+
readonly "1.5": "6px";
|
|
6
|
+
readonly "2": "8px";
|
|
7
|
+
readonly "2.5": "10px";
|
|
8
|
+
readonly "3": "12px";
|
|
9
|
+
readonly "4": "16px";
|
|
10
|
+
readonly "5": "20px";
|
|
11
|
+
readonly "6": "24px";
|
|
12
|
+
readonly "8": "32px";
|
|
13
|
+
};
|
|
14
|
+
export declare const radius: {
|
|
15
|
+
readonly sm: "6px";
|
|
16
|
+
readonly md: "8px";
|
|
17
|
+
readonly lg: "9px";
|
|
18
|
+
readonly xl: "12px";
|
|
19
|
+
readonly "2xl": "16px";
|
|
20
|
+
readonly full: "999px";
|
|
21
|
+
};
|
|
22
|
+
export declare const size: {
|
|
23
|
+
readonly icon: "16px";
|
|
24
|
+
readonly row: "28px";
|
|
25
|
+
readonly tableRow: "36px";
|
|
26
|
+
readonly header: "48px";
|
|
27
|
+
};
|
|
28
|
+
export declare const font: {
|
|
29
|
+
readonly sans: '"Inter", system-ui, -apple-system, "Segoe UI", sans-serif';
|
|
30
|
+
};
|
|
31
|
+
export declare const text: {
|
|
32
|
+
readonly xs: "11px";
|
|
33
|
+
readonly sm: "12px";
|
|
34
|
+
readonly md: "13px";
|
|
35
|
+
readonly lg: "14px";
|
|
36
|
+
readonly xl: "16px";
|
|
37
|
+
};
|
|
38
|
+
export declare const weight: {
|
|
39
|
+
readonly regular: "400";
|
|
40
|
+
readonly medium: "500";
|
|
41
|
+
readonly semibold: "600";
|
|
42
|
+
};
|
|
43
|
+
export type SpaceKey = keyof typeof space;
|
|
44
|
+
export type RadiusKey = keyof typeof radius;
|
|
45
|
+
export type SizeKey = keyof typeof size;
|
|
46
|
+
export type FontKey = keyof typeof font;
|
|
47
|
+
export type TextKey = keyof typeof text;
|
|
48
|
+
export type WeightKey = keyof typeof weight;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const semantic: {
|
|
2
|
+
bgBrandSolid: "brand600";
|
|
3
|
+
bgBrandSolidPressed: "brand700";
|
|
4
|
+
fgOnBrand: "white";
|
|
5
|
+
bgSurface: "gray00";
|
|
6
|
+
bgRaised: "gray50";
|
|
7
|
+
borderDefault: "line200";
|
|
8
|
+
borderSubtle: "line100";
|
|
9
|
+
fgPrimary: "gray900";
|
|
10
|
+
fgMuted: "gray400";
|
|
11
|
+
bgDanger: "red600";
|
|
12
|
+
bgSuccess: "green600";
|
|
13
|
+
bgWarning: "amber600";
|
|
14
|
+
bgOrange: "orange600";
|
|
15
|
+
bgCyan: "cyan600";
|
|
16
|
+
bgPurple: "purple600";
|
|
17
|
+
bgSidebar: "graySidebar";
|
|
18
|
+
};
|
|
19
|
+
export type Tokens = typeof semantic;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.viewtoggle {
|
|
2
|
+
display: inline-flex; align-items: center; gap: 2px; box-sizing: border-box; padding: 2px;
|
|
3
|
+
border-radius: var(--radius-lg); background: color-mix(in srgb, var(--fg-primary) 5%, transparent);
|
|
4
|
+
font-family: var(--font-sans);
|
|
5
|
+
|
|
6
|
+
& .viewtoggle-tile { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
|
|
7
|
+
padding: 0; margin: 0; border: none; border-radius: var(--radius-md); background: none; color: var(--fg-muted);
|
|
8
|
+
cursor: pointer; transition: background-color .12s, color .12s, box-shadow .12s; }
|
|
9
|
+
& .viewtoggle-tile:hover { color: var(--fg-primary); }
|
|
10
|
+
& .viewtoggle-tile[data-active] { background: var(--bg-surface); color: var(--fg-primary);
|
|
11
|
+
box-shadow: 0 0 2px rgba(28,40,64,0.18), 0 1px 3px rgba(0,0,0,0.04); }
|
|
12
|
+
& .viewtoggle-tile:focus-visible { outline: 2px solid var(--bg-brand-solid); outline-offset: 1px; }
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crisp-ui-kit/crisp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A lean React design system, measured pixel-for-pixel from Attio.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/*.css"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/your-moon/crisp.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/your-moon/crisp#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"react",
|
|
17
|
+
"design-system",
|
|
18
|
+
"components",
|
|
19
|
+
"ui",
|
|
20
|
+
"ui-kit",
|
|
21
|
+
"attio",
|
|
22
|
+
"tokens"
|
|
23
|
+
],
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./styles.css": "./dist/styles.css"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build:css": "bun run build.mjs",
|
|
41
|
+
"build:js": "bun build ./index.ts --outdir dist --format esm --packages external",
|
|
42
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
43
|
+
"build": "bun run build:css && bun run build:js && bun run build:types",
|
|
44
|
+
"prepublishOnly": "bun run build",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"lint": "biome check .",
|
|
47
|
+
"test": "bun test",
|
|
48
|
+
"spec": "bun build/spec-check.mjs"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": ">=18",
|
|
52
|
+
"react-dom": ">=18"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@radix-ui/react-compose-refs": "^1.1.5",
|
|
56
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
57
|
+
"@zag-js/combobox": "^1.43.3",
|
|
58
|
+
"@zag-js/dialog": "^1.43.3",
|
|
59
|
+
"@zag-js/react": "^1.43.3",
|
|
60
|
+
"clsx": "^2.1.1",
|
|
61
|
+
"lucide-react": "^1.34.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@biomejs/biome": "^2.5.10",
|
|
65
|
+
"@happy-dom/global-registrator": "^20.11.6",
|
|
66
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
67
|
+
"@testing-library/react": "^16.3.2",
|
|
68
|
+
"@testing-library/user-event": "^14.6.6",
|
|
69
|
+
"@types/bun": "^1.4.0",
|
|
70
|
+
"@types/react": "^19.2.18",
|
|
71
|
+
"@types/react-dom": "^19.2.5",
|
|
72
|
+
"happy-dom": "^20.11.6",
|
|
73
|
+
"react": "^19.2.8",
|
|
74
|
+
"react-dom": "^19.2.8",
|
|
75
|
+
"typescript": "^7.0.2"
|
|
76
|
+
}
|
|
77
|
+
}
|