@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,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert, CircleCheck, Info, TriangleAlert } from "lucide-react";
|
|
3
|
+
import { calloutRecipe } from "./callout.recipe.js";
|
|
4
|
+
const DEFAULT_ICONS = {
|
|
5
|
+
neutral: Info,
|
|
6
|
+
info: Info,
|
|
7
|
+
success: CircleCheck,
|
|
8
|
+
warning: TriangleAlert,
|
|
9
|
+
danger: CircleAlert,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An inline callout / banner — measured from Attio's info notices. `tone` tints
|
|
13
|
+
* the background and icon; pass a `title` and/or body `children`.
|
|
14
|
+
*/
|
|
15
|
+
export function Callout({ tone = "neutral", icon, title, children, action, className, ...rest }) {
|
|
16
|
+
const Fallback = DEFAULT_ICONS[tone];
|
|
17
|
+
const iconNode = icon === undefined
|
|
18
|
+
? Fallback && _jsx(Fallback, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" })
|
|
19
|
+
: icon;
|
|
20
|
+
return (_jsxs("div", { className: calloutRecipe({ className }), ...rest, "data-tone": tone, role: "note", children: [iconNode && _jsx("span", { className: "callout-icon", children: iconNode }), _jsxs("div", { className: "callout-body", children: [title != null && _jsx("div", { className: "callout-title", children: title }), children != null && _jsx("div", { className: "callout-desc", children: children })] }), action && _jsx("div", { className: "callout-action", children: action })] }));
|
|
21
|
+
}
|
|
22
|
+
Callout.displayName = "Callout";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A callout / banner — Attio's inline info notices (e.g. "Changes apply to all
|
|
4
|
+
// workspaces", the trial banner). Tone tints the background + icon.
|
|
5
|
+
const config = defineRecipe({
|
|
6
|
+
name: "callout",
|
|
7
|
+
base: `display: flex; align-items: flex-start; gap: ${c.space["2.5"]}; box-sizing: border-box; padding: ${c.space["3"]} ${c.space["4"]}; border-radius: ${c.radius.lg}; font-family: ${c.font.sans}; font-size: ${c.text.md}; background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary};
|
|
8
|
+
& .callout-icon { flex-shrink: 0; margin-top: 1px; display: inline-flex; color: ${c.fgMuted}; }
|
|
9
|
+
& .callout-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
10
|
+
& .callout-title { font-weight: ${c.weight.semibold}; }
|
|
11
|
+
& .callout-desc { color: ${c.fgMuted}; }
|
|
12
|
+
& .callout-action { flex-shrink: 0; }
|
|
13
|
+
&[data-tone="info"] { background: color-mix(in srgb, ${c.bgBrandSolid} 8%, transparent); }
|
|
14
|
+
&[data-tone="info"] .callout-icon { color: ${c.bgBrandSolid}; }
|
|
15
|
+
&[data-tone="success"] { background: color-mix(in srgb, ${c.bgSuccess} 10%, transparent); }
|
|
16
|
+
&[data-tone="success"] .callout-icon { color: ${c.bgSuccess}; }
|
|
17
|
+
&[data-tone="warning"] { background: color-mix(in srgb, ${c.bgWarning} 12%, transparent); }
|
|
18
|
+
&[data-tone="warning"] .callout-icon { color: ${c.bgWarning}; }
|
|
19
|
+
&[data-tone="danger"] { background: color-mix(in srgb, ${c.bgDanger} 10%, transparent); }
|
|
20
|
+
&[data-tone="danger"] .callout-icon { color: ${c.bgDanger}; }`,
|
|
21
|
+
variants: {},
|
|
22
|
+
defaultVariants: {},
|
|
23
|
+
compoundVariants: [],
|
|
24
|
+
});
|
|
25
|
+
export const calloutRecipe = resolveRecipe(config);
|
|
26
|
+
export default config;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cardRecipe } from "./card.recipe.js";
|
|
4
|
+
/** A bordered surface card. Compose with CardHeader / CardBody / CardFooter. */
|
|
5
|
+
export const Card = React.forwardRef(({ raised, interactive, className, ...props }, ref) => (_jsx("div", { ref: ref, className: cardRecipe({ raised, interactive, className }), ...props })));
|
|
6
|
+
Card.displayName = "Card";
|
|
7
|
+
export function CardHeader({ children, icon, action, }) {
|
|
8
|
+
return (_jsxs("div", { className: "card-header", children: [icon, _jsx("span", { className: "card-title", children: children }), action] }));
|
|
9
|
+
}
|
|
10
|
+
export function CardBody({ children, className, }) {
|
|
11
|
+
return (_jsx("div", { className: className ? `card-body ${className}` : "card-body", children: children }));
|
|
12
|
+
}
|
|
13
|
+
export function CardFooter({ children }) {
|
|
14
|
+
return _jsx("div", { className: "card-footer", children: children });
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A bordered surface card — the recurring container behind kanban cards, chart
|
|
4
|
+
// cards, workflow nodes, and highlight cells. `raised` adds a soft float shadow;
|
|
5
|
+
// `interactive` adds a hover affordance.
|
|
6
|
+
const config = defineRecipe({
|
|
7
|
+
name: "card",
|
|
8
|
+
base: `display: flex; flex-direction: column; box-sizing: border-box; border-radius: ${c.radius.xl}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; font-family: ${c.font.sans}; color: ${c.fgPrimary};
|
|
9
|
+
& .card-header { display: flex; align-items: center; gap: ${c.space["2"]}; flex-shrink: 0; padding: ${c.space["3"]} ${c.space["4"]}; border-bottom: 1px solid ${c.borderSubtle}; font-size: ${c.text.lg}; font-weight: ${c.weight.semibold}; }
|
|
10
|
+
& .card-header svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
11
|
+
& .card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
12
|
+
& .card-body { flex: 1; min-height: 0; padding: ${c.space["4"]}; }
|
|
13
|
+
& .card-footer { display: flex; align-items: center; justify-content: flex-end; gap: ${c.space["2"]}; flex-shrink: 0; padding: ${c.space["3"]} ${c.space["4"]}; border-top: 1px solid ${c.borderSubtle}; }`,
|
|
14
|
+
variants: {
|
|
15
|
+
raised: {
|
|
16
|
+
true: `box-shadow: inset 0 0 0 1px ${c.borderSubtle}, 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px -4px rgba(28,40,64,0.08);`,
|
|
17
|
+
false: "",
|
|
18
|
+
},
|
|
19
|
+
interactive: {
|
|
20
|
+
true: `cursor: pointer; transition: box-shadow 0.12s ease; &: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); }`,
|
|
21
|
+
false: "",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { raised: false, interactive: false },
|
|
25
|
+
compoundVariants: [],
|
|
26
|
+
});
|
|
27
|
+
export const cardRecipe = resolveRecipe(config);
|
|
28
|
+
export default config;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Primitive } from "../../core/index.js";
|
|
4
|
+
import { checkboxRecipe } from "./checkbox.recipe.js";
|
|
5
|
+
/**
|
|
6
|
+
* A native `<input type="checkbox">` styled to Attio's grid checkbox (16px,
|
|
7
|
+
* r6, brand fill + white check). Native on purpose: keyboard, focus, and form
|
|
8
|
+
* semantics come for free. `indeterminate` is a DOM-only property, so it is
|
|
9
|
+
* applied via ref rather than an attribute.
|
|
10
|
+
*/
|
|
11
|
+
export const Checkbox = React.forwardRef(({ className, indeterminate = false, asChild, ...props }, ref) => {
|
|
12
|
+
const innerRef = React.useRef(null);
|
|
13
|
+
React.useImperativeHandle(ref, () => innerRef.current);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (innerRef.current)
|
|
16
|
+
innerRef.current.indeterminate = indeterminate;
|
|
17
|
+
}, [indeterminate]);
|
|
18
|
+
return (_jsx(Primitive.input, { ref: innerRef, asChild: asChild, type: "checkbox", className: checkboxRecipe({ className }), ...props }));
|
|
19
|
+
});
|
|
20
|
+
Checkbox.displayName = "Checkbox";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// A 16px square checkbox measured from Attio's record grid: r6, a subtle 1px
|
|
4
|
+
// inset ring when empty, brand fill + white check when on. The check is a
|
|
5
|
+
// data-URI SVG background so it renders reliably (input pseudo-content doesn't).
|
|
6
|
+
const CHECK = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5 5 9l4.5-5'/%3E%3C/svg%3E\")";
|
|
7
|
+
const config = defineRecipe({
|
|
8
|
+
name: "checkbox",
|
|
9
|
+
base: `appearance: none; -webkit-appearance: none; box-sizing: border-box; flex-shrink: 0; margin: 0; width: 16px; height: 16px; border: none; border-radius: ${c.radius.sm}
|
|
10
|
+
; background: ${c.bgSurface}
|
|
11
|
+
; box-shadow: inset 0 0 0 1px color-mix(in srgb, ${c.fgPrimary}
|
|
12
|
+
9%, transparent); cursor: pointer; transition: background-color .12s, box-shadow .12s; &:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, ${c.fgPrimary} 30%, transparent); }
|
|
13
|
+
&:checked, &:indeterminate { background: ${c.bgBrandSolid} center / 10px no-repeat; box-shadow: none; }
|
|
14
|
+
&:checked { background-image: ${CHECK}; }
|
|
15
|
+
&:indeterminate { background-image: linear-gradient(${c.fgOnBrand}, ${c.fgOnBrand}); background-size: 8px 2px; }
|
|
16
|
+
&:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 1px; }
|
|
17
|
+
`,
|
|
18
|
+
variants: {},
|
|
19
|
+
defaultVariants: {},
|
|
20
|
+
compoundVariants: [],
|
|
21
|
+
});
|
|
22
|
+
export const checkboxRecipe = Object.assign(resolveRecipe(config), {
|
|
23
|
+
config,
|
|
24
|
+
meta: {
|
|
25
|
+
box: {
|
|
26
|
+
size: "16px",
|
|
27
|
+
borderRadius: "6px",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export default config;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, Plus } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Menu, MenuItem } from "../menu/index.js";
|
|
5
|
+
import { columncalcRecipe } from "./columncalc.recipe.js";
|
|
6
|
+
/** The four Attio offers on every column, in its order. */
|
|
7
|
+
export const UNIVERSAL_CALCS = [
|
|
8
|
+
"countEmpty",
|
|
9
|
+
"countFilled",
|
|
10
|
+
"percentEmpty",
|
|
11
|
+
"percentFilled",
|
|
12
|
+
];
|
|
13
|
+
/** The four Attio adds for numeric columns, in its order. */
|
|
14
|
+
export const NUMERIC_CALCS = ["sum", "average", "min", "max"];
|
|
15
|
+
export const CALC_LABEL = {
|
|
16
|
+
none: "None",
|
|
17
|
+
countEmpty: "Count empty",
|
|
18
|
+
countFilled: "Count filled",
|
|
19
|
+
percentEmpty: "Percent empty",
|
|
20
|
+
percentFilled: "Percent filled",
|
|
21
|
+
sum: "Sum",
|
|
22
|
+
average: "Average",
|
|
23
|
+
min: "Min",
|
|
24
|
+
max: "Max",
|
|
25
|
+
};
|
|
26
|
+
/** A value counts as empty when it is null/undefined, "" or an empty array. */
|
|
27
|
+
export function isEmptyValue(v) {
|
|
28
|
+
if (v == null)
|
|
29
|
+
return true;
|
|
30
|
+
if (typeof v === "string")
|
|
31
|
+
return v.trim() === "";
|
|
32
|
+
if (Array.isArray(v))
|
|
33
|
+
return v.length === 0;
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Pure so the arithmetic is testable without rendering. Returns `null` for
|
|
38
|
+
* "none" and for numeric ops with no numbers to work on — a caller renders
|
|
39
|
+
* nothing rather than a misleading 0.
|
|
40
|
+
*/
|
|
41
|
+
export function computeCalc(values, op) {
|
|
42
|
+
if (op === "none")
|
|
43
|
+
return null;
|
|
44
|
+
const total = values.length;
|
|
45
|
+
const empty = values.filter(isEmptyValue).length;
|
|
46
|
+
const filled = total - empty;
|
|
47
|
+
switch (op) {
|
|
48
|
+
case "countEmpty":
|
|
49
|
+
return empty;
|
|
50
|
+
case "countFilled":
|
|
51
|
+
return filled;
|
|
52
|
+
case "percentEmpty":
|
|
53
|
+
return total === 0 ? 0 : (empty / total) * 100;
|
|
54
|
+
case "percentFilled":
|
|
55
|
+
return total === 0 ? 0 : (filled / total) * 100;
|
|
56
|
+
default:
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
const nums = values
|
|
60
|
+
.filter((v) => !isEmptyValue(v))
|
|
61
|
+
.map((v) => (typeof v === "number" ? v : Number(v)))
|
|
62
|
+
.filter((n) => Number.isFinite(n));
|
|
63
|
+
if (nums.length === 0)
|
|
64
|
+
return null;
|
|
65
|
+
switch (op) {
|
|
66
|
+
case "sum":
|
|
67
|
+
return nums.reduce((a, b) => a + b, 0);
|
|
68
|
+
case "average":
|
|
69
|
+
return nums.reduce((a, b) => a + b, 0) / nums.length;
|
|
70
|
+
case "min":
|
|
71
|
+
return Math.min(...nums);
|
|
72
|
+
case "max":
|
|
73
|
+
return Math.max(...nums);
|
|
74
|
+
default:
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const defaultFormat = (n, op) => op === "percentEmpty" || op === "percentFilled"
|
|
79
|
+
? `${Math.round(n)}%`
|
|
80
|
+
: n.toLocaleString(undefined, { maximumFractionDigits: 2 });
|
|
81
|
+
export function ColumnCalc({ rows, value, numeric = false, defaultOp = "none", op: opProp, onOpChange, format = defaultFormat, align, opLabels, className, ...rest }) {
|
|
82
|
+
// a partial override, so a consumer can translate one op without
|
|
83
|
+
// restating all nine
|
|
84
|
+
const labelFor = (o) => opLabels?.[o] ?? CALC_LABEL[o];
|
|
85
|
+
const [internal, setInternal] = React.useState(defaultOp);
|
|
86
|
+
const op = opProp ?? internal;
|
|
87
|
+
const setOp = (next) => {
|
|
88
|
+
if (opProp === undefined)
|
|
89
|
+
setInternal(next);
|
|
90
|
+
onOpChange?.(next);
|
|
91
|
+
};
|
|
92
|
+
const values = React.useMemo(() => rows.map(value), [rows, value]);
|
|
93
|
+
const result = React.useMemo(() => computeCalc(values, op), [values, op]);
|
|
94
|
+
const ops = [
|
|
95
|
+
...UNIVERSAL_CALCS,
|
|
96
|
+
...(numeric ? NUMERIC_CALCS : []),
|
|
97
|
+
"none",
|
|
98
|
+
];
|
|
99
|
+
return (_jsx("span", { className: columncalcRecipe({ className }), ...rest, children: _jsxs(Menu, { trigger: _jsx("button", { type: "button", className: "columncalc-trigger", "data-align": align === "right" ? "right" : undefined, children: op === "none" || result === null ? (_jsxs(_Fragment, { children: [_jsx(Plus, { size: 12, strokeWidth: 2 }), _jsx("span", { className: "columncalc-placeholder", children: "Add calculation" })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "columncalc-value", children: format(result, op) }), _jsx("span", { className: "columncalc-op", children: labelFor(op) }), _jsx(ChevronDown, { size: 12, strokeWidth: 2 })] })) }), children: [_jsx("div", { className: "columncalc-section", children: "Aggregations" }), ops.map((o) => (_jsx(MenuItem, { onSelect: () => setOp(o), children: labelFor(o) }, o)))] }) }));
|
|
100
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c } from "../../tokens/index.js";
|
|
3
|
+
// Attio's column footer calculation. The summary row is 36px and sticky at the
|
|
4
|
+
// grid's bottom edge; each cell holds a quiet trigger that reads "Add
|
|
5
|
+
// calculation" until an aggregation is chosen, then shows the value with its
|
|
6
|
+
// operation name beside it.
|
|
7
|
+
const config = defineRecipe({
|
|
8
|
+
name: "columncalc",
|
|
9
|
+
base: `display: flex; align-items: stretch; width: 100%; height: 100%; font-family: ${c.font.sans};
|
|
10
|
+
/* Menu wraps its trigger in a flex div that sizes to content, which would
|
|
11
|
+
shrink the button back to its text. Make the wrapper fill too, so the
|
|
12
|
+
whole cell stays clickable. */
|
|
13
|
+
& .menu { width: 100%; height: 100%; }
|
|
14
|
+
/* Attio's hit target is the WHOLE summary cell -- measured 246x37 with
|
|
15
|
+
padding 0 12px, not a content-sized chip. Clicking anywhere in the cell
|
|
16
|
+
opens the aggregation menu. */
|
|
17
|
+
& .columncalc-trigger { display: flex; align-items: center; gap: ${c.space["1"]}; width: 100%; height: 100%; min-height: ${c.size.tableRow}; margin: 0; padding: 0 ${c.space["3"]}; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
18
|
+
& .columncalc-trigger:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
19
|
+
& .columncalc-trigger svg { flex-shrink: 0; opacity: 0.7; }
|
|
20
|
+
& .columncalc-trigger[data-align="right"] { justify-content: flex-end; }
|
|
21
|
+
& .columncalc-placeholder { overflow: hidden; text-overflow: ellipsis; }
|
|
22
|
+
& .columncalc-value { color: ${c.fgPrimary}; font-variant-numeric: tabular-nums; }
|
|
23
|
+
& .columncalc-op { color: ${c.fgMuted}; }
|
|
24
|
+
& .columncalc-section { padding: ${c.space["1.5"]} ${c.space["2"]} ${c.space["1"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }`,
|
|
25
|
+
variants: {},
|
|
26
|
+
defaultVariants: {},
|
|
27
|
+
compoundVariants: [],
|
|
28
|
+
});
|
|
29
|
+
export const columncalcRecipe = resolveRecipe(config);
|
|
30
|
+
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CALC_LABEL, ColumnCalc, computeCalc, isEmptyValue, NUMERIC_CALCS, UNIVERSAL_CALCS, } from "./columncalc.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { contextmenuRecipe } from "./contextmenu.recipe.js";
|
|
4
|
+
/**
|
|
5
|
+
* A right-click context menu — the popover surface positioned at the cursor.
|
|
6
|
+
* Wrap the target; right-clicking it opens the menu (flipping at the viewport
|
|
7
|
+
* edges), closing on select, outside pointer-down, and Escape.
|
|
8
|
+
*/
|
|
9
|
+
export function ContextMenu({ children, items, className }) {
|
|
10
|
+
const rootRef = React.useRef(null);
|
|
11
|
+
const [pos, setPos] = React.useState(null);
|
|
12
|
+
const open = (e) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
// flip so the menu stays on-screen near the right/bottom edges
|
|
15
|
+
const x = Math.min(e.clientX, window.innerWidth - 220);
|
|
16
|
+
const y = Math.min(e.clientY, window.innerHeight - 12 - items.length * 34);
|
|
17
|
+
setPos({ x: Math.max(8, x), y: Math.max(8, y) });
|
|
18
|
+
};
|
|
19
|
+
const close = React.useCallback(() => setPos(null), []);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (!pos)
|
|
22
|
+
return;
|
|
23
|
+
const onDown = (e) => {
|
|
24
|
+
if (!rootRef.current?.contains(e.target))
|
|
25
|
+
close();
|
|
26
|
+
};
|
|
27
|
+
const onKey = (e) => e.key === "Escape" && close();
|
|
28
|
+
document.addEventListener("pointerdown", onDown);
|
|
29
|
+
document.addEventListener("keydown", onKey);
|
|
30
|
+
return () => {
|
|
31
|
+
document.removeEventListener("pointerdown", onDown);
|
|
32
|
+
document.removeEventListener("keydown", onKey);
|
|
33
|
+
};
|
|
34
|
+
}, [pos, close]);
|
|
35
|
+
return (_jsxs("div", { ref: rootRef, className: contextmenuRecipe({ className }), children: [_jsx("div", { onContextMenu: open, children: children }), pos && (_jsx("div", { className: "contextmenu-content", role: "menu", style: { left: pos.x, top: pos.y }, children: items.map((item, i) => item.separator ? (_jsx("hr", { className: "contextmenu-sep" }, i)) : (_jsxs("button", { type: "button", role: "menuitem", disabled: item.disabled, className: item.danger
|
|
36
|
+
? "contextmenu-item contextmenu-item--danger"
|
|
37
|
+
: "contextmenu-item", onClick: () => {
|
|
38
|
+
item.onSelect?.();
|
|
39
|
+
close();
|
|
40
|
+
}, children: [item.icon, item.label, item.shortcut && (_jsx("span", { className: "contextmenu-shortcut", children: item.shortcut }))] }, i))) }))] }));
|
|
41
|
+
}
|
|
42
|
+
ContextMenu.displayName = "ContextMenu";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
3
|
+
// A right-click menu on the measured popover surface, positioned at the cursor.
|
|
4
|
+
const config = defineRecipe({
|
|
5
|
+
name: "contextmenu",
|
|
6
|
+
base: `display: contents; font-family: ${c.font.sans};
|
|
7
|
+
& .contextmenu-content { position: fixed; z-index: 60; min-width: 200px; box-sizing: border-box; padding: ${c.space["1"]}; border-radius: ${c.radius.xl}; background: ${c.bgPopover}; box-shadow: ${e.floating}; opacity: 1; transform: none; transition: opacity .08s ease, transform .08s ease; transform-origin: top left; @starting-style { opacity: 0; transform: scale(0.97) translateY(-1px); } }
|
|
8
|
+
& .contextmenu-item { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.menuRow}; box-sizing: border-box; padding: 0 ${c.space["2"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgPrimary}; font-family: inherit; font-size: ${c.text.lg}; text-align: start; white-space: nowrap; cursor: pointer; }
|
|
9
|
+
& .contextmenu-item svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
10
|
+
& .contextmenu-item:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); }
|
|
11
|
+
& .contextmenu-item--danger { color: ${c.bgDanger}; }
|
|
12
|
+
& .contextmenu-item--danger svg { color: ${c.bgDanger}; }
|
|
13
|
+
& .contextmenu-item--danger:hover { background: color-mix(in srgb, ${c.bgDanger} 10%, transparent); }
|
|
14
|
+
& .contextmenu-shortcut { margin-inline-start: auto; padding-inline-start: ${c.space["3"]}; color: ${c.fgMuted}; font-size: ${c.text.sm}; }
|
|
15
|
+
& .contextmenu-sep { height: 1px; margin: ${c.space["1"]} 0; border: none; background: ${c.borderSubtle}; }`,
|
|
16
|
+
variants: {},
|
|
17
|
+
defaultVariants: {},
|
|
18
|
+
compoundVariants: [],
|
|
19
|
+
});
|
|
20
|
+
export const contextmenuRecipe = resolveRecipe(config);
|
|
21
|
+
export default config;
|