@crisp-ui-kit/crisp 0.2.0 → 0.7.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/README.md +20 -0
- package/dist/accordion.css +9 -1
- package/dist/appshell.css +12 -4
- package/dist/authshell.css +57 -0
- package/dist/authshell.d.ts +7 -0
- package/dist/avatargroup.css +2 -2
- package/dist/badge.css +4 -4
- package/dist/barchart.css +13 -5
- package/dist/base.css +25 -0
- package/dist/board.css +9 -1
- package/dist/bulkbar.css +11 -3
- package/dist/button.css +16 -2
- package/dist/button.d.ts +2 -1
- package/dist/card.css +8 -0
- package/dist/checkbox.css +17 -1
- package/dist/cjs/components/accordion/accordion.js +69 -0
- package/dist/cjs/components/accordion/accordion.recipe.js +26 -0
- package/dist/cjs/components/accordion/index.js +7 -0
- package/dist/cjs/components/avatar/avatar.js +44 -0
- package/dist/cjs/components/avatar/avatar.recipe.js +42 -0
- package/dist/cjs/components/avatar/index.js +7 -0
- package/dist/cjs/components/avatargroup/avatargroup.js +52 -0
- package/dist/cjs/components/avatargroup/avatargroup.recipe.js +18 -0
- package/dist/cjs/components/avatargroup/index.js +7 -0
- package/dist/cjs/components/badge/badge.js +44 -0
- package/dist/cjs/components/badge/badge.recipe.js +68 -0
- package/dist/cjs/components/badge/index.js +7 -0
- package/dist/cjs/components/barchart/barchart.js +45 -0
- package/dist/cjs/components/barchart/barchart.recipe.js +34 -0
- package/dist/cjs/components/barchart/index.js +7 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.js +53 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.recipe.js +21 -0
- package/dist/cjs/components/breadcrumb/index.js +7 -0
- package/dist/cjs/components/bulkbar/bulkbar.js +53 -0
- package/dist/cjs/components/bulkbar/bulkbar.recipe.js +31 -0
- package/dist/cjs/components/bulkbar/index.js +8 -0
- package/dist/cjs/components/button/button.js +62 -0
- package/dist/cjs/components/button/button.recipe.js +58 -0
- package/dist/cjs/components/button/index.js +7 -0
- package/dist/cjs/components/callout/callout.js +25 -0
- package/dist/cjs/components/callout/callout.recipe.js +29 -0
- package/dist/cjs/components/callout/index.js +7 -0
- package/dist/cjs/components/card/card.js +54 -0
- package/dist/cjs/components/card/card.recipe.js +31 -0
- package/dist/cjs/components/card/index.js +10 -0
- package/dist/cjs/components/checkbox/checkbox.js +56 -0
- package/dist/cjs/components/checkbox/checkbox.recipe.js +34 -0
- package/dist/cjs/components/checkbox/index.js +7 -0
- package/dist/cjs/components/columncalc/columncalc.js +139 -0
- package/dist/cjs/components/columncalc/columncalc.recipe.js +33 -0
- package/dist/cjs/components/columncalc/index.js +10 -0
- package/dist/cjs/components/contextmenu/contextmenu.js +78 -0
- package/dist/cjs/components/contextmenu/contextmenu.recipe.js +24 -0
- package/dist/cjs/components/contextmenu/index.js +7 -0
- package/dist/cjs/components/datatable/datatable.js +508 -0
- package/dist/cjs/components/datatable/datatable.recipe.js +113 -0
- package/dist/cjs/components/datatable/index.js +7 -0
- package/dist/cjs/components/datepicker/datepicker.js +153 -0
- package/dist/cjs/components/datepicker/datepicker.recipe.js +180 -0
- package/dist/cjs/components/datepicker/index.js +19 -0
- package/dist/cjs/components/datepickerfield/datepickerfield.js +85 -0
- package/dist/cjs/components/datepickerfield/datepickerfield.recipe.js +44 -0
- package/dist/cjs/components/datepickerfield/index.js +7 -0
- package/dist/cjs/components/dialog/dialog.js +86 -0
- package/dist/cjs/components/dialog/dialog.recipe.js +35 -0
- package/dist/cjs/components/dialog/index.js +9 -0
- package/dist/cjs/components/divider/divider.js +10 -0
- package/dist/cjs/components/divider/divider.recipe.js +17 -0
- package/dist/cjs/components/divider/index.js +7 -0
- package/dist/cjs/components/donutchart/donutchart.js +41 -0
- package/dist/cjs/components/donutchart/donutchart.recipe.js +30 -0
- package/dist/cjs/components/donutchart/index.js +7 -0
- package/dist/cjs/components/drawer/drawer.js +80 -0
- package/dist/cjs/components/drawer/drawer.recipe.js +30 -0
- package/dist/cjs/components/drawer/index.js +9 -0
- package/dist/cjs/components/emptystate/emptystate.js +10 -0
- package/dist/cjs/components/emptystate/emptystate.recipe.js +34 -0
- package/dist/cjs/components/emptystate/index.js +7 -0
- package/dist/cjs/components/formfield/formfield.js +50 -0
- package/dist/cjs/components/formfield/formfield.recipe.js +22 -0
- package/dist/cjs/components/formfield/index.js +7 -0
- package/dist/cjs/components/input/index.js +7 -0
- package/dist/cjs/components/input/input.js +47 -0
- package/dist/cjs/components/input/input.recipe.js +59 -0
- package/dist/cjs/components/kbd/index.js +7 -0
- package/dist/cjs/components/kbd/kbd.js +44 -0
- package/dist/cjs/components/kbd/kbd.recipe.js +23 -0
- package/dist/cjs/components/linechart/index.js +7 -0
- package/dist/cjs/components/linechart/linechart.js +57 -0
- package/dist/cjs/components/linechart/linechart.recipe.js +35 -0
- package/dist/cjs/components/menu/index.js +14 -0
- package/dist/cjs/components/menu/menu-keyboard.js +117 -0
- package/dist/cjs/components/menu/menu.js +144 -0
- package/dist/cjs/components/menu/menu.recipe.js +54 -0
- package/dist/cjs/components/multiselect/index.js +7 -0
- package/dist/cjs/components/multiselect/multiselect.js +161 -0
- package/dist/cjs/components/multiselect/multiselect.recipe.js +71 -0
- package/dist/cjs/components/popover/index.js +7 -0
- package/dist/cjs/components/popover/popover.js +106 -0
- package/dist/cjs/components/popover/popover.recipe.js +21 -0
- package/dist/cjs/components/progress/index.js +7 -0
- package/dist/cjs/components/progress/progress.js +26 -0
- package/dist/cjs/components/progress/progress.recipe.js +20 -0
- package/dist/cjs/components/radiogroup/index.js +8 -0
- package/dist/cjs/components/radiogroup/radiogroup.js +83 -0
- package/dist/cjs/components/radiogroup/radiogroup.recipe.js +40 -0
- package/dist/cjs/components/resizablepanel/index.js +12 -0
- package/dist/cjs/components/resizablepanel/resizablepanel.js +176 -0
- package/dist/cjs/components/resizablepanel/resizablepanel.recipe.js +69 -0
- package/dist/cjs/components/segmented/index.js +7 -0
- package/dist/cjs/components/segmented/segmented.js +95 -0
- package/dist/cjs/components/segmented/segmented.recipe.js +23 -0
- package/dist/cjs/components/select/index.js +7 -0
- package/dist/cjs/components/select/select.js +180 -0
- package/dist/cjs/components/select/select.recipe.js +79 -0
- package/dist/cjs/components/skeleton/index.js +7 -0
- package/dist/cjs/components/skeleton/skeleton.js +13 -0
- package/dist/cjs/components/skeleton/skeleton.recipe.js +17 -0
- package/dist/cjs/components/spinner/index.js +7 -0
- package/dist/cjs/components/spinner/spinner.js +15 -0
- package/dist/cjs/components/spinner/spinner.recipe.js +16 -0
- package/dist/cjs/components/stagebar/index.js +7 -0
- package/dist/cjs/components/stagebar/stagebar.js +26 -0
- package/dist/cjs/components/stagebar/stagebar.recipe.js +17 -0
- package/dist/cjs/components/statcard/index.js +7 -0
- package/dist/cjs/components/statcard/statcard.js +15 -0
- package/dist/cjs/components/statcard/statcard.recipe.js +37 -0
- package/dist/cjs/components/switch/index.js +7 -0
- package/dist/cjs/components/switch/switch.js +58 -0
- package/dist/cjs/components/switch/switch.recipe.js +29 -0
- package/dist/cjs/components/table/index.js +14 -0
- package/dist/cjs/components/table/table.js +66 -0
- package/dist/cjs/components/table/table.recipe.js +43 -0
- package/dist/cjs/components/tabletoolbar/index.js +20 -0
- package/dist/cjs/components/tabletoolbar/tabletoolbar.chrome.js +84 -0
- package/dist/cjs/components/tabletoolbar/tabletoolbar.js +237 -0
- package/dist/cjs/components/tabletoolbar/tabletoolbar.recipe.js +26 -0
- package/dist/cjs/components/tabs/index.js +7 -0
- package/dist/cjs/components/tabs/tabs.js +106 -0
- package/dist/cjs/components/tabs/tabs.recipe.js +36 -0
- package/dist/cjs/components/textarea/index.js +7 -0
- package/dist/cjs/components/textarea/textarea.js +56 -0
- package/dist/cjs/components/textarea/textarea.recipe.js +46 -0
- package/dist/cjs/components/toast/index.js +8 -0
- package/dist/cjs/components/toast/toast.js +95 -0
- package/dist/cjs/components/toast/toast.recipe.js +31 -0
- package/dist/cjs/components/tooltip/index.js +7 -0
- package/dist/cjs/components/tooltip/tooltip.js +95 -0
- package/dist/cjs/components/tooltip/tooltip.recipe.js +16 -0
- package/dist/cjs/components/wheelpicker/index.js +7 -0
- package/dist/cjs/components/wheelpicker/wheelpicker.js +134 -0
- package/dist/cjs/components/wheelpicker/wheelpicker.recipe.js +95 -0
- package/dist/cjs/core/cx.js +8 -0
- package/dist/cjs/core/define.js +6 -0
- package/dist/cjs/core/index.js +11 -0
- package/dist/cjs/core/primitive.js +49 -0
- package/dist/cjs/core/resolve.js +44 -0
- package/dist/cjs/core/types.js +2 -0
- package/dist/cjs/index.js +92 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/product/appshell/appshell.js +104 -0
- package/dist/cjs/product/appshell/appshell.recipe.js +30 -0
- package/dist/cjs/product/appshell/index.js +7 -0
- package/dist/cjs/product/authshell/authshell.js +21 -0
- package/dist/cjs/product/authshell/authshell.recipe.js +67 -0
- package/dist/cjs/product/authshell/index.js +7 -0
- package/dist/cjs/product/board/board.js +78 -0
- package/dist/cjs/product/board/board.recipe.js +31 -0
- package/dist/cjs/product/board/index.js +7 -0
- package/dist/cjs/product/command/command.js +238 -0
- package/dist/cjs/product/command/command.recipe.js +47 -0
- package/dist/cjs/product/command/index.js +8 -0
- package/dist/cjs/product/entitycard/entitycard.js +14 -0
- package/dist/cjs/product/entitycard/entitycard.recipe.js +32 -0
- package/dist/cjs/product/entitycard/index.js +7 -0
- package/dist/cjs/product/flowcanvas/flowcanvas.js +121 -0
- package/dist/cjs/product/flowcanvas/flowcanvas.recipe.js +28 -0
- package/dist/cjs/product/flowcanvas/index.js +7 -0
- package/dist/cjs/product/inbox/inbox.js +16 -0
- package/dist/cjs/product/inbox/inbox.recipe.js +46 -0
- package/dist/cjs/product/inbox/index.js +7 -0
- package/dist/cjs/product/listpage/index.js +8 -0
- package/dist/cjs/product/listpage/listpage.js +25 -0
- package/dist/cjs/product/listpage/listpage.recipe.js +46 -0
- package/dist/cjs/product/navitem/index.js +5 -0
- package/dist/cjs/product/navitem/navitem.js +44 -0
- package/dist/cjs/product/navitem/navitem.recipe.js +36 -0
- package/dist/cjs/product/onboarding/index.js +7 -0
- package/dist/cjs/product/onboarding/onboarding.js +17 -0
- package/dist/cjs/product/onboarding/onboarding.recipe.js +44 -0
- package/dist/cjs/product/recordpage/index.js +7 -0
- package/dist/cjs/product/recordpage/recordpage.js +409 -0
- package/dist/cjs/product/recordpage/recordpage.recipe.js +162 -0
- package/dist/cjs/product/recordpanel/index.js +7 -0
- package/dist/cjs/product/recordpanel/recordpanel.js +83 -0
- package/dist/cjs/product/recordpanel/recordpanel.recipe.js +51 -0
- package/dist/cjs/product/recordstable/company-logos.js +29 -0
- package/dist/cjs/product/recordstable/index.js +10 -0
- package/dist/cjs/product/recordstable/recordstable.js +1092 -0
- package/dist/cjs/product/recordstable/recordstable.recipe.js +152 -0
- package/dist/cjs/product/recordstable/recordstable.tag.js +21 -0
- package/dist/cjs/product/richtext/index.js +7 -0
- package/dist/cjs/product/richtext/richtext.js +147 -0
- package/dist/cjs/product/richtext/richtext.recipe.js +43 -0
- package/dist/cjs/product/settingssection/index.js +7 -0
- package/dist/cjs/product/settingssection/settingssection.js +14 -0
- package/dist/cjs/product/settingssection/settingssection.recipe.js +23 -0
- package/dist/cjs/product/settingsshell/index.js +7 -0
- package/dist/cjs/product/settingsshell/settingsshell.js +59 -0
- package/dist/cjs/product/settingsshell/settingsshell.recipe.js +46 -0
- package/dist/cjs/product/sidebar/index.js +13 -0
- package/dist/cjs/product/sidebar/sidebar.js +148 -0
- package/dist/cjs/product/sidebar/sidebar.recipe.js +46 -0
- package/dist/cjs/product/tasklist/index.js +7 -0
- package/dist/cjs/product/tasklist/tasklist.js +19 -0
- package/dist/cjs/product/tasklist/tasklist.recipe.js +38 -0
- package/dist/cjs/product/trialbanner/index.js +7 -0
- package/dist/cjs/product/trialbanner/trialbanner.js +13 -0
- package/dist/cjs/product/trialbanner/trialbanner.recipe.js +32 -0
- package/dist/cjs/product/viewtoggle/index.js +7 -0
- package/dist/cjs/product/viewtoggle/viewtoggle.js +55 -0
- package/dist/cjs/product/viewtoggle/viewtoggle.recipe.js +27 -0
- package/dist/cjs/tokens/contract.js +21 -0
- package/dist/cjs/tokens/elevation.js +47 -0
- package/dist/cjs/tokens/index.js +18 -0
- package/dist/cjs/tokens/palette.js +63 -0
- package/dist/cjs/tokens/scale.js +70 -0
- package/dist/cjs/tokens/semantic.js +57 -0
- package/dist/columncalc.css +26 -0
- package/dist/columncalc.d.ts +7 -0
- package/dist/command.css +34 -1
- package/dist/contextmenu.css +11 -3
- package/dist/datatable.css +106 -0
- package/dist/datatable.d.ts +7 -0
- package/dist/datepicker.css +165 -19
- package/dist/datepicker.d.ts +2 -2
- package/dist/datepickerfield.css +27 -0
- package/dist/datepickerfield.d.ts +7 -0
- package/dist/dialog.css +11 -3
- package/dist/donutchart.css +8 -0
- package/dist/drawer.css +13 -5
- package/dist/entitycard.css +10 -2
- package/dist/esm/components/accordion/accordion.js +33 -0
- package/dist/esm/components/accordion/accordion.recipe.js +23 -0
- package/dist/esm/components/accordion/index.js +2 -0
- package/dist/esm/components/avatar/avatar.js +8 -0
- package/dist/esm/components/avatar/avatar.recipe.js +39 -0
- package/dist/esm/components/avatar/index.js +2 -0
- package/dist/esm/components/avatargroup/avatargroup.js +16 -0
- package/dist/esm/components/avatargroup/avatargroup.recipe.js +15 -0
- package/dist/esm/components/avatargroup/index.js +2 -0
- package/dist/esm/components/badge/badge.js +8 -0
- package/dist/esm/components/badge/badge.recipe.js +65 -0
- package/dist/esm/components/badge/index.js +2 -0
- package/dist/esm/components/barchart/barchart.js +42 -0
- package/dist/esm/components/barchart/barchart.recipe.js +31 -0
- package/dist/esm/components/barchart/index.js +2 -0
- package/dist/esm/components/breadcrumb/breadcrumb.js +17 -0
- package/dist/esm/components/breadcrumb/breadcrumb.recipe.js +18 -0
- package/dist/esm/components/breadcrumb/index.js +2 -0
- package/dist/esm/components/bulkbar/bulkbar.js +16 -0
- package/dist/esm/components/bulkbar/bulkbar.recipe.js +28 -0
- package/dist/esm/components/bulkbar/index.js +2 -0
- package/dist/esm/components/button/button.js +26 -0
- package/dist/esm/components/button/button.recipe.js +55 -0
- package/dist/esm/components/button/index.js +2 -0
- package/dist/esm/components/callout/callout.js +22 -0
- package/dist/esm/components/callout/callout.recipe.js +26 -0
- package/dist/esm/components/callout/index.js +2 -0
- package/dist/esm/components/card/card.js +15 -0
- package/dist/esm/components/card/card.recipe.js +28 -0
- package/dist/esm/components/card/index.js +2 -0
- package/dist/esm/components/checkbox/checkbox.js +20 -0
- package/dist/esm/components/checkbox/checkbox.recipe.js +31 -0
- package/dist/esm/components/checkbox/index.js +2 -0
- package/dist/esm/components/columncalc/columncalc.js +100 -0
- package/dist/esm/components/columncalc/columncalc.recipe.js +30 -0
- package/dist/esm/components/columncalc/index.js +1 -0
- package/dist/esm/components/contextmenu/contextmenu.js +42 -0
- package/dist/esm/components/contextmenu/contextmenu.recipe.js +21 -0
- package/dist/esm/components/contextmenu/index.js +2 -0
- package/dist/esm/components/datatable/datatable.js +472 -0
- package/dist/esm/components/datatable/datatable.recipe.js +110 -0
- package/dist/esm/components/datatable/index.js +2 -0
- package/dist/esm/components/datepicker/datepicker.js +108 -0
- package/dist/esm/components/datepicker/datepicker.recipe.js +177 -0
- package/dist/esm/components/datepicker/index.js +2 -0
- package/dist/esm/components/datepickerfield/datepickerfield.js +49 -0
- package/dist/esm/components/datepickerfield/datepickerfield.recipe.js +41 -0
- package/dist/esm/components/datepickerfield/index.js +2 -0
- package/dist/esm/components/dialog/dialog.js +48 -0
- package/dist/esm/components/dialog/dialog.recipe.js +32 -0
- package/dist/esm/components/dialog/index.js +2 -0
- package/dist/esm/components/divider/divider.js +7 -0
- package/dist/esm/components/divider/divider.recipe.js +14 -0
- package/dist/esm/components/divider/index.js +2 -0
- package/dist/esm/components/donutchart/donutchart.js +38 -0
- package/dist/esm/components/donutchart/donutchart.recipe.js +27 -0
- package/dist/esm/components/donutchart/index.js +2 -0
- package/dist/esm/components/drawer/drawer.js +42 -0
- package/dist/esm/components/drawer/drawer.recipe.js +27 -0
- package/dist/esm/components/drawer/index.js +2 -0
- package/dist/esm/components/emptystate/emptystate.js +7 -0
- package/dist/esm/components/emptystate/emptystate.recipe.js +31 -0
- package/dist/esm/components/emptystate/index.js +2 -0
- package/dist/esm/components/formfield/formfield.js +14 -0
- package/dist/esm/components/formfield/formfield.recipe.js +19 -0
- package/dist/esm/components/formfield/index.js +2 -0
- package/dist/esm/components/input/index.js +2 -0
- package/dist/esm/components/input/input.js +11 -0
- package/dist/esm/components/input/input.recipe.js +56 -0
- package/dist/esm/components/kbd/index.js +2 -0
- package/dist/esm/components/kbd/kbd.js +8 -0
- package/dist/esm/components/kbd/kbd.recipe.js +20 -0
- package/dist/esm/components/linechart/index.js +2 -0
- package/dist/esm/components/linechart/linechart.js +54 -0
- package/dist/esm/components/linechart/linechart.recipe.js +32 -0
- package/dist/esm/components/menu/index.js +3 -0
- package/dist/esm/components/menu/menu-keyboard.js +80 -0
- package/dist/esm/components/menu/menu.js +104 -0
- package/dist/esm/components/menu/menu.recipe.js +51 -0
- package/dist/esm/components/multiselect/index.js +2 -0
- package/dist/esm/components/multiselect/multiselect.js +125 -0
- package/dist/esm/components/multiselect/multiselect.recipe.js +68 -0
- package/dist/esm/components/popover/index.js +2 -0
- package/dist/esm/components/popover/popover.js +70 -0
- package/dist/esm/components/popover/popover.recipe.js +18 -0
- package/dist/esm/components/progress/index.js +2 -0
- package/dist/esm/components/progress/progress.js +23 -0
- package/dist/esm/components/progress/progress.recipe.js +17 -0
- package/dist/esm/components/radiogroup/index.js +2 -0
- package/dist/esm/components/radiogroup/radiogroup.js +46 -0
- package/dist/esm/components/radiogroup/radiogroup.recipe.js +37 -0
- package/dist/esm/components/resizablepanel/index.js +2 -0
- package/dist/esm/components/resizablepanel/resizablepanel.js +135 -0
- package/dist/esm/components/resizablepanel/resizablepanel.recipe.js +66 -0
- package/dist/esm/components/segmented/index.js +2 -0
- package/dist/esm/components/segmented/segmented.js +59 -0
- package/dist/esm/components/segmented/segmented.recipe.js +20 -0
- package/dist/esm/components/select/index.js +2 -0
- package/dist/esm/components/select/select.js +144 -0
- package/dist/esm/components/select/select.recipe.js +76 -0
- package/dist/esm/components/skeleton/index.js +2 -0
- package/dist/esm/components/skeleton/skeleton.js +10 -0
- package/dist/esm/components/skeleton/skeleton.recipe.js +14 -0
- package/dist/esm/components/spinner/index.js +2 -0
- package/dist/esm/components/spinner/spinner.js +12 -0
- package/dist/esm/components/spinner/spinner.recipe.js +13 -0
- package/dist/esm/components/stagebar/index.js +2 -0
- package/dist/esm/components/stagebar/stagebar.js +23 -0
- package/dist/esm/components/stagebar/stagebar.recipe.js +14 -0
- package/dist/esm/components/statcard/index.js +2 -0
- package/dist/esm/components/statcard/statcard.js +12 -0
- package/dist/esm/components/statcard/statcard.recipe.js +34 -0
- package/dist/esm/components/switch/index.js +2 -0
- package/dist/esm/components/switch/switch.js +22 -0
- package/dist/esm/components/switch/switch.recipe.js +26 -0
- package/dist/esm/components/table/index.js +2 -0
- package/dist/esm/components/table/table.js +30 -0
- package/dist/esm/components/table/table.recipe.js +40 -0
- package/dist/esm/components/tabletoolbar/index.js +2 -0
- package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +79 -0
- package/dist/esm/components/tabletoolbar/tabletoolbar.js +199 -0
- package/dist/esm/components/tabletoolbar/tabletoolbar.recipe.js +23 -0
- package/dist/esm/components/tabs/index.js +2 -0
- package/dist/esm/components/tabs/tabs.js +70 -0
- package/dist/esm/components/tabs/tabs.recipe.js +33 -0
- package/dist/esm/components/textarea/index.js +2 -0
- package/dist/esm/components/textarea/textarea.js +20 -0
- package/dist/esm/components/textarea/textarea.recipe.js +43 -0
- package/dist/esm/components/toast/index.js +2 -0
- package/dist/esm/components/toast/toast.js +58 -0
- package/dist/esm/components/toast/toast.recipe.js +28 -0
- package/dist/esm/components/tooltip/index.js +2 -0
- package/dist/esm/components/tooltip/tooltip.js +59 -0
- package/dist/esm/components/tooltip/tooltip.recipe.js +13 -0
- package/dist/esm/components/wheelpicker/index.js +2 -0
- package/dist/esm/components/wheelpicker/wheelpicker.js +98 -0
- package/dist/esm/components/wheelpicker/wheelpicker.recipe.js +92 -0
- package/dist/esm/core/cx.js +1 -0
- package/dist/esm/core/define.js +3 -0
- package/dist/esm/core/index.js +4 -0
- package/dist/esm/core/primitive.js +13 -0
- package/dist/esm/core/resolve.js +41 -0
- package/dist/esm/core/types.js +1 -0
- package/dist/esm/index.js +76 -0
- package/dist/esm/product/appshell/appshell.js +68 -0
- package/dist/esm/product/appshell/appshell.recipe.js +27 -0
- package/dist/esm/product/appshell/index.js +2 -0
- package/dist/esm/product/authshell/authshell.js +18 -0
- package/dist/esm/product/authshell/authshell.recipe.js +64 -0
- package/dist/esm/product/authshell/index.js +2 -0
- package/dist/esm/product/board/board.js +42 -0
- package/dist/esm/product/board/board.recipe.js +28 -0
- package/dist/esm/product/board/index.js +2 -0
- package/dist/esm/product/command/command.js +201 -0
- package/dist/esm/product/command/command.recipe.js +44 -0
- package/dist/esm/product/command/index.js +2 -0
- package/dist/esm/product/entitycard/entitycard.js +11 -0
- package/dist/esm/product/entitycard/entitycard.recipe.js +29 -0
- package/dist/esm/product/entitycard/index.js +2 -0
- package/dist/esm/product/flowcanvas/flowcanvas.js +85 -0
- package/dist/esm/product/flowcanvas/flowcanvas.recipe.js +25 -0
- package/dist/esm/product/flowcanvas/index.js +2 -0
- package/dist/esm/product/inbox/inbox.js +13 -0
- package/dist/esm/product/inbox/inbox.recipe.js +43 -0
- package/dist/esm/product/inbox/index.js +2 -0
- package/dist/esm/product/listpage/index.js +2 -0
- package/dist/esm/product/listpage/listpage.js +21 -0
- package/dist/esm/product/listpage/listpage.recipe.js +43 -0
- package/dist/esm/product/navitem/index.js +1 -0
- package/dist/esm/product/navitem/navitem.js +8 -0
- package/dist/esm/product/navitem/navitem.recipe.js +33 -0
- package/dist/esm/product/onboarding/index.js +2 -0
- package/dist/esm/product/onboarding/onboarding.js +14 -0
- package/dist/esm/product/onboarding/onboarding.recipe.js +41 -0
- package/dist/esm/product/recordpage/index.js +2 -0
- package/dist/esm/product/recordpage/recordpage.js +372 -0
- package/dist/esm/product/recordpage/recordpage.recipe.js +159 -0
- package/dist/esm/product/recordpanel/index.js +2 -0
- package/dist/esm/product/recordpanel/recordpanel.js +47 -0
- package/dist/esm/product/recordpanel/recordpanel.recipe.js +48 -0
- package/dist/esm/product/recordstable/company-logos.js +26 -0
- package/dist/esm/product/recordstable/index.js +2 -0
- package/dist/esm/product/recordstable/recordstable.js +1054 -0
- package/dist/esm/product/recordstable/recordstable.recipe.js +149 -0
- package/dist/esm/product/recordstable/recordstable.tag.js +18 -0
- package/dist/esm/product/richtext/index.js +2 -0
- package/dist/esm/product/richtext/richtext.js +111 -0
- package/dist/esm/product/richtext/richtext.recipe.js +40 -0
- package/dist/esm/product/settingssection/index.js +2 -0
- package/dist/esm/product/settingssection/settingssection.js +11 -0
- package/dist/esm/product/settingssection/settingssection.recipe.js +20 -0
- package/dist/esm/product/settingsshell/index.js +2 -0
- package/dist/esm/product/settingsshell/settingsshell.js +23 -0
- package/dist/esm/product/settingsshell/settingsshell.recipe.js +43 -0
- package/dist/esm/product/sidebar/index.js +2 -0
- package/dist/esm/product/sidebar/sidebar.js +112 -0
- package/dist/esm/product/sidebar/sidebar.recipe.js +43 -0
- package/dist/esm/product/tasklist/index.js +2 -0
- package/dist/esm/product/tasklist/tasklist.js +16 -0
- package/dist/esm/product/tasklist/tasklist.recipe.js +35 -0
- package/dist/esm/product/trialbanner/index.js +2 -0
- package/dist/esm/product/trialbanner/trialbanner.js +10 -0
- package/dist/esm/product/trialbanner/trialbanner.recipe.js +29 -0
- package/dist/esm/product/viewtoggle/index.js +2 -0
- package/dist/esm/product/viewtoggle/viewtoggle.js +19 -0
- package/dist/esm/product/viewtoggle/viewtoggle.recipe.js +24 -0
- package/dist/esm/tokens/contract.js +18 -0
- package/dist/esm/tokens/elevation.js +44 -0
- package/dist/esm/tokens/index.js +5 -0
- package/dist/esm/tokens/palette.js +60 -0
- package/dist/esm/tokens/scale.js +67 -0
- package/dist/esm/tokens/semantic.js +54 -0
- package/dist/inbox.css +9 -1
- package/dist/input.css +32 -4
- package/dist/linechart.css +5 -5
- package/dist/listpage.css +11 -3
- package/dist/menu.css +13 -5
- package/dist/multiselect.css +17 -9
- package/dist/native/tokens.d.ts +16 -0
- package/dist/native/tokens.js +221 -0
- package/dist/navitem.css +21 -1
- package/dist/onboarding.css +10 -2
- package/dist/popover.css +9 -1
- package/dist/progress.css +8 -0
- package/dist/radiogroup.css +9 -1
- package/dist/recordpage.css +26 -16
- package/dist/recordpanel.css +25 -15
- package/dist/recordstable.css +41 -27
- package/dist/resizablepanel.css +53 -0
- package/dist/resizablepanel.d.ts +7 -0
- package/dist/richtext.css +11 -3
- package/dist/segmented.css +8 -0
- package/dist/select.css +22 -8
- package/dist/select.d.ts +2 -1
- package/dist/settingsshell.css +15 -2
- package/dist/sidebar.css +34 -1
- package/dist/skeleton.css +8 -0
- package/dist/spinner.css +8 -0
- package/dist/stagebar.css +8 -0
- package/dist/statcard.css +6 -0
- package/dist/statcard.d.ts +2 -2
- package/dist/styles.css +2134 -999
- package/dist/switch.css +8 -0
- package/dist/table.css +34 -0
- package/dist/table.d.ts +8 -0
- package/dist/tabletoolbar.css +78 -0
- package/dist/tabletoolbar.d.ts +7 -0
- package/dist/tabs.css +12 -4
- package/dist/tasklist.css +8 -0
- package/dist/textarea.css +23 -3
- package/dist/toast.css +10 -2
- package/dist/tokens.css +53 -0
- package/dist/tokens.json +217 -0
- package/dist/tooltip.css +8 -0
- package/dist/trialbanner.css +8 -0
- package/dist/types/components/accordion/accordion.d.ts +10 -8
- package/dist/types/components/avatargroup/avatargroup.d.ts +2 -2
- package/dist/types/components/barchart/barchart.d.ts +4 -2
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/types/components/bulkbar/bulkbar.d.ts +4 -2
- package/dist/types/components/button/button.d.ts +8 -0
- package/dist/types/components/button/button.recipe.d.ts +12 -0
- package/dist/types/components/callout/callout.d.ts +2 -2
- package/dist/types/components/columncalc/columncalc.d.ts +49 -0
- package/dist/types/components/columncalc/columncalc.recipe.d.ts +3 -0
- package/dist/types/components/columncalc/index.d.ts +1 -0
- package/dist/types/components/datatable/datatable.d.ts +153 -0
- package/dist/types/components/datatable/datatable.recipe.d.ts +3 -0
- package/dist/types/components/datatable/index.d.ts +2 -0
- package/dist/types/components/datepicker/datepicker.d.ts +41 -18
- package/dist/types/components/datepicker/datepicker.recipe.d.ts +25 -2
- package/dist/types/components/datepicker/index.d.ts +1 -1
- package/dist/types/components/datepickerfield/datepickerfield.d.ts +35 -0
- package/dist/types/components/datepickerfield/datepickerfield.recipe.d.ts +5 -0
- package/dist/types/components/datepickerfield/index.d.ts +2 -0
- package/dist/types/components/dialog/dialog.d.ts +3 -1
- package/dist/types/components/divider/divider.d.ts +2 -2
- package/dist/types/components/donutchart/donutchart.d.ts +2 -2
- package/dist/types/components/drawer/drawer.d.ts +3 -1
- package/dist/types/components/emptystate/emptystate.d.ts +2 -2
- package/dist/types/components/formfield/formfield.d.ts +7 -4
- package/dist/types/components/input/input.d.ts +8 -2
- package/dist/types/components/linechart/linechart.d.ts +4 -2
- package/dist/types/components/menu/index.d.ts +1 -0
- package/dist/types/components/menu/menu-keyboard.d.ts +33 -0
- package/dist/types/components/menu/menu.d.ts +7 -1
- package/dist/types/components/multiselect/multiselect.d.ts +8 -4
- package/dist/types/components/popover/popover.d.ts +4 -1
- package/dist/types/components/progress/progress.d.ts +2 -2
- package/dist/types/components/radiogroup/radiogroup.d.ts +2 -2
- package/dist/types/components/resizablepanel/index.d.ts +2 -0
- package/dist/types/components/resizablepanel/resizablepanel.d.ts +75 -0
- package/dist/types/components/resizablepanel/resizablepanel.recipe.d.ts +3 -0
- package/dist/types/components/segmented/segmented.d.ts +2 -2
- package/dist/types/components/select/select.d.ts +4 -2
- package/dist/types/components/select/select.recipe.d.ts +12 -0
- package/dist/types/components/skeleton/skeleton.d.ts +2 -2
- package/dist/types/components/spinner/spinner.d.ts +2 -2
- package/dist/types/components/stagebar/stagebar.d.ts +2 -2
- package/dist/types/components/statcard/statcard.d.ts +7 -2
- package/dist/types/components/statcard/statcard.recipe.d.ts +12 -2
- package/dist/types/components/table/index.d.ts +2 -0
- package/dist/types/components/table/table.d.ts +53 -0
- package/dist/types/components/table/table.recipe.d.ts +21 -0
- package/dist/types/components/tabletoolbar/index.d.ts +2 -0
- package/dist/types/components/tabletoolbar/tabletoolbar.chrome.d.ts +2 -0
- package/dist/types/components/tabletoolbar/tabletoolbar.d.ts +89 -0
- package/dist/types/components/tabletoolbar/tabletoolbar.recipe.d.ts +3 -0
- package/dist/types/components/tabs/tabs.d.ts +2 -2
- package/dist/types/components/toast/toast.d.ts +7 -1
- package/dist/types/components/tooltip/tooltip.d.ts +8 -1
- package/dist/types/components/wheelpicker/index.d.ts +2 -0
- package/dist/types/components/wheelpicker/wheelpicker.d.ts +37 -0
- package/dist/types/components/wheelpicker/wheelpicker.recipe.d.ts +26 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/product/appshell/appshell.d.ts +16 -2
- package/dist/types/product/authshell/authshell.d.ts +28 -0
- package/dist/types/product/authshell/authshell.recipe.d.ts +3 -0
- package/dist/types/product/authshell/index.d.ts +2 -0
- package/dist/types/product/board/board.d.ts +2 -2
- package/dist/types/product/command/command.d.ts +25 -1
- package/dist/types/product/entitycard/entitycard.d.ts +2 -2
- package/dist/types/product/flowcanvas/flowcanvas.d.ts +9 -1
- package/dist/types/product/onboarding/onboarding.d.ts +7 -1
- package/dist/types/product/recordpage/recordpage.d.ts +65 -1
- package/dist/types/product/recordpanel/recordpanel.d.ts +8 -2
- package/dist/types/product/recordstable/company-logos.d.ts +1 -0
- package/dist/types/product/recordstable/recordstable.d.ts +131 -1
- package/dist/types/product/recordstable/recordstable.tag.d.ts +10 -0
- package/dist/types/product/richtext/richtext.d.ts +5 -1
- package/dist/types/product/settingssection/settingssection.d.ts +2 -2
- package/dist/types/product/settingsshell/settingsshell.d.ts +6 -2
- package/dist/types/product/sidebar/index.d.ts +1 -1
- package/dist/types/product/sidebar/sidebar.d.ts +93 -0
- package/dist/types/product/tasklist/tasklist.d.ts +5 -1
- package/dist/types/product/trialbanner/trialbanner.d.ts +2 -2
- package/dist/types/product/viewtoggle/viewtoggle.d.ts +11 -5
- package/dist/types/tokens/contract.d.ts +26 -3
- package/dist/types/tokens/elevation.d.ts +44 -0
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/palette.d.ts +88 -0
- package/dist/types/tokens/scale.d.ts +7 -0
- package/dist/types/tokens/semantic.d.ts +31 -0
- package/dist/viewtoggle.css +11 -3
- package/dist/wheelpicker.css +68 -0
- package/dist/wheelpicker.d.ts +7 -0
- package/package.json +351 -9
- package/dist/index.js +0 -9690
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { boardRecipe } from "./board.recipe.js";
|
|
4
|
+
/**
|
|
5
|
+
* A kanban board with native drag-and-drop between columns. Cards are
|
|
6
|
+
* `draggable`; dropping one on a column reparents it via `onCardsChange`
|
|
7
|
+
* (the parent owns the cards, so the move is a controlled state update).
|
|
8
|
+
* Measured from Attio's Deals pipeline.
|
|
9
|
+
*/
|
|
10
|
+
export function Board({ columns, cards, onCardsChange, renderCard, onNewCard, newCardLabel = "New", className, ...rest }) {
|
|
11
|
+
const [dragId, setDragId] = React.useState(null);
|
|
12
|
+
const [overCol, setOverCol] = React.useState(null);
|
|
13
|
+
const move = (cardId, toColumn) => {
|
|
14
|
+
const card = cards.find((c) => c.id === cardId);
|
|
15
|
+
if (!card || card.columnId === toColumn)
|
|
16
|
+
return;
|
|
17
|
+
onCardsChange?.(cards.map((c) => (c.id === cardId ? { ...c, columnId: toColumn } : c)));
|
|
18
|
+
};
|
|
19
|
+
return (_jsx("div", { className: boardRecipe({ className }), ...rest, children: columns.map((col) => {
|
|
20
|
+
const colCards = cards.filter((c) => c.columnId === col.id);
|
|
21
|
+
return (_jsxs("div", { className: "board-col", "data-over": overCol === col.id ? "" : undefined, onDragOver: (e) => {
|
|
22
|
+
if (!dragId)
|
|
23
|
+
return;
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
setOverCol(col.id);
|
|
26
|
+
}, onDragLeave: (e) => {
|
|
27
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
28
|
+
setOverCol((v) => (v === col.id ? null : v));
|
|
29
|
+
}
|
|
30
|
+
}, onDrop: (e) => {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
if (dragId)
|
|
33
|
+
move(dragId, col.id);
|
|
34
|
+
setDragId(null);
|
|
35
|
+
setOverCol(null);
|
|
36
|
+
}, children: [_jsxs("div", { className: "board-col-header", children: [col.accent && (_jsx("span", { className: "board-col-dot", style: { background: col.accent } })), _jsx("span", { className: "board-col-title", children: col.title }), _jsx("span", { className: "board-col-count", children: colCards.length }), onNewCard && (_jsx("button", { type: "button", className: "board-col-add", "aria-label": `Add to ${col.title}`, onClick: () => onNewCard(col.id), children: "+" }))] }), _jsxs("div", { className: "board-col-body", children: [onNewCard && (_jsxs("button", { type: "button", className: "board-newcard", onClick: () => onNewCard(col.id), children: ["+ ", newCardLabel] })), colCards.map((card) => (_jsx("div", { className: "board-card", draggable: true, "data-dragging": dragId === card.id ? "" : undefined, onDragStart: () => setDragId(card.id), onDragEnd: () => {
|
|
37
|
+
setDragId(null);
|
|
38
|
+
setOverCol(null);
|
|
39
|
+
}, children: renderCard(card) }, card.id)))] })] }, col.id));
|
|
40
|
+
}) }));
|
|
41
|
+
}
|
|
42
|
+
Board.displayName = "Board";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A kanban board — measured from Attio's Deals pipeline: horizontally scrolling
|
|
4
|
+
// columns (dot + title + count header, a "New" button, a stack of draggable
|
|
5
|
+
// cards), with the hovered drop column highlighted.
|
|
6
|
+
const config = defineRecipe({
|
|
7
|
+
name: "board",
|
|
8
|
+
base: `display: flex; gap: ${c.space["3"]}; height: 100%; box-sizing: border-box; padding: ${c.space["3"]}; overflow-x: auto; align-items: flex-start; font-family: ${c.font.sans};
|
|
9
|
+
& .board-col { display: flex; flex-direction: column; width: 280px; flex-shrink: 0; max-height: 100%; box-sizing: border-box; }
|
|
10
|
+
& .board-col-header { display: flex; align-items: center; gap: ${c.space["2"]}; height: 36px; padding: 0 ${c.space["1"]}; flex-shrink: 0; }
|
|
11
|
+
& .board-col-dot { width: 9px; height: 9px; border-radius: ${c.radius.full}; flex-shrink: 0; }
|
|
12
|
+
& .board-col-title { font-size: ${c.text.lg}; font-weight: ${c.weight.semibold}; color: ${c.fgPrimary}; }
|
|
13
|
+
& .board-col-count { font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
14
|
+
& .board-col-add { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-inline-start: auto; padding: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgMuted}; font-family: inherit; cursor: pointer; }
|
|
15
|
+
& .board-col-add:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: ${c.fgPrimary}; }
|
|
16
|
+
& .board-col-body { display: flex; flex-direction: column; gap: ${c.space["2"]}; flex: 1; min-height: 48px; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; overflow-y: auto; transition: background 0.12s; }
|
|
17
|
+
& .board-col[data-over] .board-col-body { background: color-mix(in srgb, ${c.bgBrandSolid} 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, ${c.bgBrandSolid} 30%, transparent); }
|
|
18
|
+
& .board-newcard { display: flex; align-items: center; justify-content: center; gap: ${c.space["1.5"]}; height: 32px; flex-shrink: 0; border: none; border-radius: ${c.radius.md}; background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; }
|
|
19
|
+
& .board-newcard:hover { background: color-mix(in srgb, ${c.fgPrimary} 7%, transparent); color: ${c.fgPrimary}; }
|
|
20
|
+
& .board-card { display: flex; flex-direction: column; gap: ${c.space["2"]}; box-sizing: border-box; padding: ${c.space["2.5"]} ${c.space["3"]}; border-radius: ${c.radius.lg}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}, 0 1px 2px rgba(0,0,0,0.04); cursor: grab; }
|
|
21
|
+
& .board-card:active { cursor: grabbing; }
|
|
22
|
+
& .board-card[data-dragging] { opacity: 0.4; }`,
|
|
23
|
+
variants: {},
|
|
24
|
+
defaultVariants: {},
|
|
25
|
+
compoundVariants: [],
|
|
26
|
+
});
|
|
27
|
+
export const boardRecipe = resolveRecipe(config);
|
|
28
|
+
export default config;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as combobox from "@zag-js/combobox";
|
|
3
|
+
import * as dialog from "@zag-js/dialog";
|
|
4
|
+
import { normalizeProps, Portal, useMachine } from "@zag-js/react";
|
|
5
|
+
import { Building2, CircleDollarSign, House, ListTodo, Search, Settings, SquareCheck, User, UserPlus, } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Kbd } from "../../components/kbd/index.js";
|
|
8
|
+
import { commandRecipe } from "./command.recipe.js";
|
|
9
|
+
const IconHome = () => (_jsx(House, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
10
|
+
const IconTasks = () => (_jsx(SquareCheck, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
11
|
+
const IconCompanies = () => (_jsx(Building2, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
12
|
+
const IconPeople = () => (_jsx(User, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
13
|
+
const IconDeals = () => (_jsx(CircleDollarSign, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
14
|
+
const IconNewPerson = () => (_jsx(UserPlus, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
15
|
+
const IconNewTask = () => (_jsx(ListTodo, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
16
|
+
const IconSearch = () => (_jsx(Search, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
17
|
+
const IconSettings = () => (_jsx(Settings, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }));
|
|
18
|
+
/** crisp's own generic command set (not copied from any product). */
|
|
19
|
+
export const defaultCommandItems = [
|
|
20
|
+
{
|
|
21
|
+
id: "go-home",
|
|
22
|
+
label: "Go to Home",
|
|
23
|
+
icon: IconHome,
|
|
24
|
+
group: "Navigation",
|
|
25
|
+
shortcut: ["G", "H"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "go-tasks",
|
|
29
|
+
label: "Go to Tasks",
|
|
30
|
+
icon: IconTasks,
|
|
31
|
+
group: "Navigation",
|
|
32
|
+
shortcut: ["G", "T"],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "go-companies",
|
|
36
|
+
label: "Go to Companies",
|
|
37
|
+
icon: IconCompanies,
|
|
38
|
+
group: "Navigation",
|
|
39
|
+
shortcut: ["G", "C"],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "go-people",
|
|
43
|
+
label: "Go to People",
|
|
44
|
+
icon: IconPeople,
|
|
45
|
+
group: "Navigation",
|
|
46
|
+
shortcut: ["G", "P"],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "go-deals",
|
|
50
|
+
label: "Go to Deals",
|
|
51
|
+
icon: IconDeals,
|
|
52
|
+
group: "Navigation",
|
|
53
|
+
shortcut: ["G", "D"],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "new-company",
|
|
57
|
+
label: "New company",
|
|
58
|
+
icon: IconCompanies,
|
|
59
|
+
group: "Create",
|
|
60
|
+
keywords: ["create", "add"],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "new-person",
|
|
64
|
+
label: "New person",
|
|
65
|
+
icon: IconNewPerson,
|
|
66
|
+
group: "Create",
|
|
67
|
+
keywords: ["create", "add"],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "new-task",
|
|
71
|
+
label: "New task",
|
|
72
|
+
icon: IconNewTask,
|
|
73
|
+
group: "Create",
|
|
74
|
+
keywords: ["create", "add"],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "search-records",
|
|
78
|
+
label: "Search records…",
|
|
79
|
+
icon: IconSearch,
|
|
80
|
+
group: "Actions",
|
|
81
|
+
keywords: ["find"],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "settings",
|
|
85
|
+
label: "Settings",
|
|
86
|
+
icon: IconSettings,
|
|
87
|
+
group: "Actions",
|
|
88
|
+
keywords: ["preferences"],
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
// A globally unique (process-lifetime) id per mounted instance, rather than
|
|
92
|
+
// React's tree-position-based useId. The dialog/combobox machines defer
|
|
93
|
+
// their outside-click/focus dismissal listeners by a frame, so a rapid
|
|
94
|
+
// unmount+remount that reused useId's tree-relative ids could let a stale
|
|
95
|
+
// registration from a just-unmounted instance resolve (by id) to a new
|
|
96
|
+
// instance's DOM node.
|
|
97
|
+
let instanceCounter = 0;
|
|
98
|
+
function useCommandInstanceId() {
|
|
99
|
+
const idRef = React.useRef(null);
|
|
100
|
+
if (idRef.current == null) {
|
|
101
|
+
instanceCounter += 1;
|
|
102
|
+
idRef.current = `crisp-command-${instanceCounter}`;
|
|
103
|
+
}
|
|
104
|
+
return idRef.current;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* ⌘K command palette. Composes a Zag dialog machine (modal, focus trap,
|
|
108
|
+
* scroll lock) with a Zag combobox machine (filterable, keyboard-navigable
|
|
109
|
+
* option list) so keyboard/focus correctness comes from the machines, not
|
|
110
|
+
* hand-rolled event handling.
|
|
111
|
+
*/
|
|
112
|
+
export function Command({ open, onOpenChange, items = defaultCommandItems, placeholder = "Search actions and records…", "aria-label": ariaLabel = "Command palette", navigateLabel = "Navigate", selectLabel = "Select", emptyLabel = "No matching commands", query: queryProp, onQueryChange, filterItems = true, }) {
|
|
113
|
+
const instanceId = useCommandInstanceId();
|
|
114
|
+
const dialogId = `${instanceId}-dialog`;
|
|
115
|
+
const comboId = `${instanceId}-combobox`;
|
|
116
|
+
const inputRef = React.useRef(null);
|
|
117
|
+
const [internalQuery, setInternalQuery] = React.useState("");
|
|
118
|
+
const query = queryProp !== undefined ? queryProp : internalQuery;
|
|
119
|
+
const setQuery = React.useCallback((next) => {
|
|
120
|
+
onQueryChange?.(next);
|
|
121
|
+
if (queryProp === undefined)
|
|
122
|
+
setInternalQuery(next);
|
|
123
|
+
}, [onQueryChange, queryProp]);
|
|
124
|
+
const dialogService = useMachine(dialog.machine, {
|
|
125
|
+
id: dialogId,
|
|
126
|
+
open,
|
|
127
|
+
onOpenChange(details) {
|
|
128
|
+
onOpenChange(details.open);
|
|
129
|
+
},
|
|
130
|
+
initialFocusEl: () => inputRef.current,
|
|
131
|
+
"aria-label": ariaLabel,
|
|
132
|
+
});
|
|
133
|
+
const dlg = dialog.connect(dialogService, normalizeProps);
|
|
134
|
+
const filteredItems = React.useMemo(() => {
|
|
135
|
+
if (!filterItems)
|
|
136
|
+
return items;
|
|
137
|
+
const q = query.trim().toLowerCase();
|
|
138
|
+
if (!q)
|
|
139
|
+
return items;
|
|
140
|
+
return items.filter((item) => item.label.toLowerCase().includes(q) ||
|
|
141
|
+
item.keywords?.some((k) => k.toLowerCase().includes(q)));
|
|
142
|
+
}, [items, query, filterItems]);
|
|
143
|
+
const collection = React.useMemo(() => combobox.collection({
|
|
144
|
+
items: filteredItems,
|
|
145
|
+
itemToValue: (item) => item.id,
|
|
146
|
+
itemToString: (item) => item.label,
|
|
147
|
+
}), [filteredItems]);
|
|
148
|
+
const comboService = useMachine(combobox.machine, {
|
|
149
|
+
id: comboId,
|
|
150
|
+
collection,
|
|
151
|
+
// The list is always visible while the dialog is open (not a floating
|
|
152
|
+
// popover) — the combobox is only used for its keyboard/filter machine.
|
|
153
|
+
open: true,
|
|
154
|
+
// The dialog already owns escape/outside-click dismissal; avoid a
|
|
155
|
+
// second competing dismissable layer.
|
|
156
|
+
disableLayer: true,
|
|
157
|
+
inputBehavior: "autohighlight",
|
|
158
|
+
closeOnSelect: false,
|
|
159
|
+
// Always driven from our own `query` (internal state, or the caller's
|
|
160
|
+
// controlled prop) so a caller-driven query update reaches the input,
|
|
161
|
+
// not just the reverse — the sole source of truth is `query`, not this
|
|
162
|
+
// machine's own copy.
|
|
163
|
+
inputValue: query,
|
|
164
|
+
onInputValueChange(details) {
|
|
165
|
+
setQuery(details.inputValue);
|
|
166
|
+
},
|
|
167
|
+
onSelect(details) {
|
|
168
|
+
const item = items.find((candidate) => candidate.id === details.itemValue);
|
|
169
|
+
item?.onSelect?.();
|
|
170
|
+
onOpenChange(false);
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
const combo = combobox.connect(comboService, normalizeProps);
|
|
174
|
+
// Reset the query/highlight each time the palette opens, so it never
|
|
175
|
+
// reopens showing a stale filter from the previous session.
|
|
176
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: only re-run when `open` flips — `combo` is a fresh object every render.
|
|
177
|
+
React.useLayoutEffect(() => {
|
|
178
|
+
if (!open)
|
|
179
|
+
return;
|
|
180
|
+
setQuery("");
|
|
181
|
+
combo.setInputValue("", "script");
|
|
182
|
+
combo.clearHighlightValue();
|
|
183
|
+
}, [open]);
|
|
184
|
+
// The footer's primary button mirrors the currently highlighted row (Attio
|
|
185
|
+
// shows the active action there and runs it on ↵ / click).
|
|
186
|
+
const highlightedItem = filteredItems.find((item) => item.id === combo.highlightedValue) ??
|
|
187
|
+
filteredItems[0];
|
|
188
|
+
const runItem = (item) => {
|
|
189
|
+
if (!item)
|
|
190
|
+
return;
|
|
191
|
+
item.onSelect?.();
|
|
192
|
+
onOpenChange(false);
|
|
193
|
+
};
|
|
194
|
+
if (!dlg.open)
|
|
195
|
+
return null;
|
|
196
|
+
return (_jsx(Portal, { children: _jsxs("div", { className: commandRecipe(), children: [_jsx("div", { ...dlg.getBackdropProps(), className: "command-backdrop" }), _jsx("div", { ...dlg.getPositionerProps(), className: "command-positioner", children: _jsx("div", { ...dlg.getContentProps(), className: "command-content", children: _jsxs("div", { className: "command-card", children: [_jsxs("div", { className: "command-control", children: [_jsx(IconSearch, {}), _jsx("input", { ref: inputRef, ...combo.getInputProps(), className: "command-input", placeholder: placeholder })] }), _jsx("div", { ...combo.getContentProps(), className: "command-list", children: filteredItems.length === 0 ? (_jsx("div", { className: "command-empty", children: emptyLabel })) : (filteredItems.map((item, i) => {
|
|
197
|
+
const Icon = item.icon;
|
|
198
|
+
const showGroup = item.group && item.group !== filteredItems[i - 1]?.group;
|
|
199
|
+
return (_jsxs(React.Fragment, { children: [showGroup && (_jsx("div", { className: "command-group-label", "aria-hidden": "true", children: item.group })), _jsxs("div", { ...combo.getItemProps({ item }), className: "command-item", children: [_jsx(Icon, {}), _jsx("span", { className: "command-item-label", children: item.label }), item.shortcut && (_jsx("span", { className: "command-item-shortcut", children: item.shortcut.map((key) => (_jsx(Kbd, { children: key }, key))) }))] })] }, item.id));
|
|
200
|
+
})) }), _jsxs("div", { className: "command-footer", children: [_jsxs("span", { className: "command-footer-nav", children: [_jsx(Kbd, { children: "\u2191" }), _jsx(Kbd, { children: "\u2193" }), navigateLabel] }), _jsxs("button", { type: "button", className: "command-footer-action", disabled: !highlightedItem, onClick: () => runItem(highlightedItem), children: [_jsx("span", { className: "command-footer-action-label", children: highlightedItem?.label ?? selectLabel }), _jsx("span", { className: "command-footer-key", children: "\u21B5" })] })] })] }) }) })] }) }));
|
|
201
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
3
|
+
const config = defineRecipe({
|
|
4
|
+
name: "command",
|
|
5
|
+
base: `display: contents; font-family: ${c.font.sans}
|
|
6
|
+
; & .command-content, & .command-card { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
|
|
7
|
+
& .command-backdrop { position: fixed; inset: 0; z-index: 50; background: transparent; }
|
|
8
|
+
& .command-positioner { position: fixed; inset: 0; z-index: 51; display: flex; align-items: flex-start; justify-content: center; padding: 15vh ${c.space["4"]} ${c.space["4"]}; }
|
|
9
|
+
& .command-content { position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: 90vw; max-width: 748px; max-height: 70vh; padding: ${c.space["1"]}; border-radius: ${c.radius["2xl"]}; background: color-mix(in srgb, ${c.bgOverlayFrost} 60%, transparent); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); box-shadow: ${e.modal}; opacity: 1; transform: scale(1); transition: opacity 0.2s ease, transform 0.2s ease; @starting-style { opacity: 0; transform: scale(0.97); } }
|
|
10
|
+
& .command-card { display: flex; flex-direction: column; flex: 1; min-height: 0; box-sizing: border-box; border-radius: ${c.radius.xl}; background: ${c.bgSurface}; box-shadow: 0 0 0 1px color-mix(in srgb, ${c.fgPrimary} 8%, transparent); overflow: hidden; }
|
|
11
|
+
& .command-control { display: flex; align-items: center; gap: ${c.space["2.5"]}; height: 52px; flex-shrink: 0; padding: 0 ${c.space["4"]}; border-bottom: 1px solid ${c.borderSubtle}; color: ${c.fgMuted}; }
|
|
12
|
+
& .command-control svg { flex-shrink: 0; }
|
|
13
|
+
& .command-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: ${c.font.sans}; font-size: ${c.text.xl}; color: ${c.fgPrimary}; }
|
|
14
|
+
& .command-input::placeholder { color: ${c.fgMuted}; }
|
|
15
|
+
& .command-list { flex: 1; min-height: 0; overflow-y: auto; padding: ${c.space["1"]} ${c.space["2.5"]}; display: flex; flex-direction: column; gap: ${c.space.px}; }
|
|
16
|
+
& .command-empty { padding: ${c.space["8"]} ${c.space["3"]}; text-align: center; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
17
|
+
& .command-item { box-sizing: border-box; display: flex; align-items: center; gap: ${c.space["2"]}; height: 36px; padding-inline: ${c.space["2.5"]}; border-radius: ${c.radius.xl}; font-size: ${c.text.lg}; color: ${c.fgPrimary}; cursor: pointer; }
|
|
18
|
+
& .command-item svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
19
|
+
& .command-item[data-highlighted] { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); }
|
|
20
|
+
& .command-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
21
|
+
& .command-item-shortcut { margin-inline-start: auto; flex-shrink: 0; display: flex; align-items: center; gap: ${c.space["0.5"]}; }
|
|
22
|
+
& .command-group-label { padding: ${c.space["2"]} ${c.space["2.5"]} ${c.space["1"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); }
|
|
23
|
+
& .command-list > .command-group-label:first-child { padding-top: ${c.space["1"]}; }
|
|
24
|
+
& .command-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; height: 44px; padding: 0 ${c.space["2.5"]}; border-top: 1px solid ${c.borderSubtle}; }
|
|
25
|
+
& .command-footer-nav { display: flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
26
|
+
& .command-footer-action { display: flex; align-items: center; gap: ${c.space["2"]}; height: 28px; max-width: 60%; padding: 0 ${c.space["1"]} 0 ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgBrandSolid}; color: ${c.fgOnBrand}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; }
|
|
27
|
+
& .command-footer-action:disabled { opacity: 0.5; cursor: default; }
|
|
28
|
+
& .command-footer-action-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
29
|
+
& .command-footer-key { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; background: rgba(255,255,255,0.22); font-size: ${c.text.xs}; }
|
|
30
|
+
`,
|
|
31
|
+
variants: {},
|
|
32
|
+
defaultVariants: {},
|
|
33
|
+
compoundVariants: [],
|
|
34
|
+
});
|
|
35
|
+
export const commandRecipe = Object.assign(resolveRecipe(config), {
|
|
36
|
+
config,
|
|
37
|
+
meta: {
|
|
38
|
+
content: {
|
|
39
|
+
maxWidth: "720px",
|
|
40
|
+
borderRadius: "16px",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
export default config;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { entitycardRecipe } from "./entitycard.recipe.js";
|
|
3
|
+
/**
|
|
4
|
+
* A note / entity card — measured from Attio's Notes grid. A bordered white
|
|
5
|
+
* card with an author row, a title, a clamped excerpt, and a footer row with a
|
|
6
|
+
* right-aligned date. Rendered as a button so the whole card is clickable.
|
|
7
|
+
*/
|
|
8
|
+
export function EntityCard({ author, title, excerpt, footer, date, onClick, "aria-label": ariaLabel, className, ...rest }) {
|
|
9
|
+
return (_jsxs("button", { type: "button", className: entitycardRecipe({ className }), ...rest, onClick: onClick, "aria-label": ariaLabel, children: [author != null && _jsx("span", { className: "entitycard-author", children: author }), _jsx("span", { className: "entitycard-title", children: title }), excerpt != null && _jsx("span", { className: "entitycard-excerpt", children: excerpt }), _jsx("span", { className: "entitycard-spacer" }), (footer != null || date != null) && (_jsxs("span", { className: "entitycard-foot", children: [footer, date != null && _jsx("span", { className: "entitycard-date", children: date })] }))] }));
|
|
10
|
+
}
|
|
11
|
+
EntityCard.displayName = "EntityCard";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A note / entity card — measured from Attio's Notes grid: a bordered white card
|
|
4
|
+
// with an author row (avatar + name) at the top, a title, a clamped excerpt,
|
|
5
|
+
// and a footer row (avatar + name … date). The whole card is clickable.
|
|
6
|
+
const config = defineRecipe({
|
|
7
|
+
name: "entitycard",
|
|
8
|
+
base: `display: flex; flex-direction: column; box-sizing: border-box; width: 100%; min-width: 0; text-align: start;
|
|
9
|
+
padding: ${c.space["3"]} ${c.space["4"]}; margin: 0; border: none; border-radius: ${c.radius.xl};
|
|
10
|
+
background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; color: ${c.fgPrimary};
|
|
11
|
+
font-family: ${c.font.sans}; cursor: pointer; transition: box-shadow .12s ease, background-color .12s ease;
|
|
12
|
+
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
13
|
+
|
|
14
|
+
&:hover { box-shadow: inset 0 0 0 1px ${c.borderDefault}, 0 1px 2px rgba(0,0,0,0.04), 0 6px 16px -6px rgba(28,40,64,0.12); }
|
|
15
|
+
&:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 2px; }
|
|
16
|
+
|
|
17
|
+
& .entitycard-author { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
18
|
+
& .entitycard-title { margin-top: ${c.space["2"]}; font-size: ${c.text.lg}; font-weight: ${c.weight.semibold}; letter-spacing: -0.1px; color: ${c.fgPrimary}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
19
|
+
& .entitycard-excerpt { margin-top: ${c.space["1"]}; font-size: ${c.text.md}; line-height: 18px; color: ${c.fgMuted}; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
|
|
20
|
+
& .entitycard-spacer { flex: 1; min-height: ${c.space["3"]}; }
|
|
21
|
+
& .entitycard-foot { display: flex; align-items: center; gap: ${c.space["1.5"]}; padding-top: ${c.space["2.5"]}; margin-top: ${c.space["1"]}; border-top: 1px solid ${c.borderSubtle}; font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
22
|
+
& .entitycard-foot-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: ${c.fgPrimary}; }
|
|
23
|
+
& .entitycard-date { margin-inline-start: auto; flex-shrink: 0; white-space: nowrap; }`,
|
|
24
|
+
variants: {},
|
|
25
|
+
defaultVariants: {},
|
|
26
|
+
compoundVariants: [],
|
|
27
|
+
});
|
|
28
|
+
export const entitycardRecipe = resolveRecipe(config);
|
|
29
|
+
export default config;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Minus, Plus } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { flowcanvasRecipe } from "./flowcanvas.recipe.js";
|
|
5
|
+
const GRID = 20;
|
|
6
|
+
const clampZoom = (z) => Math.min(1.5, Math.max(0.5, z));
|
|
7
|
+
/**
|
|
8
|
+
* A pannable, zoomable node canvas with draggable nodes and connecting edges —
|
|
9
|
+
* measured from Attio's Workflows editor. Drag a node to move it (fires
|
|
10
|
+
* `onNodesChange`); drag the background to pan; use the toolbar to zoom.
|
|
11
|
+
*/
|
|
12
|
+
export function FlowCanvas({ nodes, edges, onNodesChange, renderNode, nodeWidth = 240, nodeHeight = 64, "aria-label": ariaLabel, className, zoomOutLabel = "Zoom out", zoomInLabel = "Zoom in", resetLabel = "Reset", edgesLabel = "Edges", }) {
|
|
13
|
+
const [pan, setPan] = React.useState({ x: 40, y: 40 });
|
|
14
|
+
const [zoom, setZoom] = React.useState(1);
|
|
15
|
+
const [panning, setPanning] = React.useState(false);
|
|
16
|
+
const drag = React.useRef(null);
|
|
17
|
+
const byId = React.useMemo(() => new Map(nodes.map((n) => [n.id, n])), [nodes]);
|
|
18
|
+
const onNodePointerDown = (e, node) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
21
|
+
drag.current = {
|
|
22
|
+
id: node.id,
|
|
23
|
+
startX: e.clientX,
|
|
24
|
+
startY: e.clientY,
|
|
25
|
+
nodeX: node.x,
|
|
26
|
+
nodeY: node.y,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const onBackgroundPointerDown = (e) => {
|
|
30
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
31
|
+
setPanning(true);
|
|
32
|
+
drag.current = {
|
|
33
|
+
pan: true,
|
|
34
|
+
startX: e.clientX,
|
|
35
|
+
startY: e.clientY,
|
|
36
|
+
panX: pan.x,
|
|
37
|
+
panY: pan.y,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const onPointerMove = (e) => {
|
|
41
|
+
const d = drag.current;
|
|
42
|
+
if (!d)
|
|
43
|
+
return;
|
|
44
|
+
if ("pan" in d) {
|
|
45
|
+
setPan({
|
|
46
|
+
x: d.panX + (e.clientX - d.startX),
|
|
47
|
+
y: d.panY + (e.clientY - d.startY),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const dx = (e.clientX - d.startX) / zoom;
|
|
52
|
+
const dy = (e.clientY - d.startY) / zoom;
|
|
53
|
+
onNodesChange?.(nodes.map((n) => n.id === d.id ? { ...n, x: d.nodeX + dx, y: d.nodeY + dy } : n));
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const onPointerUp = () => {
|
|
57
|
+
drag.current = null;
|
|
58
|
+
setPanning(false);
|
|
59
|
+
};
|
|
60
|
+
return (_jsxs("div", { className: flowcanvasRecipe({ className }), "data-panning": panning ? "" : undefined, style: {
|
|
61
|
+
backgroundSize: `${GRID * zoom}px ${GRID * zoom}px`,
|
|
62
|
+
backgroundPosition: `${pan.x}px ${pan.y}px`,
|
|
63
|
+
}, role: "application", "aria-label": ariaLabel ?? "Flow canvas", onPointerDown: onBackgroundPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, onPointerCancel: onPointerUp, children: [_jsxs("div", { className: "flowcanvas-viewport", style: {
|
|
64
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
65
|
+
}, children: [_jsxs("svg", { className: "flowcanvas-edges", "aria-hidden": "true", children: [_jsx("title", { children: edgesLabel }), edges.map((edge) => {
|
|
66
|
+
const a = byId.get(edge.from);
|
|
67
|
+
const b = byId.get(edge.to);
|
|
68
|
+
if (!a || !b)
|
|
69
|
+
return null;
|
|
70
|
+
const sx = a.x + nodeWidth;
|
|
71
|
+
const sy = a.y + nodeHeight / 2;
|
|
72
|
+
const tx = b.x;
|
|
73
|
+
const ty = b.y + nodeHeight / 2;
|
|
74
|
+
const c = Math.max(30, Math.abs(tx - sx) / 2);
|
|
75
|
+
return (_jsxs("g", { children: [_jsx("path", { className: "flowcanvas-edge", d: `M ${sx} ${sy} C ${sx + c} ${sy}, ${tx - c} ${ty}, ${tx} ${ty}` }), _jsx("circle", { className: "flowcanvas-edge-dot", cx: sx, cy: sy, r: 3 }), _jsx("circle", { className: "flowcanvas-edge-dot", cx: tx, cy: ty, r: 3 })] }, `${edge.from}-${edge.to}`));
|
|
76
|
+
})] }), nodes.map((node) => (_jsx("div", { className: "flowcanvas-node", "data-dragging": drag.current &&
|
|
77
|
+
"id" in drag.current &&
|
|
78
|
+
drag.current.id === node.id
|
|
79
|
+
? ""
|
|
80
|
+
: undefined, style: { left: node.x, top: node.y, width: nodeWidth }, onPointerDown: (e) => onNodePointerDown(e, node), children: renderNode(node) }, node.id)))] }), _jsxs("div", { className: "flowcanvas-toolbar", children: [_jsx("button", { type: "button", className: "flowcanvas-tool", "aria-label": zoomOutLabel, onClick: () => setZoom((z) => clampZoom(z - 0.1)), children: _jsx(Minus, { size: 16, strokeWidth: 2 }) }), _jsxs("span", { className: "flowcanvas-tool flowcanvas-tool-zoom", "aria-live": "polite", children: [Math.round(zoom * 100), "%"] }), _jsx("button", { type: "button", className: "flowcanvas-tool", "aria-label": zoomInLabel, onClick: () => setZoom((z) => clampZoom(z + 0.1)), children: _jsx(Plus, { size: 16, strokeWidth: 2 }) }), _jsx("span", { className: "flowcanvas-tool-sep" }), _jsx("button", { type: "button", className: "flowcanvas-tool", onClick: () => {
|
|
81
|
+
setZoom(1);
|
|
82
|
+
setPan({ x: 40, y: 40 });
|
|
83
|
+
}, children: resetLabel })] })] }));
|
|
84
|
+
}
|
|
85
|
+
FlowCanvas.displayName = "FlowCanvas";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A pannable, zoomable node canvas — measured from Attio's Workflows editor:
|
|
4
|
+
// a dotted-grid background, draggable node cards, and connecting edges with dots.
|
|
5
|
+
const config = defineRecipe({
|
|
6
|
+
name: "flowcanvas",
|
|
7
|
+
base: `position: relative; overflow: hidden; box-sizing: border-box; width: 100%; height: 100%; background-color: ${c.bgSurface}; background-image: radial-gradient(circle, color-mix(in srgb, ${c.fgPrimary} 14%, transparent) 1px, transparent 1px); font-family: ${c.font.sans}; cursor: grab; touch-action: none; user-select: none;
|
|
8
|
+
&[data-panning] { cursor: grabbing; }
|
|
9
|
+
& .flowcanvas-viewport { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
|
|
10
|
+
& .flowcanvas-edges { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
|
|
11
|
+
& .flowcanvas-edge { fill: none; stroke: color-mix(in srgb, ${c.fgPrimary} 28%, transparent); stroke-width: 1.5; }
|
|
12
|
+
& .flowcanvas-edge-dot { fill: ${c.bgBrandSolid}; }
|
|
13
|
+
& .flowcanvas-node { position: absolute; cursor: grab; }
|
|
14
|
+
& .flowcanvas-node[data-dragging] { cursor: grabbing; z-index: 10; }
|
|
15
|
+
& .flowcanvas-toolbar { position: absolute; bottom: ${c.space["4"]}; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: ${c.space["1"]}; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; background: ${c.bgRaised}; box-shadow: inset 0 0 0 1px ${c.borderDefault}, 0 4px 14px -4px rgba(28,40,64,0.16); }
|
|
16
|
+
& .flowcanvas-tool { display: inline-flex; align-items: center; justify-content: center; gap: ${c.space["1"]}; height: 30px; min-width: 30px; padding: 0 ${c.space["2"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; }
|
|
17
|
+
& .flowcanvas-tool:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: ${c.fgPrimary}; }
|
|
18
|
+
& .flowcanvas-tool-zoom { min-width: 48px; }
|
|
19
|
+
& .flowcanvas-tool-sep { width: 1px; height: 18px; background: ${c.borderSubtle}; }`,
|
|
20
|
+
variants: {},
|
|
21
|
+
defaultVariants: {},
|
|
22
|
+
compoundVariants: [],
|
|
23
|
+
});
|
|
24
|
+
export const flowcanvasRecipe = resolveRecipe(config);
|
|
25
|
+
export default config;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Bell } from "lucide-react";
|
|
3
|
+
import { inboxRecipe } from "./inbox.recipe.js";
|
|
4
|
+
/**
|
|
5
|
+
* A notifications inbox panel — measured from Attio's notification flyout. A
|
|
6
|
+
* title, Notifications/Requests tabs with counts, then notification rows
|
|
7
|
+
* (avatar + message + time + unread dot) or a centred empty state. Put it inside
|
|
8
|
+
* a Popover for the flyout.
|
|
9
|
+
*/
|
|
10
|
+
export function Inbox({ notifications = [], title = "Notifications", tabs, activeTab, onTabChange, emptyTitle = "No notifications", emptySubtitle = "Notifications such as mentions and important updates will be displayed here.", emptyAction, className, }) {
|
|
11
|
+
return (_jsxs("div", { className: inboxRecipe({ className }), children: [_jsxs("div", { className: "inbox-head", children: [_jsx("div", { className: "inbox-title", children: title }), tabs && tabs.length > 0 && (_jsx("div", { className: "inbox-tabs", role: "tablist", children: tabs.map((t) => (_jsxs("button", { type: "button", role: "tab", "aria-selected": t.id === activeTab, className: "inbox-tab", "data-active": t.id === activeTab ? "" : undefined, onClick: () => onTabChange?.(t.id), children: [t.label, t.count != null && (_jsxs("span", { className: "inbox-tab-count", children: ["(", t.count, ")"] }))] }, t.id))) }))] }), notifications.length === 0 ? (_jsxs("div", { className: "inbox-empty", children: [_jsx("span", { className: "inbox-empty-icon", children: _jsx(Bell, { size: 40, strokeWidth: 1.25 }) }), _jsx("div", { className: "inbox-empty-title", children: emptyTitle }), emptySubtitle != null && (_jsx("div", { className: "inbox-empty-sub", children: emptySubtitle })), emptyAction != null && (_jsx("div", { className: "inbox-empty-action", children: emptyAction }))] })) : (_jsx("div", { className: "inbox-list", children: notifications.map((n) => (_jsxs("button", { type: "button", className: "inbox-row", onClick: n.onClick, children: [n.avatar != null && (_jsx("span", { className: "inbox-row-avatar", children: n.avatar })), _jsxs("span", { className: "inbox-row-body", children: [_jsx("span", { className: "inbox-row-msg", children: n.message }), n.time != null && (_jsx("span", { className: "inbox-row-time", children: n.time }))] }), n.unread && _jsx("span", { className: "inbox-row-unread" })] }, n.id))) }))] }));
|
|
12
|
+
}
|
|
13
|
+
Inbox.displayName = "Inbox";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A notifications inbox panel — measured from Attio's notification flyout: a
|
|
4
|
+
// ~380px rounded panel with a title, "Notifications / Requests" tabs (with
|
|
5
|
+
// counts), then notification rows (avatar + message + time + unread dot) or a
|
|
6
|
+
// centred empty state. Drop it in a Popover for the flyout, or use standalone.
|
|
7
|
+
const config = defineRecipe({
|
|
8
|
+
name: "inbox",
|
|
9
|
+
base: `display: flex; flex-direction: column; box-sizing: border-box; width: 380px; max-height: 588px;
|
|
10
|
+
border-radius: ${c.radius.xl}; background: ${c.bgSurface}; font-family: ${c.font.sans}; overflow: hidden;
|
|
11
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, ${c.fgPrimary} 6%, transparent), 0 8px 28px -6px rgba(28,40,64,0.16), 0 2px 6px -2px rgba(28,40,64,0.10);
|
|
12
|
+
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
13
|
+
|
|
14
|
+
& .inbox-head { padding: ${c.space["3"]} ${c.space["3"]} 0; }
|
|
15
|
+
& .inbox-title { font-size: ${c.text.xl}; line-height: 28px; font-weight: ${c.weight.semibold}; letter-spacing: -0.3px; color: ${c.fgPrimary}; }
|
|
16
|
+
& .inbox-tabs { display: flex; gap: ${c.space["3"]}; margin-top: ${c.space["2"]}; box-shadow: inset 0 -1px 0 ${c.borderSubtle}; }
|
|
17
|
+
& .inbox-tab { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 32px; padding: 0 2px; margin: 0; border: none; background: none; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; transition: color .12s, box-shadow .12s; }
|
|
18
|
+
& .inbox-tab:hover { color: ${c.fgPrimary}; }
|
|
19
|
+
& .inbox-tab[data-active] { color: ${c.bgBrandSolid}; box-shadow: inset 0 -2px 0 ${c.bgBrandSolid}; }
|
|
20
|
+
& .inbox-tab-count { font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
21
|
+
& .inbox-tab[data-active] .inbox-tab-count { color: ${c.bgBrandSolid}; }
|
|
22
|
+
|
|
23
|
+
& .inbox-list { flex: 1; min-height: 0; overflow-y: auto; padding: ${c.space["1"]}; display: flex; flex-direction: column; gap: 1px; }
|
|
24
|
+
& .inbox-row { display: flex; align-items: flex-start; gap: ${c.space["2.5"]}; padding: ${c.space["2"]} ${c.space["2"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; font-family: inherit; text-align: start; cursor: pointer; transition: background-color .12s; }
|
|
25
|
+
& .inbox-row:hover { background: ${c.bgRaised}; }
|
|
26
|
+
& .inbox-row-avatar { flex-shrink: 0; margin-top: 1px; }
|
|
27
|
+
& .inbox-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
28
|
+
& .inbox-row-msg { font-size: ${c.text.lg}; line-height: 18px; color: ${c.fgPrimary}; }
|
|
29
|
+
& .inbox-row-msg b { font-weight: ${c.weight.semibold}; }
|
|
30
|
+
& .inbox-row-time { font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
31
|
+
& .inbox-row-unread { flex-shrink: 0; width: 8px; height: 8px; margin-top: ${c.space["1"]}; border-radius: ${c.radius.full}; background: ${c.bgBrandSolid}; }
|
|
32
|
+
|
|
33
|
+
& .inbox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: ${c.space["1"]}; padding: ${c.space["6"]} ${c.space["4"]}; text-align: center; }
|
|
34
|
+
& .inbox-empty-icon { display: inline-flex; margin-bottom: ${c.space["2"]}; color: color-mix(in srgb, ${c.fgPrimary} 22%, transparent); }
|
|
35
|
+
& .inbox-empty-title { font-size: ${c.text.xl}; font-weight: ${c.weight.semibold}; color: ${c.fgPrimary}; }
|
|
36
|
+
& .inbox-empty-sub { font-size: ${c.text.md}; line-height: 18px; color: ${c.fgMuted}; max-width: 260px; }
|
|
37
|
+
& .inbox-empty-action { margin-top: ${c.space["2"]}; }`,
|
|
38
|
+
variants: {},
|
|
39
|
+
defaultVariants: {},
|
|
40
|
+
compoundVariants: [],
|
|
41
|
+
});
|
|
42
|
+
export const inboxRecipe = resolveRecipe(config);
|
|
43
|
+
export default config;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { listpageRecipe } from "./listpage.recipe.js";
|
|
3
|
+
/** A single list row wrapper (52px, hover, top border). Compose cells inside.
|
|
4
|
+
* Renders a real `<button>` when `onClick` is given, else a plain row. */
|
|
5
|
+
export function ListRow({ children, onClick, }) {
|
|
6
|
+
if (onClick) {
|
|
7
|
+
return (_jsx("button", { type: "button", className: "listpage-row", onClick: onClick, children: children }));
|
|
8
|
+
}
|
|
9
|
+
return _jsx("div", { className: "listpage-row", children: children });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The entity-list page shell — measured from Attio's Reports/Sequences/Tasks/
|
|
13
|
+
* Notes list views. A view-bar toolbar (leading/trailing slots + record count),
|
|
14
|
+
* an optional dashed Favorites region, then column headers and time-grouped
|
|
15
|
+
* rows. Rows are composed by the caller (wrap each in <ListRow>).
|
|
16
|
+
*/
|
|
17
|
+
export function ListPage({ leading, trailing, count, favorites, favoritesLabel = "Favorites", columns, groups, emptyLabel = "Nothing here yet", className, }) {
|
|
18
|
+
const total = groups?.reduce((s, g) => s + g.rows.length, 0) ?? 0;
|
|
19
|
+
return (_jsxs("div", { className: listpageRecipe({ className }), children: [_jsxs("div", { className: "listpage-toolbar", children: [_jsx("div", { className: "listpage-toolbar-lead", children: leading }), count != null && _jsx("div", { className: "listpage-count", children: count }), trailing != null && (_jsx("div", { className: "listpage-toolbar-trail", children: trailing }))] }), _jsxs("div", { className: "listpage-body", children: [favorites != null && (_jsxs(_Fragment, { children: [_jsx("div", { className: "listpage-section-label", children: favoritesLabel }), _jsx("div", { className: "listpage-favorites", "data-dashed": "", children: favorites })] })), columns && columns.length > 0 && (_jsx("div", { className: "listpage-colhead", children: columns.map((col, i) => (_jsxs("span", { className: "listpage-colhead-cell", children: [col.icon, col.label] }, i))) })), total === 0 && !groups?.length ? (_jsx("div", { className: "listpage-empty", children: emptyLabel })) : (groups?.map((g) => (_jsxs("div", { children: [_jsxs("div", { className: "listpage-group", children: [g.label, g.count != null && (_jsx("span", { className: "listpage-group-count", children: g.count }))] }), g.rows] }, g.id))))] })] }));
|
|
20
|
+
}
|
|
21
|
+
ListPage.displayName = "ListPage";
|