@crisp-ui-kit/crisp 0.5.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 +14 -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/board.css +9 -1
- package/dist/bulkbar.css +11 -3
- package/dist/button.css +15 -1
- 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 +10 -2
- package/dist/datatable.css +60 -14
- 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 +10 -2
- 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 +17 -16
- package/dist/esm/components/accordion/accordion.recipe.js +1 -1
- package/dist/esm/components/avatargroup/avatargroup.js +2 -2
- package/dist/esm/components/avatargroup/avatargroup.recipe.js +2 -2
- package/dist/esm/components/badge/badge.recipe.js +4 -4
- package/dist/esm/components/barchart/barchart.js +15 -2
- package/dist/esm/components/barchart/barchart.recipe.js +10 -5
- package/dist/esm/components/breadcrumb/breadcrumb.js +2 -2
- package/dist/esm/components/bulkbar/bulkbar.js +2 -2
- package/dist/esm/components/bulkbar/bulkbar.recipe.js +4 -4
- package/dist/esm/components/button/button.js +13 -2
- package/dist/esm/components/button/button.recipe.js +20 -4
- package/dist/esm/components/callout/callout.js +2 -2
- package/dist/esm/components/checkbox/checkbox.recipe.js +9 -1
- 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.recipe.js +4 -4
- package/dist/esm/components/datatable/datatable.js +276 -49
- package/dist/esm/components/datatable/datatable.recipe.js +54 -16
- package/dist/esm/components/datepicker/datepicker.js +104 -53
- package/dist/esm/components/datepicker/datepicker.recipe.js +170 -25
- package/dist/esm/components/datepicker/index.js +1 -1
- 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 +2 -2
- package/dist/esm/components/dialog/dialog.recipe.js +4 -4
- package/dist/esm/components/divider/divider.js +2 -2
- package/dist/esm/components/donutchart/donutchart.js +2 -2
- package/dist/esm/components/drawer/drawer.js +2 -2
- package/dist/esm/components/drawer/drawer.recipe.js +6 -6
- package/dist/esm/components/emptystate/emptystate.js +2 -2
- package/dist/esm/components/formfield/formfield.js +2 -2
- package/dist/esm/components/input/input.js +6 -3
- package/dist/esm/components/input/input.recipe.js +38 -5
- package/dist/esm/components/linechart/linechart.js +15 -2
- package/dist/esm/components/linechart/linechart.recipe.js +10 -5
- package/dist/esm/components/menu/index.js +1 -0
- package/dist/esm/components/menu/menu-keyboard.js +80 -0
- package/dist/esm/components/menu/menu.js +27 -60
- package/dist/esm/components/menu/menu.recipe.js +5 -5
- package/dist/esm/components/multiselect/multiselect.js +10 -3
- package/dist/esm/components/multiselect/multiselect.recipe.js +8 -8
- package/dist/esm/components/popover/popover.js +2 -2
- package/dist/esm/components/popover/popover.recipe.js +2 -2
- package/dist/esm/components/progress/progress.js +3 -3
- package/dist/esm/components/radiogroup/radiogroup.js +2 -2
- package/dist/esm/components/radiogroup/radiogroup.recipe.js +1 -1
- 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/segmented.js +2 -2
- package/dist/esm/components/select/select.js +2 -2
- package/dist/esm/components/select/select.recipe.js +6 -6
- package/dist/esm/components/skeleton/skeleton.js +5 -2
- package/dist/esm/components/spinner/spinner.js +3 -2
- package/dist/esm/components/stagebar/stagebar.js +2 -2
- package/dist/esm/components/statcard/statcard.js +2 -2
- package/dist/esm/components/table/table.recipe.js +6 -6
- package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +3 -3
- package/dist/esm/components/tabletoolbar/tabletoolbar.js +21 -13
- package/dist/esm/components/tabs/tabs.js +2 -2
- package/dist/esm/components/tabs/tabs.recipe.js +4 -4
- package/dist/esm/components/textarea/textarea.js +5 -5
- package/dist/esm/components/textarea/textarea.recipe.js +16 -4
- package/dist/esm/components/toast/toast.js +4 -4
- package/dist/esm/components/toast/toast.recipe.js +2 -2
- package/dist/esm/components/tooltip/tooltip.js +21 -7
- 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/index.js +5 -0
- package/dist/esm/product/appshell/appshell.js +33 -9
- package/dist/esm/product/appshell/appshell.recipe.js +4 -4
- 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 +2 -2
- package/dist/esm/product/board/board.recipe.js +1 -1
- package/dist/esm/product/command/command.js +19 -6
- package/dist/esm/product/command/command.recipe.js +27 -2
- package/dist/esm/product/entitycard/entitycard.js +2 -2
- package/dist/esm/product/entitycard/entitycard.recipe.js +2 -2
- package/dist/esm/product/flowcanvas/flowcanvas.js +4 -4
- package/dist/esm/product/inbox/inbox.recipe.js +1 -1
- package/dist/esm/product/listpage/listpage.recipe.js +3 -3
- package/dist/esm/product/navitem/navitem.recipe.js +13 -1
- package/dist/esm/product/onboarding/onboarding.js +2 -2
- package/dist/esm/product/onboarding/onboarding.recipe.js +2 -2
- package/dist/esm/product/recordpage/recordpage.js +133 -47
- package/dist/esm/product/recordpage/recordpage.recipe.js +19 -17
- package/dist/esm/product/recordpanel/recordpanel.js +4 -4
- package/dist/esm/product/recordpanel/recordpanel.recipe.js +12 -16
- package/dist/esm/product/recordstable/recordstable.js +157 -66
- package/dist/esm/product/recordstable/recordstable.recipe.js +23 -23
- package/dist/esm/product/recordstable/recordstable.tag.js +18 -0
- package/dist/esm/product/richtext/richtext.js +3 -3
- package/dist/esm/product/richtext/richtext.recipe.js +3 -3
- package/dist/esm/product/settingssection/settingssection.js +2 -2
- package/dist/esm/product/settingsshell/settingsshell.js +2 -2
- package/dist/esm/product/settingsshell/settingsshell.recipe.js +7 -2
- package/dist/esm/product/sidebar/sidebar.js +2 -2
- package/dist/esm/product/sidebar/sidebar.recipe.js +27 -2
- package/dist/esm/product/tasklist/tasklist.js +4 -4
- package/dist/esm/product/trialbanner/trialbanner.js +2 -2
- package/dist/esm/product/trialbanner/trialbanner.recipe.js +2 -2
- package/dist/esm/product/viewtoggle/viewtoggle.js +10 -2
- package/dist/esm/product/viewtoggle/viewtoggle.recipe.js +1 -1
- package/dist/esm/tokens/elevation.js +44 -0
- package/dist/esm/tokens/index.js +1 -0
- package/dist/esm/tokens/palette.js +30 -0
- package/dist/esm/tokens/scale.js +7 -0
- package/dist/esm/tokens/semantic.js +24 -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 +11 -3
- package/dist/multiselect.css +14 -6
- 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 +8 -0
- package/dist/progress.css +8 -0
- package/dist/radiogroup.css +9 -1
- package/dist/recordpage.css +22 -12
- package/dist/recordpanel.css +25 -15
- package/dist/recordstable.css +37 -23
- 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 +12 -4
- 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/styles.css +2051 -1111
- package/dist/switch.css +8 -0
- package/dist/table.css +14 -6
- package/dist/tabletoolbar.css +8 -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 +29 -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 +58 -3
- 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 +2 -2
- 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 +2 -2
- package/dist/types/components/tabletoolbar/tabletoolbar.d.ts +28 -2
- 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 +5 -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/recordstable.d.ts +90 -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/sidebar.d.ts +8 -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 +14 -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 +40 -0
- package/dist/types/tokens/scale.d.ts +7 -0
- package/dist/types/tokens/semantic.d.ts +19 -0
- package/dist/viewtoggle.css +9 -1
- package/dist/wheelpicker.css +68 -0
- package/dist/wheelpicker.d.ts +7 -0
- package/package.json +160 -68
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Card = void 0;
|
|
37
|
+
exports.CardHeader = CardHeader;
|
|
38
|
+
exports.CardBody = CardBody;
|
|
39
|
+
exports.CardFooter = CardFooter;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const card_recipe_1 = require("./card.recipe");
|
|
43
|
+
/** A bordered surface card. Compose with CardHeader / CardBody / CardFooter. */
|
|
44
|
+
exports.Card = React.forwardRef(({ raised, interactive, className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, card_recipe_1.cardRecipe)({ raised, interactive, className }), ...props })));
|
|
45
|
+
exports.Card.displayName = "Card";
|
|
46
|
+
function CardHeader({ children, icon, action, }) {
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "card-header", children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "card-title", children: children }), action] }));
|
|
48
|
+
}
|
|
49
|
+
function CardBody({ children, className, }) {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className ? `card-body ${className}` : "card-body", children: children }));
|
|
51
|
+
}
|
|
52
|
+
function CardFooter({ children }) {
|
|
53
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "card-footer", children: children });
|
|
54
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cardRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A bordered surface card — the recurring container behind kanban cards, chart
|
|
7
|
+
// cards, workflow nodes, and highlight cells. `raised` adds a soft float shadow;
|
|
8
|
+
// `interactive` adds a hover affordance.
|
|
9
|
+
const config = (0, core_1.defineRecipe)({
|
|
10
|
+
name: "card",
|
|
11
|
+
base: `display: flex; flex-direction: column; box-sizing: border-box; border-radius: ${tokens_1.contract.radius.xl}; background: ${tokens_1.contract.bgSurface}; box-shadow: inset 0 0 0 1px ${tokens_1.contract.borderSubtle}; font-family: ${tokens_1.contract.font.sans}; color: ${tokens_1.contract.fgPrimary};
|
|
12
|
+
& .card-header { display: flex; align-items: center; gap: ${tokens_1.contract.space["2"]}; flex-shrink: 0; padding: ${tokens_1.contract.space["3"]} ${tokens_1.contract.space["4"]}; border-bottom: 1px solid ${tokens_1.contract.borderSubtle}; font-size: ${tokens_1.contract.text.lg}; font-weight: ${tokens_1.contract.weight.semibold}; }
|
|
13
|
+
& .card-header svg { flex-shrink: 0; color: ${tokens_1.contract.fgMuted}; }
|
|
14
|
+
& .card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
15
|
+
& .card-body { flex: 1; min-height: 0; padding: ${tokens_1.contract.space["4"]}; }
|
|
16
|
+
& .card-footer { display: flex; align-items: center; justify-content: flex-end; gap: ${tokens_1.contract.space["2"]}; flex-shrink: 0; padding: ${tokens_1.contract.space["3"]} ${tokens_1.contract.space["4"]}; border-top: 1px solid ${tokens_1.contract.borderSubtle}; }`,
|
|
17
|
+
variants: {
|
|
18
|
+
raised: {
|
|
19
|
+
true: `box-shadow: inset 0 0 0 1px ${tokens_1.contract.borderSubtle}, 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px -4px rgba(28,40,64,0.08);`,
|
|
20
|
+
false: "",
|
|
21
|
+
},
|
|
22
|
+
interactive: {
|
|
23
|
+
true: `cursor: pointer; transition: box-shadow 0.12s ease; &:hover { box-shadow: inset 0 0 0 1px ${tokens_1.contract.borderDefault}, 0 1px 2px rgba(0,0,0,0.04), 0 6px 16px -6px rgba(28,40,64,0.12); }`,
|
|
24
|
+
false: "",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { raised: false, interactive: false },
|
|
28
|
+
compoundVariants: [],
|
|
29
|
+
});
|
|
30
|
+
exports.cardRecipe = (0, core_1.resolveRecipe)(config);
|
|
31
|
+
exports.default = config;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cardRecipe = exports.CardHeader = exports.CardFooter = exports.CardBody = exports.Card = void 0;
|
|
4
|
+
var card_1 = require("./card");
|
|
5
|
+
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return card_1.Card; } });
|
|
6
|
+
Object.defineProperty(exports, "CardBody", { enumerable: true, get: function () { return card_1.CardBody; } });
|
|
7
|
+
Object.defineProperty(exports, "CardFooter", { enumerable: true, get: function () { return card_1.CardFooter; } });
|
|
8
|
+
Object.defineProperty(exports, "CardHeader", { enumerable: true, get: function () { return card_1.CardHeader; } });
|
|
9
|
+
var card_recipe_1 = require("./card.recipe");
|
|
10
|
+
Object.defineProperty(exports, "cardRecipe", { enumerable: true, get: function () { return card_recipe_1.cardRecipe; } });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Checkbox = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const core_1 = require("../../core");
|
|
40
|
+
const checkbox_recipe_1 = require("./checkbox.recipe");
|
|
41
|
+
/**
|
|
42
|
+
* A native `<input type="checkbox">` styled to Attio's grid checkbox (16px,
|
|
43
|
+
* r6, brand fill + white check). Native on purpose: keyboard, focus, and form
|
|
44
|
+
* semantics come for free. `indeterminate` is a DOM-only property, so it is
|
|
45
|
+
* applied via ref rather than an attribute.
|
|
46
|
+
*/
|
|
47
|
+
exports.Checkbox = React.forwardRef(({ className, indeterminate = false, asChild, ...props }, ref) => {
|
|
48
|
+
const innerRef = React.useRef(null);
|
|
49
|
+
React.useImperativeHandle(ref, () => innerRef.current);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
if (innerRef.current)
|
|
52
|
+
innerRef.current.indeterminate = indeterminate;
|
|
53
|
+
}, [indeterminate]);
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Primitive.input, { ref: innerRef, asChild: asChild, type: "checkbox", className: (0, checkbox_recipe_1.checkboxRecipe)({ className }), ...props }));
|
|
55
|
+
});
|
|
56
|
+
exports.Checkbox.displayName = "Checkbox";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkboxRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A 16px square checkbox measured from Attio's record grid: r6, a subtle 1px
|
|
7
|
+
// inset ring when empty, brand fill + white check when on. The check is a
|
|
8
|
+
// data-URI SVG background so it renders reliably (input pseudo-content doesn't).
|
|
9
|
+
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\")";
|
|
10
|
+
const config = (0, core_1.defineRecipe)({
|
|
11
|
+
name: "checkbox",
|
|
12
|
+
base: `appearance: none; -webkit-appearance: none; box-sizing: border-box; flex-shrink: 0; margin: 0; width: 16px; height: 16px; border: none; border-radius: ${tokens_1.contract.radius.sm}
|
|
13
|
+
; background: ${tokens_1.contract.bgSurface}
|
|
14
|
+
; box-shadow: inset 0 0 0 1px color-mix(in srgb, ${tokens_1.contract.fgPrimary}
|
|
15
|
+
9%, transparent); cursor: pointer; transition: background-color .12s, box-shadow .12s; &:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, ${tokens_1.contract.fgPrimary} 30%, transparent); }
|
|
16
|
+
&:checked, &:indeterminate { background: ${tokens_1.contract.bgBrandSolid} center / 10px no-repeat; box-shadow: none; }
|
|
17
|
+
&:checked { background-image: ${CHECK}; }
|
|
18
|
+
&:indeterminate { background-image: linear-gradient(${tokens_1.contract.fgOnBrand}, ${tokens_1.contract.fgOnBrand}); background-size: 8px 2px; }
|
|
19
|
+
&:focus-visible { outline: 2px solid ${tokens_1.contract.bgBrandSolid}; outline-offset: 1px; }
|
|
20
|
+
`,
|
|
21
|
+
variants: {},
|
|
22
|
+
defaultVariants: {},
|
|
23
|
+
compoundVariants: [],
|
|
24
|
+
});
|
|
25
|
+
exports.checkboxRecipe = Object.assign((0, core_1.resolveRecipe)(config), {
|
|
26
|
+
config,
|
|
27
|
+
meta: {
|
|
28
|
+
box: {
|
|
29
|
+
size: "16px",
|
|
30
|
+
borderRadius: "6px",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkboxRecipe = exports.Checkbox = void 0;
|
|
4
|
+
var checkbox_1 = require("./checkbox");
|
|
5
|
+
Object.defineProperty(exports, "Checkbox", { enumerable: true, get: function () { return checkbox_1.Checkbox; } });
|
|
6
|
+
var checkbox_recipe_1 = require("./checkbox.recipe");
|
|
7
|
+
Object.defineProperty(exports, "checkboxRecipe", { enumerable: true, get: function () { return checkbox_recipe_1.checkboxRecipe; } });
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CALC_LABEL = exports.NUMERIC_CALCS = exports.UNIVERSAL_CALCS = void 0;
|
|
37
|
+
exports.isEmptyValue = isEmptyValue;
|
|
38
|
+
exports.computeCalc = computeCalc;
|
|
39
|
+
exports.ColumnCalc = ColumnCalc;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const lucide_react_1 = require("lucide-react");
|
|
42
|
+
const React = __importStar(require("react"));
|
|
43
|
+
const menu_1 = require("../menu");
|
|
44
|
+
const columncalc_recipe_1 = require("./columncalc.recipe");
|
|
45
|
+
/** The four Attio offers on every column, in its order. */
|
|
46
|
+
exports.UNIVERSAL_CALCS = [
|
|
47
|
+
"countEmpty",
|
|
48
|
+
"countFilled",
|
|
49
|
+
"percentEmpty",
|
|
50
|
+
"percentFilled",
|
|
51
|
+
];
|
|
52
|
+
/** The four Attio adds for numeric columns, in its order. */
|
|
53
|
+
exports.NUMERIC_CALCS = ["sum", "average", "min", "max"];
|
|
54
|
+
exports.CALC_LABEL = {
|
|
55
|
+
none: "None",
|
|
56
|
+
countEmpty: "Count empty",
|
|
57
|
+
countFilled: "Count filled",
|
|
58
|
+
percentEmpty: "Percent empty",
|
|
59
|
+
percentFilled: "Percent filled",
|
|
60
|
+
sum: "Sum",
|
|
61
|
+
average: "Average",
|
|
62
|
+
min: "Min",
|
|
63
|
+
max: "Max",
|
|
64
|
+
};
|
|
65
|
+
/** A value counts as empty when it is null/undefined, "" or an empty array. */
|
|
66
|
+
function isEmptyValue(v) {
|
|
67
|
+
if (v == null)
|
|
68
|
+
return true;
|
|
69
|
+
if (typeof v === "string")
|
|
70
|
+
return v.trim() === "";
|
|
71
|
+
if (Array.isArray(v))
|
|
72
|
+
return v.length === 0;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Pure so the arithmetic is testable without rendering. Returns `null` for
|
|
77
|
+
* "none" and for numeric ops with no numbers to work on — a caller renders
|
|
78
|
+
* nothing rather than a misleading 0.
|
|
79
|
+
*/
|
|
80
|
+
function computeCalc(values, op) {
|
|
81
|
+
if (op === "none")
|
|
82
|
+
return null;
|
|
83
|
+
const total = values.length;
|
|
84
|
+
const empty = values.filter(isEmptyValue).length;
|
|
85
|
+
const filled = total - empty;
|
|
86
|
+
switch (op) {
|
|
87
|
+
case "countEmpty":
|
|
88
|
+
return empty;
|
|
89
|
+
case "countFilled":
|
|
90
|
+
return filled;
|
|
91
|
+
case "percentEmpty":
|
|
92
|
+
return total === 0 ? 0 : (empty / total) * 100;
|
|
93
|
+
case "percentFilled":
|
|
94
|
+
return total === 0 ? 0 : (filled / total) * 100;
|
|
95
|
+
default:
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
const nums = values
|
|
99
|
+
.filter((v) => !isEmptyValue(v))
|
|
100
|
+
.map((v) => (typeof v === "number" ? v : Number(v)))
|
|
101
|
+
.filter((n) => Number.isFinite(n));
|
|
102
|
+
if (nums.length === 0)
|
|
103
|
+
return null;
|
|
104
|
+
switch (op) {
|
|
105
|
+
case "sum":
|
|
106
|
+
return nums.reduce((a, b) => a + b, 0);
|
|
107
|
+
case "average":
|
|
108
|
+
return nums.reduce((a, b) => a + b, 0) / nums.length;
|
|
109
|
+
case "min":
|
|
110
|
+
return Math.min(...nums);
|
|
111
|
+
case "max":
|
|
112
|
+
return Math.max(...nums);
|
|
113
|
+
default:
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const defaultFormat = (n, op) => op === "percentEmpty" || op === "percentFilled"
|
|
118
|
+
? `${Math.round(n)}%`
|
|
119
|
+
: n.toLocaleString(undefined, { maximumFractionDigits: 2 });
|
|
120
|
+
function ColumnCalc({ rows, value, numeric = false, defaultOp = "none", op: opProp, onOpChange, format = defaultFormat, align, opLabels, className, ...rest }) {
|
|
121
|
+
// a partial override, so a consumer can translate one op without
|
|
122
|
+
// restating all nine
|
|
123
|
+
const labelFor = (o) => opLabels?.[o] ?? exports.CALC_LABEL[o];
|
|
124
|
+
const [internal, setInternal] = React.useState(defaultOp);
|
|
125
|
+
const op = opProp ?? internal;
|
|
126
|
+
const setOp = (next) => {
|
|
127
|
+
if (opProp === undefined)
|
|
128
|
+
setInternal(next);
|
|
129
|
+
onOpChange?.(next);
|
|
130
|
+
};
|
|
131
|
+
const values = React.useMemo(() => rows.map(value), [rows, value]);
|
|
132
|
+
const result = React.useMemo(() => computeCalc(values, op), [values, op]);
|
|
133
|
+
const ops = [
|
|
134
|
+
...exports.UNIVERSAL_CALCS,
|
|
135
|
+
...(numeric ? exports.NUMERIC_CALCS : []),
|
|
136
|
+
"none",
|
|
137
|
+
];
|
|
138
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: (0, columncalc_recipe_1.columncalcRecipe)({ className }), ...rest, children: (0, jsx_runtime_1.jsxs)(menu_1.Menu, { trigger: (0, jsx_runtime_1.jsx)("button", { type: "button", className: "columncalc-trigger", "data-align": align === "right" ? "right" : undefined, children: op === "none" || result === null ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { size: 12, strokeWidth: 2 }), (0, jsx_runtime_1.jsx)("span", { className: "columncalc-placeholder", children: "Add calculation" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "columncalc-value", children: format(result, op) }), (0, jsx_runtime_1.jsx)("span", { className: "columncalc-op", children: labelFor(op) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 12, strokeWidth: 2 })] })) }), children: [(0, jsx_runtime_1.jsx)("div", { className: "columncalc-section", children: "Aggregations" }), ops.map((o) => ((0, jsx_runtime_1.jsx)(menu_1.MenuItem, { onSelect: () => setOp(o), children: labelFor(o) }, o)))] }) }));
|
|
139
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.columncalcRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// Attio's column footer calculation. The summary row is 36px and sticky at the
|
|
7
|
+
// grid's bottom edge; each cell holds a quiet trigger that reads "Add
|
|
8
|
+
// calculation" until an aggregation is chosen, then shows the value with its
|
|
9
|
+
// operation name beside it.
|
|
10
|
+
const config = (0, core_1.defineRecipe)({
|
|
11
|
+
name: "columncalc",
|
|
12
|
+
base: `display: flex; align-items: stretch; width: 100%; height: 100%; font-family: ${tokens_1.contract.font.sans};
|
|
13
|
+
/* Menu wraps its trigger in a flex div that sizes to content, which would
|
|
14
|
+
shrink the button back to its text. Make the wrapper fill too, so the
|
|
15
|
+
whole cell stays clickable. */
|
|
16
|
+
& .menu { width: 100%; height: 100%; }
|
|
17
|
+
/* Attio's hit target is the WHOLE summary cell -- measured 246x37 with
|
|
18
|
+
padding 0 12px, not a content-sized chip. Clicking anywhere in the cell
|
|
19
|
+
opens the aggregation menu. */
|
|
20
|
+
& .columncalc-trigger { display: flex; align-items: center; gap: ${tokens_1.contract.space["1"]}; width: 100%; height: 100%; min-height: ${tokens_1.contract.size.tableRow}; margin: 0; padding: 0 ${tokens_1.contract.space["3"]}; border: none; border-radius: ${tokens_1.contract.radius.md}; background: transparent; color: ${tokens_1.contract.fgMuted}; font-family: inherit; font-size: ${tokens_1.contract.text.md}; font-weight: ${tokens_1.contract.weight.medium}; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
21
|
+
& .columncalc-trigger:hover { background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 4%, transparent); color: ${tokens_1.contract.fgPrimary}; }
|
|
22
|
+
& .columncalc-trigger svg { flex-shrink: 0; opacity: 0.7; }
|
|
23
|
+
& .columncalc-trigger[data-align="right"] { justify-content: flex-end; }
|
|
24
|
+
& .columncalc-placeholder { overflow: hidden; text-overflow: ellipsis; }
|
|
25
|
+
& .columncalc-value { color: ${tokens_1.contract.fgPrimary}; font-variant-numeric: tabular-nums; }
|
|
26
|
+
& .columncalc-op { color: ${tokens_1.contract.fgMuted}; }
|
|
27
|
+
& .columncalc-section { padding: ${tokens_1.contract.space["1.5"]} ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["1"]}; font-size: ${tokens_1.contract.text.sm}; font-weight: ${tokens_1.contract.weight.medium}; color: ${tokens_1.contract.fgMuted}; }`,
|
|
28
|
+
variants: {},
|
|
29
|
+
defaultVariants: {},
|
|
30
|
+
compoundVariants: [],
|
|
31
|
+
});
|
|
32
|
+
exports.columncalcRecipe = (0, core_1.resolveRecipe)(config);
|
|
33
|
+
exports.default = config;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNIVERSAL_CALCS = exports.NUMERIC_CALCS = exports.isEmptyValue = exports.computeCalc = exports.ColumnCalc = exports.CALC_LABEL = void 0;
|
|
4
|
+
var columncalc_1 = require("./columncalc");
|
|
5
|
+
Object.defineProperty(exports, "CALC_LABEL", { enumerable: true, get: function () { return columncalc_1.CALC_LABEL; } });
|
|
6
|
+
Object.defineProperty(exports, "ColumnCalc", { enumerable: true, get: function () { return columncalc_1.ColumnCalc; } });
|
|
7
|
+
Object.defineProperty(exports, "computeCalc", { enumerable: true, get: function () { return columncalc_1.computeCalc; } });
|
|
8
|
+
Object.defineProperty(exports, "isEmptyValue", { enumerable: true, get: function () { return columncalc_1.isEmptyValue; } });
|
|
9
|
+
Object.defineProperty(exports, "NUMERIC_CALCS", { enumerable: true, get: function () { return columncalc_1.NUMERIC_CALCS; } });
|
|
10
|
+
Object.defineProperty(exports, "UNIVERSAL_CALCS", { enumerable: true, get: function () { return columncalc_1.UNIVERSAL_CALCS; } });
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ContextMenu = ContextMenu;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const contextmenu_recipe_1 = require("./contextmenu.recipe");
|
|
40
|
+
/**
|
|
41
|
+
* A right-click context menu — the popover surface positioned at the cursor.
|
|
42
|
+
* Wrap the target; right-clicking it opens the menu (flipping at the viewport
|
|
43
|
+
* edges), closing on select, outside pointer-down, and Escape.
|
|
44
|
+
*/
|
|
45
|
+
function ContextMenu({ children, items, className }) {
|
|
46
|
+
const rootRef = React.useRef(null);
|
|
47
|
+
const [pos, setPos] = React.useState(null);
|
|
48
|
+
const open = (e) => {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
// flip so the menu stays on-screen near the right/bottom edges
|
|
51
|
+
const x = Math.min(e.clientX, window.innerWidth - 220);
|
|
52
|
+
const y = Math.min(e.clientY, window.innerHeight - 12 - items.length * 34);
|
|
53
|
+
setPos({ x: Math.max(8, x), y: Math.max(8, y) });
|
|
54
|
+
};
|
|
55
|
+
const close = React.useCallback(() => setPos(null), []);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (!pos)
|
|
58
|
+
return;
|
|
59
|
+
const onDown = (e) => {
|
|
60
|
+
if (!rootRef.current?.contains(e.target))
|
|
61
|
+
close();
|
|
62
|
+
};
|
|
63
|
+
const onKey = (e) => e.key === "Escape" && close();
|
|
64
|
+
document.addEventListener("pointerdown", onDown);
|
|
65
|
+
document.addEventListener("keydown", onKey);
|
|
66
|
+
return () => {
|
|
67
|
+
document.removeEventListener("pointerdown", onDown);
|
|
68
|
+
document.removeEventListener("keydown", onKey);
|
|
69
|
+
};
|
|
70
|
+
}, [pos, close]);
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: rootRef, className: (0, contextmenu_recipe_1.contextmenuRecipe)({ className }), children: [(0, jsx_runtime_1.jsx)("div", { onContextMenu: open, children: children }), pos && ((0, jsx_runtime_1.jsx)("div", { className: "contextmenu-content", role: "menu", style: { left: pos.x, top: pos.y }, children: items.map((item, i) => item.separator ? ((0, jsx_runtime_1.jsx)("hr", { className: "contextmenu-sep" }, i)) : ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "menuitem", disabled: item.disabled, className: item.danger
|
|
72
|
+
? "contextmenu-item contextmenu-item--danger"
|
|
73
|
+
: "contextmenu-item", onClick: () => {
|
|
74
|
+
item.onSelect?.();
|
|
75
|
+
close();
|
|
76
|
+
}, children: [item.icon, item.label, item.shortcut && ((0, jsx_runtime_1.jsx)("span", { className: "contextmenu-shortcut", children: item.shortcut }))] }, i))) }))] }));
|
|
77
|
+
}
|
|
78
|
+
ContextMenu.displayName = "ContextMenu";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contextmenuRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A right-click menu on the measured popover surface, positioned at the cursor.
|
|
7
|
+
const config = (0, core_1.defineRecipe)({
|
|
8
|
+
name: "contextmenu",
|
|
9
|
+
base: `display: contents; font-family: ${tokens_1.contract.font.sans};
|
|
10
|
+
& .contextmenu-content { position: fixed; z-index: 60; min-width: 200px; box-sizing: border-box; padding: ${tokens_1.contract.space["1"]}; border-radius: ${tokens_1.contract.radius.xl}; background: ${tokens_1.contract.bgPopover}; box-shadow: ${tokens_1.elevation.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); } }
|
|
11
|
+
& .contextmenu-item { display: flex; align-items: center; gap: ${tokens_1.contract.space["2"]}; width: 100%; height: ${tokens_1.contract.size.menuRow}; box-sizing: border-box; padding: 0 ${tokens_1.contract.space["2"]}; margin: 0; border: none; border-radius: ${tokens_1.contract.radius.md}; background: none; color: ${tokens_1.contract.fgPrimary}; font-family: inherit; font-size: ${tokens_1.contract.text.lg}; text-align: start; white-space: nowrap; cursor: pointer; }
|
|
12
|
+
& .contextmenu-item svg { flex-shrink: 0; color: ${tokens_1.contract.fgMuted}; }
|
|
13
|
+
& .contextmenu-item:hover { background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 6%, transparent); }
|
|
14
|
+
& .contextmenu-item--danger { color: ${tokens_1.contract.bgDanger}; }
|
|
15
|
+
& .contextmenu-item--danger svg { color: ${tokens_1.contract.bgDanger}; }
|
|
16
|
+
& .contextmenu-item--danger:hover { background: color-mix(in srgb, ${tokens_1.contract.bgDanger} 10%, transparent); }
|
|
17
|
+
& .contextmenu-shortcut { margin-inline-start: auto; padding-inline-start: ${tokens_1.contract.space["3"]}; color: ${tokens_1.contract.fgMuted}; font-size: ${tokens_1.contract.text.sm}; }
|
|
18
|
+
& .contextmenu-sep { height: 1px; margin: ${tokens_1.contract.space["1"]} 0; border: none; background: ${tokens_1.contract.borderSubtle}; }`,
|
|
19
|
+
variants: {},
|
|
20
|
+
defaultVariants: {},
|
|
21
|
+
compoundVariants: [],
|
|
22
|
+
});
|
|
23
|
+
exports.contextmenuRecipe = (0, core_1.resolveRecipe)(config);
|
|
24
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contextmenuRecipe = exports.ContextMenu = void 0;
|
|
4
|
+
var contextmenu_1 = require("./contextmenu");
|
|
5
|
+
Object.defineProperty(exports, "ContextMenu", { enumerable: true, get: function () { return contextmenu_1.ContextMenu; } });
|
|
6
|
+
var contextmenu_recipe_1 = require("./contextmenu.recipe");
|
|
7
|
+
Object.defineProperty(exports, "contextmenuRecipe", { enumerable: true, get: function () { return contextmenu_recipe_1.contextmenuRecipe; } });
|