@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
|
@@ -8,7 +8,7 @@ const RadioContext = React.createContext(null);
|
|
|
8
8
|
* preview cards whose border turns brand when picked (the Theme picker). Arrow
|
|
9
9
|
* keys move between options (roving focus). Controlled or uncontrolled.
|
|
10
10
|
*/
|
|
11
|
-
export function RadioGroup({ value, defaultValue, onValueChange, variant = "default", name, className, "aria-label": ariaLabel, children, }) {
|
|
11
|
+
export function RadioGroup({ value, defaultValue, onValueChange, variant = "default", name, className, "aria-label": ariaLabel, children, ...rest }) {
|
|
12
12
|
const [internal, setInternal] = React.useState(defaultValue);
|
|
13
13
|
const selected = value ?? internal;
|
|
14
14
|
const generatedName = React.useId();
|
|
@@ -31,7 +31,7 @@ export function RadioGroup({ value, defaultValue, onValueChange, variant = "defa
|
|
|
31
31
|
next.dataset.value && select(next.dataset.value);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
return (_jsx(RadioContext.Provider, { value: { value: selected, select, name: groupName, variant }, children: _jsx("div", { role: "radiogroup", "aria-label": ariaLabel, "data-variant": variant, className: radiogroupRecipe({ className }), onKeyDown: onKeyDown, children: children }) }));
|
|
34
|
+
return (_jsx(RadioContext.Provider, { value: { value: selected, select, name: groupName, variant }, children: _jsx("div", { role: "radiogroup", "aria-label": ariaLabel, "data-variant": variant, className: radiogroupRecipe({ className }), ...rest, onKeyDown: onKeyDown, children: children }) }));
|
|
35
35
|
}
|
|
36
36
|
RadioGroup.displayName = "RadioGroup";
|
|
37
37
|
export function Radio({ value, label, children, disabled }) {
|
|
@@ -10,7 +10,7 @@ const config = defineRecipe({
|
|
|
10
10
|
display: flex; flex-direction: column; gap: ${c.space["1"]}; font-family: ${c.font.sans};
|
|
11
11
|
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
12
12
|
|
|
13
|
-
& .radio { display: flex; align-items: center; gap: ${c.space["2"]}; margin: 0; padding: ${c.space["1"]} ${c.space["1"]}; border: none; background: none; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align:
|
|
13
|
+
& .radio { display: flex; align-items: center; gap: ${c.space["2"]}; margin: 0; padding: ${c.space["1"]} ${c.space["1"]}; border: none; background: none; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align: start; cursor: pointer; }
|
|
14
14
|
& .radio:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
15
15
|
& .radio:focus-visible { outline: none; }
|
|
16
16
|
& .radio-dot { position: relative; flex-shrink: 0; width: 16px; height: 16px; border-radius: ${c.radius.full}; box-shadow: inset 0 0 0 1.5px ${c.borderDefault}; transition: box-shadow .12s ease; }
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { resizablepanelRecipe } from "./resizablepanel.recipe.js";
|
|
4
|
+
/**
|
|
5
|
+
* Drag delta -> next width, in px, signed by which edge of the panel the
|
|
6
|
+
* handle drags from. A left-side panel's handle sits at its *right* edge, so
|
|
7
|
+
* dragging right (positive dx) grows it; a right-side panel's handle sits at
|
|
8
|
+
* its *left* edge, so dragging right shrinks it. Pure so drag math can be
|
|
9
|
+
* unit-tested without a DOM.
|
|
10
|
+
*/
|
|
11
|
+
export function computeDragWidth(startWidth, startX, clientX, side) {
|
|
12
|
+
const dx = clientX - startX;
|
|
13
|
+
return side === "left" ? startWidth + dx : startWidth - dx;
|
|
14
|
+
}
|
|
15
|
+
/** width (px) -> percentage of the container's width. Pure, unrounded. */
|
|
16
|
+
export function widthToPercent(width, containerWidth) {
|
|
17
|
+
if (!(containerWidth > 0))
|
|
18
|
+
return 0;
|
|
19
|
+
return (width / containerWidth) * 100;
|
|
20
|
+
}
|
|
21
|
+
/** percentage of the container's width -> width (px). Pure, unrounded. */
|
|
22
|
+
export function percentToWidth(percent, containerWidth) {
|
|
23
|
+
return (percent / 100) * containerWidth;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reads a persisted width percentage, wrapped in try/catch: `localStorage`
|
|
27
|
+
* can throw (private browsing, storage disabled), and a resizable panel
|
|
28
|
+
* failing to *render* over a persistence error would be worse than the
|
|
29
|
+
* panel simply forgetting its width. `storage` defaults to
|
|
30
|
+
* `window.localStorage` and exists as a seam for tests — dropping the
|
|
31
|
+
* try/catch here is the exact failure this must catch.
|
|
32
|
+
*/
|
|
33
|
+
export function readStoredPercent(key, storage = window.localStorage) {
|
|
34
|
+
try {
|
|
35
|
+
const raw = storage.getItem(key);
|
|
36
|
+
if (raw == null)
|
|
37
|
+
return null;
|
|
38
|
+
const n = Number(raw);
|
|
39
|
+
return Number.isFinite(n) ? n : null;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// private mode / storage disabled — behave as if nothing is stored
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Writes a persisted width percentage, wrapped in try/catch — see {@link readStoredPercent}. */
|
|
47
|
+
export function writeStoredPercent(key, percent, storage = window.localStorage) {
|
|
48
|
+
try {
|
|
49
|
+
storage.setItem(key, String(percent));
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// private mode / quota exceeded — persistence is best-effort
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Attio's adjustable-panel primitive: a spacer that reserves layout width
|
|
57
|
+
* plus a panel that overlays it, so the panel can move between docked
|
|
58
|
+
* (in-flow) and floating (`position: fixed`, an overlay) without a reflow
|
|
59
|
+
* glitch. Drag the edge handle to resize; constraints are CSS `min-width`/
|
|
60
|
+
* `max-width`, never re-clamped in JS.
|
|
61
|
+
*/
|
|
62
|
+
export function ResizablePanel({ side = "left", size, defaultSize = 280, onSizeChange, min = 200, max, floating = false, handleVariant = "panel", storageKey, className, children, ...rest }) {
|
|
63
|
+
const controlled = size != null;
|
|
64
|
+
const [uncontrolledSize, setUncontrolledSize] = React.useState(defaultSize);
|
|
65
|
+
const width = controlled ? size : uncontrolledSize;
|
|
66
|
+
const containerRef = React.useRef(null);
|
|
67
|
+
const panelRef = React.useRef(null);
|
|
68
|
+
const dragRef = React.useRef(null);
|
|
69
|
+
const [dragging, setDragging] = React.useState(false);
|
|
70
|
+
// Restore a persisted percentage on mount (uncontrolled + storageKey only).
|
|
71
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: restore the persisted width once, on mount only
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (controlled || !storageKey)
|
|
74
|
+
return;
|
|
75
|
+
const percent = readStoredPercent(storageKey);
|
|
76
|
+
if (percent == null)
|
|
77
|
+
return;
|
|
78
|
+
const containerWidth = containerRef.current?.getBoundingClientRect().width;
|
|
79
|
+
if (!containerWidth)
|
|
80
|
+
return;
|
|
81
|
+
setUncontrolledSize(percentToWidth(percent, containerWidth));
|
|
82
|
+
}, []);
|
|
83
|
+
const commitSize = React.useCallback((next) => {
|
|
84
|
+
if (!controlled)
|
|
85
|
+
setUncontrolledSize(next);
|
|
86
|
+
onSizeChange?.(next);
|
|
87
|
+
if (!controlled && storageKey) {
|
|
88
|
+
const containerWidth = containerRef.current?.getBoundingClientRect().width;
|
|
89
|
+
if (containerWidth) {
|
|
90
|
+
writeStoredPercent(storageKey, widthToPercent(next, containerWidth));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, [controlled, onSizeChange, storageKey]);
|
|
94
|
+
function onHandlePointerDown(e) {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
97
|
+
dragRef.current = { startX: e.clientX, startWidth: width, moved: false };
|
|
98
|
+
}
|
|
99
|
+
function onHandlePointerMove(e) {
|
|
100
|
+
const drag = dragRef.current;
|
|
101
|
+
if (!drag)
|
|
102
|
+
return;
|
|
103
|
+
if (!drag.moved) {
|
|
104
|
+
drag.moved = true;
|
|
105
|
+
setDragging(true);
|
|
106
|
+
}
|
|
107
|
+
const next = computeDragWidth(drag.startWidth, drag.startX, e.clientX, side);
|
|
108
|
+
if (!controlled)
|
|
109
|
+
setUncontrolledSize(next);
|
|
110
|
+
onSizeChange?.(next);
|
|
111
|
+
}
|
|
112
|
+
function onHandlePointerUp(e) {
|
|
113
|
+
const drag = dragRef.current;
|
|
114
|
+
dragRef.current = null;
|
|
115
|
+
setDragging(false);
|
|
116
|
+
e.target.releasePointerCapture?.(e.pointerId);
|
|
117
|
+
if (!drag)
|
|
118
|
+
return;
|
|
119
|
+
// Never re-clamp here: read back the panel's actual, CSS-clamped
|
|
120
|
+
// rendered width after layout, and commit *that* value.
|
|
121
|
+
const rect = panelRef.current?.getBoundingClientRect();
|
|
122
|
+
const finalWidth = rect ? Math.round(rect.width) : width;
|
|
123
|
+
commitSize(finalWidth);
|
|
124
|
+
}
|
|
125
|
+
const maxStyle = max == null ? undefined : typeof max === "number" ? `${max}px` : max;
|
|
126
|
+
const panelSizeStyle = {
|
|
127
|
+
width,
|
|
128
|
+
minWidth: min,
|
|
129
|
+
maxWidth: maxStyle,
|
|
130
|
+
};
|
|
131
|
+
return (_jsxs("div", { ref: containerRef, className: resizablepanelRecipe({ className }), ...rest, children: [_jsx("div", { className: "resizablepanel-spacer", style: floating ? { width: 0 } : { width, minWidth: min, maxWidth: maxStyle } }), _jsxs("div", { ref: panelRef, className: "resizablepanel-panel", "data-side": side, "data-floating": floating ? "true" : "false", style: panelSizeStyle, children: [_jsx("div", { className: "resizablepanel-inner", children: children }), _jsx("div", { className: handleVariant === "column"
|
|
132
|
+
? "resizablepanel-handle resizablepanel-handle--column"
|
|
133
|
+
: "resizablepanel-handle", "data-side": side, "data-dragging": dragging ? "true" : undefined, "data-handle": "", onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp, children: handleVariant === "column" && (_jsx("span", { className: "resizablepanel-handle-inner", "aria-hidden": "true" })) })] })] }));
|
|
134
|
+
}
|
|
135
|
+
ResizablePanel.displayName = "ResizablePanel";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
+
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
3
|
+
// Attio's adjustable-panel primitive (measured live — see
|
|
4
|
+
// docs/study/attio-panels.md §1-2). Two elements carry the layout: an
|
|
5
|
+
// invisible SPACER that reserves flow width (it alone animates `width`, a
|
|
6
|
+
// cheap reflow of a leaf node) and the PANEL, taken out of flow with
|
|
7
|
+
// `position: absolute` and drawn on top of the spacer. That split is what
|
|
8
|
+
// lets the panel move between docked (in-flow, hairline divider, no
|
|
9
|
+
// elevation) and floating (position: fixed, 8px gutter, r10, the measured
|
|
10
|
+
// tier-1 elevation) without a reflow glitch on the rest of the layout.
|
|
11
|
+
//
|
|
12
|
+
// Per Lesson 27, the floating panel rests at `transform: none` — the
|
|
13
|
+
// measured off-canvas value (`translateX(calc(-100% - space-2))`, identical
|
|
14
|
+
// to Drawer's left-side value) lives in `@starting-style` as the enter
|
|
15
|
+
// transform only, never as a permanent resting position.
|
|
16
|
+
const config = defineRecipe({
|
|
17
|
+
name: "resizablepanel",
|
|
18
|
+
base: `
|
|
19
|
+
position: relative; display: flex; height: 100%;
|
|
20
|
+
& .resizablepanel-spacer { flex: 0 0 auto; height: 100%; transition: width 0.14s; }
|
|
21
|
+
& .resizablepanel-panel { position: absolute; top: 0; bottom: 0; box-sizing: border-box; overflow: hidden; background: ${c.bgSurface}; }
|
|
22
|
+
& .resizablepanel-panel[data-side="left"] { left: 0; }
|
|
23
|
+
& .resizablepanel-panel[data-side="right"] { right: 0; }
|
|
24
|
+
|
|
25
|
+
/* docked */
|
|
26
|
+
& .resizablepanel-panel[data-floating="false"] { border-radius: 0; box-shadow: none; }
|
|
27
|
+
& .resizablepanel-panel[data-floating="false"][data-side="left"] { border-inline-end: 1px solid ${c.borderSubtle}; }
|
|
28
|
+
& .resizablepanel-panel[data-floating="false"][data-side="right"] { border-inline-start: 1px solid ${c.borderSubtle}; }
|
|
29
|
+
|
|
30
|
+
/* floating — position: fixed, 8px gutter, r10, the measured floating elevation.
|
|
31
|
+
Rest is transform: none (Lesson 27); the off-canvas value is the @starting-style enter only. */
|
|
32
|
+
& .resizablepanel-panel[data-floating="true"] { position: fixed; top: ${c.space["2"]}; bottom: ${c.space["2"]}; border-inline-end: none; border-inline-start: none; border-radius: 10px; box-shadow: ${e.floating}; transform: none; transition: transform 0.14s, padding 0.14s; }
|
|
33
|
+
& .resizablepanel-panel[data-floating="true"][data-side="left"] { padding: ${c.space["2"]} 0 ${c.space["2"]} ${c.space["2"]}; @starting-style { transform: translateX(calc(-100% - ${c.space["2"]})); } }
|
|
34
|
+
& .resizablepanel-panel[data-floating="true"][data-side="right"] { padding: ${c.space["2"]} ${c.space["2"]} ${c.space["2"]} 0; @starting-style { transform: translateX(calc(100% + ${c.space["2"]})); } }
|
|
35
|
+
|
|
36
|
+
& .resizablepanel-inner { height: 100%; opacity: 1; }
|
|
37
|
+
& .resizablepanel-panel[data-floating="true"] .resizablepanel-inner { opacity: 1; transition: opacity 0.14s; @starting-style { opacity: 0; } }
|
|
38
|
+
|
|
39
|
+
/* handle — variant "panel" (default): a 10px hit target, its ::before the
|
|
40
|
+
only visible divider (1px rest -> 2px on hover/drag, brand-solid). */
|
|
41
|
+
& .resizablepanel-handle { position: absolute; top: 0; width: 10px; height: 100%; z-index: 2; cursor: col-resize; background: transparent; touch-action: none; }
|
|
42
|
+
& .resizablepanel-handle[data-side="left"] { right: 0; }
|
|
43
|
+
& .resizablepanel-handle[data-side="right"] { left: 0; }
|
|
44
|
+
& .resizablepanel-handle::before { content: ""; position: absolute; top: 0; width: 1px; height: 100%; background: ${c.borderSubtle}; transition: background-color 0.16s, height 0.16s; }
|
|
45
|
+
& .resizablepanel-handle[data-side="left"]::before { right: 0; }
|
|
46
|
+
& .resizablepanel-handle[data-side="right"]::before { left: 0; }
|
|
47
|
+
& .resizablepanel-handle:hover::before, & .resizablepanel-handle[data-dragging="true"]::before { width: 2px; background: ${c.bgBrandSolid}; }
|
|
48
|
+
|
|
49
|
+
/* handle — variant "column": a wider 7px hit target straddling a 1px
|
|
50
|
+
divider (table column edges), with a real 3px inner bar whose opacity
|
|
51
|
+
comes in on a 100ms DELAY — distinct from the panel variant's instant
|
|
52
|
+
::before swap. */
|
|
53
|
+
/* .resizablepanel-handle.resizablepanel-handle--column (both classes) to
|
|
54
|
+
out-specificity the base [data-side] left/right rules above, which
|
|
55
|
+
otherwise tie-break by source order alone and would win. */
|
|
56
|
+
& .resizablepanel-handle.resizablepanel-handle--column { display: flex; align-items: center; justify-content: center; width: 7px; left: -3px; right: -3px; z-index: 1; cursor: col-resize; }
|
|
57
|
+
& .resizablepanel-handle--column::before { content: none; }
|
|
58
|
+
& .resizablepanel-handle-inner { width: 3px; height: 100%; border-radius: 3px; background: ${c.bgBrandSolid}; opacity: 0; transition: opacity 0.1s 0.1s; }
|
|
59
|
+
& .resizablepanel-handle--column:hover .resizablepanel-handle-inner, & .resizablepanel-handle--column[data-dragging="true"] .resizablepanel-handle-inner { opacity: 1; }
|
|
60
|
+
`,
|
|
61
|
+
variants: {},
|
|
62
|
+
defaultVariants: {},
|
|
63
|
+
compoundVariants: [],
|
|
64
|
+
});
|
|
65
|
+
export const resizablepanelRecipe = resolveRecipe(config);
|
|
66
|
+
export default config;
|
|
@@ -6,7 +6,7 @@ import { segmentedRecipe } from "./segmented.recipe.js";
|
|
|
6
6
|
* switcher. `role="radiogroup"` over `role="radio"` buttons with roving
|
|
7
7
|
* tabindex and ←/→ (Home/End) keyboard selection.
|
|
8
8
|
*/
|
|
9
|
-
export function Segmented({ options, value, defaultValue, onValueChange, "aria-label": ariaLabel, className, }) {
|
|
9
|
+
export function Segmented({ options, value, defaultValue, onValueChange, "aria-label": ariaLabel, className, ...rest }) {
|
|
10
10
|
const [internal, setInternal] = React.useState(defaultValue ?? options[0]?.value);
|
|
11
11
|
const selected = value ?? internal;
|
|
12
12
|
const rootRef = React.useRef(null);
|
|
@@ -45,7 +45,7 @@ export function Segmented({ options, value, defaultValue, onValueChange, "aria-l
|
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
select(enabled[next].value);
|
|
47
47
|
};
|
|
48
|
-
return (_jsxs("div", { ref: rootRef, className: segmentedRecipe({ className }), role: "radiogroup", "aria-label": ariaLabel, children: [thumb && (_jsx("span", { className: "segmented-thumb", "aria-hidden": "true", style: {
|
|
48
|
+
return (_jsxs("div", { ref: rootRef, className: segmentedRecipe({ className }), ...rest, role: "radiogroup", "aria-label": ariaLabel, children: [thumb && (_jsx("span", { className: "segmented-thumb", "aria-hidden": "true", style: {
|
|
49
49
|
width: thumb.width,
|
|
50
50
|
transform: `translateX(${thumb.left}px)`,
|
|
51
51
|
} })), options.map((opt, i) => {
|
|
@@ -14,7 +14,7 @@ function optionText(o) {
|
|
|
14
14
|
* "No results" empty state). Full keyboard model — ↑/↓ move, Enter/Space pick,
|
|
15
15
|
* Esc close, Home/End jump, opens upward when tight. Controlled or uncontrolled.
|
|
16
16
|
*/
|
|
17
|
-
export function Select({ options, value, defaultValue, onValueChange, placeholder = "Select…", variant = "default", width = "full", searchable, searchPlaceholder = "Search…", disabled, className, "aria-label": ariaLabel, id, }) {
|
|
17
|
+
export function Select({ options, value, defaultValue, onValueChange, placeholder = "Select…", variant = "default", width = "full", searchable, searchPlaceholder = "Search…", disabled, className, "aria-label": ariaLabel, id, ...rest }) {
|
|
18
18
|
const [internal, setInternal] = React.useState(defaultValue);
|
|
19
19
|
const selected = value ?? internal;
|
|
20
20
|
const [open, setOpen] = React.useState(false);
|
|
@@ -133,7 +133,7 @@ export function Select({ options, value, defaultValue, onValueChange, placeholde
|
|
|
133
133
|
document.addEventListener("pointerdown", onDown);
|
|
134
134
|
return () => document.removeEventListener("pointerdown", onDown);
|
|
135
135
|
}, [open]);
|
|
136
|
-
return (_jsxs("div", { ref: rootRef, className: selectRecipe({ variant, width, className }), children: [_jsxs("button", { ref: triggerRef, type: "button", id: id, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": ariaLabel, disabled: disabled, "data-open": open ? "" : undefined, className: "select-trigger", onClick: () => (open ? setOpen(false) : openMenu()), onKeyDown: onTriggerKeyDown, children: [_jsx("span", { className: "select-value", children: selectedOption ? (_jsxs(_Fragment, { children: [selectedOption.color && (_jsx("span", { className: "select-option-dot", style: { background: selectedOption.color } })), selectedOption.label] })) : (_jsx("span", { className: "select-placeholder", children: placeholder })) }), _jsx(ChevronDown, { className: "select-chevron", size: 16, strokeWidth: 1.75 })] }), open && (_jsxs("div", { className: "select-listbox", role: "listbox", "aria-label": ariaLabel, "data-up": up ? "" : undefined, style: pos, children: [searchable && (_jsxs("div", { className: "select-search", children: [_jsx(Search, { size: 15, strokeWidth: 1.75 }), _jsx("input", { ref: searchRef, type: "text", placeholder: searchPlaceholder, "aria-label": searchPlaceholder, value: query, onChange: (e) => {
|
|
136
|
+
return (_jsxs("div", { ref: rootRef, className: selectRecipe({ variant, width, className }), ...rest, children: [_jsxs("button", { ref: triggerRef, type: "button", id: id, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": ariaLabel, disabled: disabled, "data-open": open ? "" : undefined, className: "select-trigger", onClick: () => (open ? setOpen(false) : openMenu()), onKeyDown: onTriggerKeyDown, children: [_jsx("span", { className: "select-value", children: selectedOption ? (_jsxs(_Fragment, { children: [selectedOption.color && (_jsx("span", { className: "select-option-dot", style: { background: selectedOption.color } })), selectedOption.label] })) : (_jsx("span", { className: "select-placeholder", children: placeholder })) }), _jsx(ChevronDown, { className: "select-chevron", size: 16, strokeWidth: 1.75 })] }), open && (_jsxs("div", { className: "select-listbox", role: "listbox", "aria-label": ariaLabel, "data-up": up ? "" : undefined, style: pos, children: [searchable && (_jsxs("div", { className: "select-search", children: [_jsx(Search, { size: 15, strokeWidth: 1.75 }), _jsx("input", { ref: searchRef, type: "text", placeholder: searchPlaceholder, "aria-label": searchPlaceholder, value: query, onChange: (e) => {
|
|
137
137
|
setQuery(e.target.value);
|
|
138
138
|
setHighlight(0);
|
|
139
139
|
}, onKeyDown: onNavKeys })] })), filtered.length === 0 ? (_jsx("div", { className: "select-empty", children: "No results" })) : (filtered.map((opt, i) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineRecipe, resolveRecipe } from "../../core/index.js";
|
|
2
|
-
import { contract as c } from "../../tokens/index.js";
|
|
2
|
+
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
3
3
|
// A select / dropdown, measured from Attio's settings: a 32px combobox trigger
|
|
4
4
|
// (radius 9, value + a 16px chevron) over a listbox — radius 12, 4px padding, a
|
|
5
5
|
// layered soft shadow — of 32px options (radius 8, 6/8 padding) that show a
|
|
@@ -14,7 +14,7 @@ const config = defineRecipe({
|
|
|
14
14
|
|
|
15
15
|
& .select-trigger {
|
|
16
16
|
box-sizing: border-box; display: inline-flex; align-items: center; gap: ${c.space["1.5"]};
|
|
17
|
-
height:
|
|
17
|
+
height: ${c.size.menuRow}; width: 100%; min-width: 0; margin: 0; padding: 0 ${c.space["1.5"]} 0 ${c.space["2"]};
|
|
18
18
|
border: none; border-radius: ${c.radius.md}; background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, ${c.fgPrimary} 7%, transparent);
|
|
19
19
|
font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; cursor: pointer;
|
|
20
20
|
transition: background-color .12s ease, box-shadow .12s ease;
|
|
@@ -22,7 +22,7 @@ const config = defineRecipe({
|
|
|
22
22
|
& .select-trigger:hover { background: ${c.bgRaised}; }
|
|
23
23
|
& .select-trigger[data-open], & .select-trigger:focus-visible { outline: none; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; background: ${c.bgSurface}; }
|
|
24
24
|
& .select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
25
|
-
& .select-value { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align:
|
|
25
|
+
& .select-value { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
|
|
26
26
|
& .select-placeholder { color: ${c.fgMuted}; }
|
|
27
27
|
& .select-chevron { flex-shrink: 0; color: ${c.fgMuted}; transition: transform .15s ease; }
|
|
28
28
|
& .select-trigger[data-open] .select-chevron { transform: rotate(180deg); }
|
|
@@ -31,7 +31,7 @@ const config = defineRecipe({
|
|
|
31
31
|
position: fixed; z-index: 60; box-sizing: border-box; display: flex; flex-direction: column; gap: ${c.space.px};
|
|
32
32
|
max-height: 280px; overflow-y: auto; padding: ${c.space["1"]};
|
|
33
33
|
border-radius: ${c.radius.xl}; background: ${c.bgPopover};
|
|
34
|
-
box-shadow:
|
|
34
|
+
box-shadow: ${e.floating};
|
|
35
35
|
transform-origin: top left; opacity: 1; transform: none; transition: opacity .08s ease, transform .08s ease;
|
|
36
36
|
}
|
|
37
37
|
& .select-listbox[data-up] { transform-origin: bottom; }
|
|
@@ -42,9 +42,9 @@ const config = defineRecipe({
|
|
|
42
42
|
& .select-search input::placeholder { color: ${c.fgMuted}; }
|
|
43
43
|
& .select-empty { padding: ${c.space["3"]} ${c.space["2"]}; text-align: center; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
44
44
|
& .select-option {
|
|
45
|
-
box-sizing: border-box; display: flex; align-items: center; gap: ${c.space["2"]}; height:
|
|
45
|
+
box-sizing: border-box; display: flex; align-items: center; gap: ${c.space["2"]}; height: ${c.size.menuRow}; flex-shrink: 0;
|
|
46
46
|
padding: 0 ${c.space["2"]}; margin: 0; border: none; background: none; border-radius: ${c.radius.md};
|
|
47
|
-
font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align:
|
|
47
|
+
font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align: start; cursor: pointer; white-space: nowrap;
|
|
48
48
|
}
|
|
49
49
|
& .select-option[data-highlighted] { background: ${c.bgRaised}; }
|
|
50
50
|
& .select-option[data-disabled] { opacity: 0.5; cursor: not-allowed; }
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { skeletonRecipe } from "./skeleton.recipe.js";
|
|
3
3
|
/** A pulsing placeholder block sized to the content it stands in for. */
|
|
4
|
-
export function Skeleton({ width, height = 16, circle, radius, className, }) {
|
|
5
|
-
return (_jsx("span", { "aria-hidden": "true", "data-circle": circle ? "" : undefined, className: skeletonRecipe({ className }),
|
|
4
|
+
export function Skeleton({ width, height = 16, circle, radius, className, ...rest }) {
|
|
5
|
+
return (_jsx("span", { "aria-hidden": "true", "data-circle": circle ? "" : undefined, className: skeletonRecipe({ className }), ...rest,
|
|
6
|
+
// the consumer's style wins on conflict, but the component's
|
|
7
|
+
// own sizing still applies when they don't set it
|
|
8
|
+
style: { width, height, borderRadius: radius, ...rest.style } }));
|
|
6
9
|
}
|
|
7
10
|
Skeleton.displayName = "Skeleton";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { spinnerRecipe } from "./spinner.recipe.js";
|
|
3
3
|
/** A spinning ring indicator. Reports `role="status"` for assistive tech. */
|
|
4
|
-
export function Spinner({ size = 16, "aria-label": ariaLabel = "Loading", className, }) {
|
|
5
|
-
return (_jsx("span", { role: "status", "aria-label": ariaLabel, className: spinnerRecipe({ className }), style: {
|
|
4
|
+
export function Spinner({ size = 16, "aria-label": ariaLabel = "Loading", className, ...rest }) {
|
|
5
|
+
return (_jsx("span", { role: "status", "aria-label": ariaLabel, className: spinnerRecipe({ className }), ...rest, style: {
|
|
6
6
|
width: size,
|
|
7
7
|
height: size,
|
|
8
8
|
borderWidth: Math.max(2, Math.round(size / 8)),
|
|
9
|
+
...rest.style,
|
|
9
10
|
} }));
|
|
10
11
|
}
|
|
11
12
|
Spinner.displayName = "Spinner";
|
|
@@ -5,12 +5,12 @@ const DEFAULT = "#266df0";
|
|
|
5
5
|
* A pipeline stage bar — measured from Attio's Deal-stage Highlight. Each stage
|
|
6
6
|
* is a segment tinted with its colour; the current stage is at full strength.
|
|
7
7
|
*/
|
|
8
|
-
export function StageBar({ stages, current, "aria-label": ariaLabel, className, }) {
|
|
8
|
+
export function StageBar({ stages, current, "aria-label": ariaLabel, className, ...rest }) {
|
|
9
9
|
const currentIndex = typeof current === "number"
|
|
10
10
|
? current
|
|
11
11
|
: stages.findIndex((s) => s.label === current);
|
|
12
12
|
const currentStage = stages[currentIndex];
|
|
13
|
-
return (_jsx("div", { className: stagebarRecipe({ className }), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": stages.length, "aria-valuenow": currentIndex + 1, "aria-valuetext": currentStage?.label, "aria-label": ariaLabel, children: stages.map((stage, i) => {
|
|
13
|
+
return (_jsx("div", { className: stagebarRecipe({ className }), ...rest, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": stages.length, "aria-valuenow": currentIndex + 1, "aria-valuetext": currentStage?.label, "aria-label": ariaLabel, children: stages.map((stage, i) => {
|
|
14
14
|
const color = stage.color ?? DEFAULT;
|
|
15
15
|
const on = i === currentIndex;
|
|
16
16
|
return (_jsx("span", { className: "stagebar-seg", style: {
|
|
@@ -5,8 +5,8 @@ import { statcardRecipe } from "./statcard.recipe.js";
|
|
|
5
5
|
* A single-metric KPI tile — measured from Attio's Reports number/insight cards.
|
|
6
6
|
* Label, a large value, and an optional up/down delta pill with a caption.
|
|
7
7
|
*/
|
|
8
|
-
export function StatCard({ label, icon, value, delta, deltaSuffix = "%", caption, card, className, }) {
|
|
8
|
+
export function StatCard({ label, icon, value, delta, deltaSuffix = "%", caption, card, className, ...rest }) {
|
|
9
9
|
const trend = delta == null ? null : delta > 0 ? "up" : delta < 0 ? "down" : "flat";
|
|
10
|
-
return (_jsxs("div", { className: statcardRecipe({ card, className }), children: [_jsxs("span", { className: "statcard-label", children: [icon, label] }), _jsx("span", { className: "statcard-value", children: value }), (trend != null || caption != null) && (_jsxs("span", { className: "statcard-foot", children: [trend != null && (_jsxs("span", { className: "statcard-delta", "data-trend": trend, children: [trend === "up" && _jsx(ArrowUp, { size: 12, strokeWidth: 2.5 }), trend === "down" && _jsx(ArrowDown, { size: 12, strokeWidth: 2.5 }), Math.abs(delta), deltaSuffix] })), caption] }))] }));
|
|
10
|
+
return (_jsxs("div", { className: statcardRecipe({ card, className }), ...rest, children: [_jsxs("span", { className: "statcard-label", children: [icon, label] }), _jsx("span", { className: "statcard-value", children: value }), (trend != null || caption != null) && (_jsxs("span", { className: "statcard-foot", children: [trend != null && (_jsxs("span", { className: "statcard-delta", "data-trend": trend, children: [trend === "up" && _jsx(ArrowUp, { size: 12, strokeWidth: 2.5 }), trend === "down" && _jsx(ArrowDown, { size: 12, strokeWidth: 2.5 }), Math.abs(delta), deltaSuffix] })), caption] }))] }));
|
|
11
11
|
}
|
|
12
12
|
StatCard.displayName = "StatCard";
|
|
@@ -10,19 +10,19 @@ const config = defineRecipe({
|
|
|
10
10
|
base: `display: block; box-sizing: border-box; background: ${c.bgSurface};
|
|
11
11
|
& .table-scroll { overflow-x: auto; }
|
|
12
12
|
& table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: ${c.font.sans}; font-size: ${c.text.lg}; color: ${c.fgPrimary}; }
|
|
13
|
-
& th, & td { position: relative; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border-bottom: 1px solid ${c.borderSubtle}; border-
|
|
14
|
-
& th { height:
|
|
13
|
+
& th, & td { position: relative; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border-bottom: 1px solid ${c.borderSubtle}; border-inline-end: 1px solid ${c.borderSubtle}; text-align: start; vertical-align: middle; white-space: nowrap; overflow: hidden; }
|
|
14
|
+
& th { height: ${c.size.tableHeader}; background: ${c.bgSurface}; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; letter-spacing: -0.14px; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); user-select: none; }
|
|
15
15
|
& td { color: ${c.fgPrimary}; background: ${c.bgSurface}; }
|
|
16
|
-
& th:last-child, & td:last-child { border-
|
|
16
|
+
& th:last-child, & td:last-child { border-inline-end: none; }
|
|
17
17
|
& tbody tr:last-child td { border-bottom: none; }
|
|
18
18
|
& tfoot td { border-top: 1px solid ${c.borderSubtle}; border-bottom: none; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
19
|
-
& caption { padding: ${c.space["2"]} ${c.space["2"]}; text-align:
|
|
20
|
-
& td[data-align="right"], & th[data-align="right"] { text-align:
|
|
19
|
+
& caption { padding: ${c.space["2"]} ${c.space["2"]}; text-align: start; font-size: ${c.text.sm}; color: ${c.fgMuted}; caption-side: bottom; }
|
|
20
|
+
& td[data-align="right"], & th[data-align="right"] { text-align: end; }
|
|
21
21
|
& td[data-align="center"], & th[data-align="center"] { text-align: center; }`,
|
|
22
22
|
variants: {
|
|
23
23
|
// subtle row hover — matches RecordsTable's 3% tint
|
|
24
24
|
interactive: {
|
|
25
|
-
true: `& tbody tr { transition: background-color .12s; } & tbody tr:hover td { background: color-mix(in srgb, ${c.fgPrimary}
|
|
25
|
+
true: `& tbody tr { transition: background-color .12s; } & tbody tr:hover td { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); }`,
|
|
26
26
|
false: ``,
|
|
27
27
|
},
|
|
28
28
|
// card (default): the bordered rounded surface, unchanged for existing
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { contract as c } from "../../tokens/index.js";
|
|
1
|
+
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
2
2
|
// The measured chrome of Attio's table toolbar: the Sort/Filter controls, the
|
|
3
3
|
// menu/popover surface they open into, the sort-condition rows, and the filter
|
|
4
4
|
// chips. It lives here, parameterised by class prefix, because TWO surfaces
|
|
@@ -25,7 +25,7 @@ export const toolbarChromeHead = (p) => ` & .${p}-toolbar { display: flex; al
|
|
|
25
25
|
& .${p}-tool--ghost { box-shadow: none; background: color-mix(in srgb, ${c.fgPrimary} 3%, transparent); color: ${c.fgMuted}; }
|
|
26
26
|
& .${p}-tool--ghost:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); }
|
|
27
27
|
& .${p}-toolgroup { position: relative; display: inline-flex; }
|
|
28
|
-
& .${p}-menu { position: absolute; top: calc(100% + ${c.space["1"]}); left: 0; z-index: 30; min-width: 232px; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; background: ${c.bgPopover}; box-shadow:
|
|
28
|
+
& .${p}-menu { position: absolute; top: calc(100% + ${c.space["1"]}); left: 0; z-index: 30; min-width: 232px; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; background: ${c.bgPopover}; box-shadow: ${e.floating}; display: flex; flex-direction: column; gap: ${c.space.px}; transform-origin: top; opacity: 1; transform: none; transition: opacity .13s ease, transform .13s ease; }
|
|
29
29
|
& .${p}-menu { @starting-style { opacity: 0; transform: scale(0.96); } }`;
|
|
30
30
|
export const toolbarChromeBody = (p) => ` & .${p}-menu-head { padding: ${c.space["1"]} ${c.space["2"]} ${c.space["0.5"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
31
31
|
& .${p}-sortpop { min-width: 460px; overflow: visible; padding: ${c.space["1.5"]}; gap: ${c.space["1"]}; }
|
|
@@ -42,7 +42,7 @@ export const toolbarChromeBody = (p) => ` & .${p}-menu-head { padding: ${c.sp
|
|
|
42
42
|
& .${p}-sort-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; padding: 0; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgMuted}; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
43
43
|
& .${p}-sort-remove:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
44
44
|
& .${p}-sort-addrow { display: flex; padding: ${c.space["0.5"]} 0; }
|
|
45
|
-
& .${p}-sort-add { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; padding: 0 ${c.space["2"]} 0 ${c.space["1.5"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow:
|
|
45
|
+
& .${p}-sort-add { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; padding: 0 ${c.space["2"]} 0 ${c.space["1.5"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.regular}; color: ${c.fgPrimary}; cursor: pointer; transition: background-color .12s; }
|
|
46
46
|
& .${p}-sort-add:hover { background: ${c.bgRaised}; }
|
|
47
47
|
& .${p}-sort-add svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
48
48
|
& .${p}-sort-foot { display: flex; padding: ${c.space["1.5"]} ${c.space["1"]} ${c.space["0.5"]}; }
|
|
@@ -84,7 +84,7 @@ export function applySorts(rows, sorts, get = (row, key) => row[key]) {
|
|
|
84
84
|
* composable version, to put above `DataTable` or any table of your own. Pair
|
|
85
85
|
* it with `applyFilters` / `applySorts` to turn its state into rows.
|
|
86
86
|
*/
|
|
87
|
-
export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsChange, filters: filtersProp, defaultFilters, onFiltersChange, count, children, helpHref, className, }) {
|
|
87
|
+
export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsChange, filters: filtersProp, defaultFilters, onFiltersChange, count, children, helpHref, className, sortLabel = "Sort", reorderSortLabel = "Reorder sort", sortFieldLabel = "Sort field", sortDirectionLabel = "Sort direction", removeSortLabel = "Remove sort", filterFieldLabel = "Filter by field", filterFieldPlaceholder = "Filter by…", filterValuePlaceholder = "Value…", ascendingLabel = "Ascending", descendingLabel = "Descending", sortTriggerLabel, filterTriggerLabel, ...rest }) {
|
|
88
88
|
const [sortsState, setSortsState] = React.useState(defaultSorts ?? []);
|
|
89
89
|
const [filtersState, setFiltersState] = React.useState(defaultFilters ?? []);
|
|
90
90
|
const sorts = sortsProp ?? sortsState;
|
|
@@ -149,32 +149,40 @@ export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsC
|
|
|
149
149
|
setOpenMenu(null);
|
|
150
150
|
};
|
|
151
151
|
const activeFilters = filters.length;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
// The default phrase only works in English word order, so a caller can
|
|
153
|
+
// replace the whole thing rather than fill a template.
|
|
154
|
+
const sortedLabel = sortTriggerLabel
|
|
155
|
+
? sortTriggerLabel(sorts, columns)
|
|
156
|
+
: sorts.length
|
|
157
|
+
? `Sorted by ${columns.find((c) => c.key === sorts[0].key)?.label}${sorts.length > 1 ? ` +${sorts.length - 1}` : ""}`
|
|
158
|
+
: "Sort";
|
|
159
|
+
return (_jsx("div", { className: tabletoolbarRecipe({ className }), ...rest, children: _jsxs("div", { className: "tabletoolbar-toolbar", children: [_jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `tabletoolbar-tool${sorts.length ? " tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "sort" ? null : "sort"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "sort", "data-menu-trigger": true, children: [_jsx(ArrowUpDown, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), sortedLabel] }), openMenu === "sort" && (_jsxs("div", { className: "tabletoolbar-menu tabletoolbar-sortpop", role: "dialog", "aria-label": sortLabel, children: [sorts.length === 0 ? (_jsx("div", { className: "tabletoolbar-sort-empty", children: "No sorts applied to this view." })) : (sorts.map((s, i) => (_jsxs("div", { className: "tabletoolbar-sort-row", onDragOver: (e) => {
|
|
156
160
|
if (dragSort !== null)
|
|
157
161
|
e.preventDefault();
|
|
158
162
|
}, onDrop: () => {
|
|
159
163
|
if (dragSort !== null)
|
|
160
164
|
moveSort(dragSort, i);
|
|
161
165
|
setDragSort(null);
|
|
162
|
-
}, children: [_jsx("button", { type: "button", className: "tabletoolbar-sort-grip", "aria-label":
|
|
166
|
+
}, children: [_jsx("button", { type: "button", className: "tabletoolbar-sort-grip", "aria-label": reorderSortLabel, draggable: true, onDragStart: () => setDragSort(i), onDragEnd: () => setDragSort(null), children: _jsx(GripVertical, { size: 15, strokeWidth: 1.75 }) }), _jsx(Select, { className: "tabletoolbar-sort-field", searchable: true, value: s.key, onValueChange: (k) => setSortField(i, k), options: columns.map((c) => ({
|
|
163
167
|
value: c.key,
|
|
164
168
|
label: c.icon ? (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(c.icon, { size: 15, strokeWidth: 1.75 }), c.label] })) : (c.label),
|
|
165
169
|
keywords: c.label,
|
|
166
|
-
})), "aria-label":
|
|
170
|
+
})), "aria-label": sortFieldLabel }), _jsx(Select, { className: "tabletoolbar-sort-dir", value: s.dir, onValueChange: (d) => setSortDir(i, d), options: [
|
|
167
171
|
{
|
|
168
172
|
value: "asc",
|
|
169
|
-
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }),
|
|
170
|
-
keywords:
|
|
173
|
+
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }), ascendingLabel] })),
|
|
174
|
+
keywords: ascendingLabel,
|
|
171
175
|
},
|
|
172
176
|
{
|
|
173
177
|
value: "desc",
|
|
174
|
-
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }),
|
|
175
|
-
keywords:
|
|
178
|
+
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }), descendingLabel] })),
|
|
179
|
+
keywords: descendingLabel,
|
|
176
180
|
},
|
|
177
|
-
], "aria-label":
|
|
181
|
+
], "aria-label": sortDirectionLabel }), _jsx("button", { type: "button", className: "tabletoolbar-sort-remove", onClick: () => removeSort(i), "aria-label": removeSortLabel, children: _jsx(X, { size: 15, strokeWidth: 1.75 }) })] }, s.key)))), _jsx("div", { className: "tabletoolbar-sort-addrow", children: _jsxs("button", { type: "button", className: "tabletoolbar-sort-add", onClick: addSort, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), "Add sort"] }) }), helpHref && (_jsx("div", { className: "tabletoolbar-sort-foot", children: _jsxs("a", { className: "tabletoolbar-sort-learn", href: helpHref, target: "_blank", rel: "noreferrer", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), "Learn about sorting"] }) }))] }))] }), _jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `tabletoolbar-tool tabletoolbar-tool--ghost${activeFilters ? " tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "filter" ? null : "filter"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "filter", "data-menu-trigger": true, children: [_jsx(ListFilter, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), filterTriggerLabel
|
|
182
|
+
? filterTriggerLabel(activeFilters)
|
|
183
|
+
: activeFilters
|
|
184
|
+
? `Filter · ${activeFilters}`
|
|
185
|
+
: "Filter"] }), openMenu === "filter" && (_jsxs("div", { className: "tabletoolbar-menu", role: "dialog", "aria-label": filterFieldLabel, children: [_jsx("input", { className: "tabletoolbar-menu-input", placeholder: filterFieldPlaceholder, "aria-label": filterFieldLabel,
|
|
178
186
|
// biome-ignore lint/a11y/noAutofocus: focus the picker on open
|
|
179
187
|
autoFocus: true, value: filterQuery, onChange: (e) => setFilterQuery(e.target.value) }), columns
|
|
180
188
|
.filter((col) => col.label
|
|
@@ -184,7 +192,7 @@ export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsC
|
|
|
184
192
|
const col = columns.find((c) => c.key === cond.key);
|
|
185
193
|
const open = openMenu === `fcond:${cond.id}`;
|
|
186
194
|
const hasValue = !opNeedsValue(cond.op) || cond.value.trim();
|
|
187
|
-
return (_jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("span", { className: "tabletoolbar-fchip", children: [_jsxs("button", { type: "button", className: "tabletoolbar-fchip-main", "data-menu-trigger": true, "aria-haspopup": "
|
|
195
|
+
return (_jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("span", { className: "tabletoolbar-fchip", children: [_jsxs("button", { type: "button", className: "tabletoolbar-fchip-main", "data-menu-trigger": true, "aria-haspopup": "dialog", onClick: () => setOpenMenu(open ? null : `fcond:${cond.id}`), children: [_jsx("span", { className: "tabletoolbar-fchip-field", children: col?.label }), hasValue ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "tabletoolbar-fchip-op", children: OP_LABELS[cond.op] }), opNeedsValue(cond.op) && (_jsx("span", { className: "tabletoolbar-fchip-val", children: cond.value }))] })) : (_jsx("span", { className: "tabletoolbar-fchip-op", children: "Select condition" }))] }), _jsx("button", { type: "button", className: "tabletoolbar-fchip-x", "aria-label": `Remove ${col?.label} filter`, onClick: () => removeFilter(cond.id), children: _jsx(X, { size: 13, strokeWidth: 2 }) })] }), open && (_jsxs("div", { className: "tabletoolbar-menu", role: "dialog", "aria-label": `${col?.label} condition`, children: [_jsxs("div", { className: "tabletoolbar-menu-head", children: [col?.label, " condition"] }), OP_ORDER.map((op) => (_jsxs("button", { type: "button", className: "tabletoolbar-menu-item", "data-on": cond.op === op ? "" : undefined, onClick: () => patchFilter(cond.id, { op }), children: [OP_LABELS[op], cond.op === op ? (_jsx(Check, { className: "tabletoolbar-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, op))), opNeedsValue(cond.op) && (_jsx("input", { className: "tabletoolbar-menu-input", placeholder: filterValuePlaceholder, "aria-label": `${col?.label} filter value`,
|
|
188
196
|
// biome-ignore lint/a11y/noAutofocus: focus the value field
|
|
189
197
|
autoFocus: true, value: cond.value, onChange: (e) => patchFilter(cond.id, { value: e.target.value }) }))] }))] }, cond.id));
|
|
190
198
|
}), _jsx("span", { className: "tabletoolbar-spacer" }), count != null && _jsx("span", { className: "tabletoolbar-count", children: count }), children] }) }));
|
|
@@ -7,7 +7,7 @@ import { tabsRecipe } from "./tabs.recipe.js";
|
|
|
7
7
|
* Home/End jump); activation follows focus, matching Attio. Controlled via
|
|
8
8
|
* `value`/`onValueChange`, or uncontrolled from `defaultValue`.
|
|
9
9
|
*/
|
|
10
|
-
export function Tabs({ tabs, value, defaultValue, onValueChange, leading, children, className, "aria-label": ariaLabel, }) {
|
|
10
|
+
export function Tabs({ tabs, value, defaultValue, onValueChange, leading, children, className, "aria-label": ariaLabel, ...rest }) {
|
|
11
11
|
const [internal, setInternal] = React.useState(defaultValue ?? tabs[0]?.value);
|
|
12
12
|
const active = value ?? internal;
|
|
13
13
|
const listRef = React.useRef(null);
|
|
@@ -57,7 +57,7 @@ export function Tabs({ tabs, value, defaultValue, onValueChange, leading, childr
|
|
|
57
57
|
?.querySelector(`[data-value="${CSS.escape(nextValue)}"]`)
|
|
58
58
|
?.focus();
|
|
59
59
|
};
|
|
60
|
-
return (_jsxs("div", { className: tabsRecipe({ className }), children: [_jsxs("div", { ref: listRef, className: "tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && _jsx("span", { className: "tabs-leading", children: leading }), tabs.map((t) => {
|
|
60
|
+
return (_jsxs("div", { className: tabsRecipe({ className }), ...rest, children: [_jsxs("div", { ref: listRef, className: "tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && _jsx("span", { className: "tabs-leading", children: leading }), tabs.map((t) => {
|
|
61
61
|
const selected = t.value === active;
|
|
62
62
|
return (_jsxs("button", { type: "button", role: "tab", id: `tab-${t.value}`, "aria-selected": selected, "aria-controls": `panel-${t.value}`, tabIndex: selected ? 0 : -1, "data-value": t.value, "data-selected": selected ? "" : undefined, disabled: t.disabled, className: "tabs-tab", onClick: () => select(t.value), children: [t.icon, _jsx("span", { className: "tabs-tab-label", children: t.label }), t.badge != null && (_jsx("span", { className: "tabs-tab-badge", children: t.badge }))] }, t.value));
|
|
63
63
|
}), indicator && (_jsx("span", { className: "tabs-indicator", style: {
|
|
@@ -12,16 +12,16 @@ const config = defineRecipe({
|
|
|
12
12
|
display: flex; flex-direction: column; min-height: 0; font-family: ${c.font.sans};
|
|
13
13
|
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
14
14
|
|
|
15
|
-
& .tabs-list { position: relative; display: flex; align-items: center; gap: ${c.space["1"]}; height:
|
|
16
|
-
& .tabs-leading { display: inline-flex; align-items: center; margin-
|
|
15
|
+
& .tabs-list { position: relative; display: flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; flex-shrink: 0; }
|
|
16
|
+
& .tabs-leading { display: inline-flex; align-items: center; margin-inline-end: ${c.space["1"]}; }
|
|
17
17
|
& .tabs-tab { position: relative; display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; box-shadow: inset 0 0 0 1px transparent; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; letter-spacing: -0.14px; color: ${c.fgMuted}; cursor: pointer; white-space: nowrap; transition: color .12s ease, background-color .12s ease, box-shadow .12s ease; }
|
|
18
18
|
& .tabs-tab svg { flex-shrink: 0; opacity: 0.85; }
|
|
19
19
|
& .tabs-tab:hover:not([data-selected]) { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
20
|
-
& .tabs-tab[data-selected] { color: ${c.fgPrimary}; background: ${c.
|
|
20
|
+
& .tabs-tab[data-selected] { color: ${c.fgPrimary}; background: ${c.bgSubtle}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; }
|
|
21
21
|
& .tabs-tab:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 1px; }
|
|
22
22
|
& .tabs-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); font-size: ${c.text.xs}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
23
23
|
& .tabs-tab[data-selected] .tabs-tab-badge { color: ${c.fgPrimary}; }
|
|
24
|
-
& .tabs-indicator { position: absolute; bottom:
|
|
24
|
+
& .tabs-indicator { position: absolute; bottom: calc(-1 * ${c.space["2"]}); left: 0; height: 1px; background: ${c.fgPrimary}; border-radius: 2px 2px 0 0; transition: transform .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); pointer-events: none; }
|
|
25
25
|
& .tabs-panel { flex: 1; min-height: 0; }
|
|
26
26
|
& .tabs-panel:focus-visible { outline: none; }
|
|
27
27
|
`,
|
|
@@ -11,10 +11,10 @@ export const Textarea = React.forwardRef(({ showCount, maxLength, className, wra
|
|
|
11
11
|
const [count, setCount] = React.useState(initial);
|
|
12
12
|
const len = value !== undefined ? String(value).length : count;
|
|
13
13
|
const counted = showCount && maxLength != null;
|
|
14
|
-
return (_jsxs("div", { className: textareaRecipe({ className: wrapperClassName }), "data-counted": counted ? "" : undefined, children: [_jsx("textarea", { ref: ref, className: `textarea-field${className ? ` ${className}` : ""}`, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: (e) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return (_jsxs("div", { className: textareaRecipe({ className: wrapperClassName }), "data-counted": counted ? "" : undefined, children: [_jsx("span", { className: "textarea-wrap", children: _jsx("textarea", { ref: ref, className: `textarea-field${className ? ` ${className}` : ""}`, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: (e) => {
|
|
15
|
+
if (value === undefined)
|
|
16
|
+
setCount(e.target.value.length);
|
|
17
|
+
onChange?.(e);
|
|
18
|
+
}, ...props }) }), counted && (_jsxs("span", { className: "textarea-count", "data-over": len > (maxLength ?? 0) ? "" : undefined, "aria-hidden": "true", children: [len, " / ", maxLength] }))] }));
|
|
19
19
|
});
|
|
20
20
|
Textarea.displayName = "Textarea";
|