@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,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resizablepanelRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// Attio's adjustable-panel primitive (measured live — see
|
|
7
|
+
// docs/study/attio-panels.md §1-2). Two elements carry the layout: an
|
|
8
|
+
// invisible SPACER that reserves flow width (it alone animates `width`, a
|
|
9
|
+
// cheap reflow of a leaf node) and the PANEL, taken out of flow with
|
|
10
|
+
// `position: absolute` and drawn on top of the spacer. That split is what
|
|
11
|
+
// lets the panel move between docked (in-flow, hairline divider, no
|
|
12
|
+
// elevation) and floating (position: fixed, 8px gutter, r10, the measured
|
|
13
|
+
// tier-1 elevation) without a reflow glitch on the rest of the layout.
|
|
14
|
+
//
|
|
15
|
+
// Per Lesson 27, the floating panel rests at `transform: none` — the
|
|
16
|
+
// measured off-canvas value (`translateX(calc(-100% - space-2))`, identical
|
|
17
|
+
// to Drawer's left-side value) lives in `@starting-style` as the enter
|
|
18
|
+
// transform only, never as a permanent resting position.
|
|
19
|
+
const config = (0, core_1.defineRecipe)({
|
|
20
|
+
name: "resizablepanel",
|
|
21
|
+
base: `
|
|
22
|
+
position: relative; display: flex; height: 100%;
|
|
23
|
+
& .resizablepanel-spacer { flex: 0 0 auto; height: 100%; transition: width 0.14s; }
|
|
24
|
+
& .resizablepanel-panel { position: absolute; top: 0; bottom: 0; box-sizing: border-box; overflow: hidden; background: ${tokens_1.contract.bgSurface}; }
|
|
25
|
+
& .resizablepanel-panel[data-side="left"] { left: 0; }
|
|
26
|
+
& .resizablepanel-panel[data-side="right"] { right: 0; }
|
|
27
|
+
|
|
28
|
+
/* docked */
|
|
29
|
+
& .resizablepanel-panel[data-floating="false"] { border-radius: 0; box-shadow: none; }
|
|
30
|
+
& .resizablepanel-panel[data-floating="false"][data-side="left"] { border-inline-end: 1px solid ${tokens_1.contract.borderSubtle}; }
|
|
31
|
+
& .resizablepanel-panel[data-floating="false"][data-side="right"] { border-inline-start: 1px solid ${tokens_1.contract.borderSubtle}; }
|
|
32
|
+
|
|
33
|
+
/* floating — position: fixed, 8px gutter, r10, the measured floating elevation.
|
|
34
|
+
Rest is transform: none (Lesson 27); the off-canvas value is the @starting-style enter only. */
|
|
35
|
+
& .resizablepanel-panel[data-floating="true"] { position: fixed; top: ${tokens_1.contract.space["2"]}; bottom: ${tokens_1.contract.space["2"]}; border-inline-end: none; border-inline-start: none; border-radius: 10px; box-shadow: ${tokens_1.elevation.floating}; transform: none; transition: transform 0.14s, padding 0.14s; }
|
|
36
|
+
& .resizablepanel-panel[data-floating="true"][data-side="left"] { padding: ${tokens_1.contract.space["2"]} 0 ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["2"]}; @starting-style { transform: translateX(calc(-100% - ${tokens_1.contract.space["2"]})); } }
|
|
37
|
+
& .resizablepanel-panel[data-floating="true"][data-side="right"] { padding: ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["2"]} ${tokens_1.contract.space["2"]} 0; @starting-style { transform: translateX(calc(100% + ${tokens_1.contract.space["2"]})); } }
|
|
38
|
+
|
|
39
|
+
& .resizablepanel-inner { height: 100%; opacity: 1; }
|
|
40
|
+
& .resizablepanel-panel[data-floating="true"] .resizablepanel-inner { opacity: 1; transition: opacity 0.14s; @starting-style { opacity: 0; } }
|
|
41
|
+
|
|
42
|
+
/* handle — variant "panel" (default): a 10px hit target, its ::before the
|
|
43
|
+
only visible divider (1px rest -> 2px on hover/drag, brand-solid). */
|
|
44
|
+
& .resizablepanel-handle { position: absolute; top: 0; width: 10px; height: 100%; z-index: 2; cursor: col-resize; background: transparent; touch-action: none; }
|
|
45
|
+
& .resizablepanel-handle[data-side="left"] { right: 0; }
|
|
46
|
+
& .resizablepanel-handle[data-side="right"] { left: 0; }
|
|
47
|
+
& .resizablepanel-handle::before { content: ""; position: absolute; top: 0; width: 1px; height: 100%; background: ${tokens_1.contract.borderSubtle}; transition: background-color 0.16s, height 0.16s; }
|
|
48
|
+
& .resizablepanel-handle[data-side="left"]::before { right: 0; }
|
|
49
|
+
& .resizablepanel-handle[data-side="right"]::before { left: 0; }
|
|
50
|
+
& .resizablepanel-handle:hover::before, & .resizablepanel-handle[data-dragging="true"]::before { width: 2px; background: ${tokens_1.contract.bgBrandSolid}; }
|
|
51
|
+
|
|
52
|
+
/* handle — variant "column": a wider 7px hit target straddling a 1px
|
|
53
|
+
divider (table column edges), with a real 3px inner bar whose opacity
|
|
54
|
+
comes in on a 100ms DELAY — distinct from the panel variant's instant
|
|
55
|
+
::before swap. */
|
|
56
|
+
/* .resizablepanel-handle.resizablepanel-handle--column (both classes) to
|
|
57
|
+
out-specificity the base [data-side] left/right rules above, which
|
|
58
|
+
otherwise tie-break by source order alone and would win. */
|
|
59
|
+
& .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; }
|
|
60
|
+
& .resizablepanel-handle--column::before { content: none; }
|
|
61
|
+
& .resizablepanel-handle-inner { width: 3px; height: 100%; border-radius: 3px; background: ${tokens_1.contract.bgBrandSolid}; opacity: 0; transition: opacity 0.1s 0.1s; }
|
|
62
|
+
& .resizablepanel-handle--column:hover .resizablepanel-handle-inner, & .resizablepanel-handle--column[data-dragging="true"] .resizablepanel-handle-inner { opacity: 1; }
|
|
63
|
+
`,
|
|
64
|
+
variants: {},
|
|
65
|
+
defaultVariants: {},
|
|
66
|
+
compoundVariants: [],
|
|
67
|
+
});
|
|
68
|
+
exports.resizablepanelRecipe = (0, core_1.resolveRecipe)(config);
|
|
69
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.segmentedRecipe = exports.Segmented = void 0;
|
|
4
|
+
var segmented_1 = require("./segmented");
|
|
5
|
+
Object.defineProperty(exports, "Segmented", { enumerable: true, get: function () { return segmented_1.Segmented; } });
|
|
6
|
+
var segmented_recipe_1 = require("./segmented.recipe");
|
|
7
|
+
Object.defineProperty(exports, "segmentedRecipe", { enumerable: true, get: function () { return segmented_recipe_1.segmentedRecipe; } });
|
|
@@ -0,0 +1,95 @@
|
|
|
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.Segmented = Segmented;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const segmented_recipe_1 = require("./segmented.recipe");
|
|
40
|
+
/**
|
|
41
|
+
* A segmented control (single-choice toggle) — measured from Attio's view
|
|
42
|
+
* switcher. `role="radiogroup"` over `role="radio"` buttons with roving
|
|
43
|
+
* tabindex and ←/→ (Home/End) keyboard selection.
|
|
44
|
+
*/
|
|
45
|
+
function Segmented({ options, value, defaultValue, onValueChange, "aria-label": ariaLabel, className, ...rest }) {
|
|
46
|
+
const [internal, setInternal] = React.useState(defaultValue ?? options[0]?.value);
|
|
47
|
+
const selected = value ?? internal;
|
|
48
|
+
const rootRef = React.useRef(null);
|
|
49
|
+
const [thumb, setThumb] = React.useState(null);
|
|
50
|
+
// Measure the selected item and slide the thumb to it (before paint, so the
|
|
51
|
+
// first render lands in place and only later selections animate).
|
|
52
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: re-measure when the value or option set changes
|
|
53
|
+
React.useLayoutEffect(() => {
|
|
54
|
+
const root = rootRef.current;
|
|
55
|
+
const el = root?.querySelector(".segmented-item[data-selected]");
|
|
56
|
+
if (!el) {
|
|
57
|
+
setThumb(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
setThumb({ left: el.offsetLeft, width: el.offsetWidth });
|
|
61
|
+
}, [selected, options]);
|
|
62
|
+
const select = (v) => {
|
|
63
|
+
if (value === undefined)
|
|
64
|
+
setInternal(v);
|
|
65
|
+
onValueChange?.(v);
|
|
66
|
+
};
|
|
67
|
+
const onKeyDown = (e, i) => {
|
|
68
|
+
const enabled = options.filter((o) => !o.disabled);
|
|
69
|
+
const pos = enabled.findIndex((o) => o.value === options[i].value);
|
|
70
|
+
let next = -1;
|
|
71
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown")
|
|
72
|
+
next = (pos + 1) % enabled.length;
|
|
73
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
|
|
74
|
+
next = (pos - 1 + enabled.length) % enabled.length;
|
|
75
|
+
else if (e.key === "Home")
|
|
76
|
+
next = 0;
|
|
77
|
+
else if (e.key === "End")
|
|
78
|
+
next = enabled.length - 1;
|
|
79
|
+
if (next < 0)
|
|
80
|
+
return;
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
select(enabled[next].value);
|
|
83
|
+
};
|
|
84
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: rootRef, className: (0, segmented_recipe_1.segmentedRecipe)({ className }), ...rest, role: "radiogroup", "aria-label": ariaLabel, children: [thumb && ((0, jsx_runtime_1.jsx)("span", { className: "segmented-thumb", "aria-hidden": "true", style: {
|
|
85
|
+
width: thumb.width,
|
|
86
|
+
transform: `translateX(${thumb.left}px)`,
|
|
87
|
+
} })), options.map((opt, i) => {
|
|
88
|
+
const on = opt.value === selected;
|
|
89
|
+
const iconOnly = opt.label == null && opt.icon != null;
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "radio", "aria-checked": on, "aria-label": opt["aria-label"], disabled: opt.disabled, "data-selected": on ? "" : undefined, tabIndex: on ? 0 : -1, className: iconOnly
|
|
91
|
+
? "segmented-item segmented-item--icon"
|
|
92
|
+
: "segmented-item", onClick: () => select(opt.value), onKeyDown: (e) => onKeyDown(e, i), children: [opt.icon, opt.label] }, opt.value));
|
|
93
|
+
})] }));
|
|
94
|
+
}
|
|
95
|
+
Segmented.displayName = "Segmented";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.segmentedRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A segmented control — Attio's view switcher: a subtle track holding options,
|
|
7
|
+
// the selected one raised on a white pill.
|
|
8
|
+
const config = (0, core_1.defineRecipe)({
|
|
9
|
+
name: "segmented",
|
|
10
|
+
base: `position: relative; display: inline-flex; align-items: center; gap: ${tokens_1.contract.space["0.5"]}; box-sizing: border-box; padding: ${tokens_1.contract.space["0.5"]}; border-radius: ${tokens_1.contract.radius.lg}; background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 5%, transparent); font-family: ${tokens_1.contract.font.sans};
|
|
11
|
+
& .segmented-thumb { position: absolute; top: ${tokens_1.contract.space["0.5"]}; left: 0; height: 26px; border-radius: ${tokens_1.contract.radius.md}; background: ${tokens_1.contract.bgSurface}; box-shadow: inset 0 0 0 1px ${tokens_1.contract.borderSubtle}, 0 1px 2px rgba(0,0,0,0.06); pointer-events: none; z-index: 0; transition: transform .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); }
|
|
12
|
+
& .segmented-item { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: ${tokens_1.contract.space["1.5"]}; height: 26px; padding: 0 ${tokens_1.contract.space["2.5"]}; margin: 0; border: none; border-radius: ${tokens_1.contract.radius.md}; background: none; 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: color 0.15s ease; }
|
|
13
|
+
& .segmented-item svg { flex-shrink: 0; }
|
|
14
|
+
& .segmented-item:hover { color: ${tokens_1.contract.fgPrimary}; }
|
|
15
|
+
& .segmented-item[data-selected] { color: ${tokens_1.contract.fgPrimary}; }
|
|
16
|
+
& .segmented-item[disabled] { opacity: 0.4; cursor: default; }
|
|
17
|
+
& .segmented-item--icon { width: 26px; padding: 0; }`,
|
|
18
|
+
variants: {},
|
|
19
|
+
defaultVariants: {},
|
|
20
|
+
compoundVariants: [],
|
|
21
|
+
});
|
|
22
|
+
exports.segmentedRecipe = (0, core_1.resolveRecipe)(config);
|
|
23
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectRecipe = exports.Select = void 0;
|
|
4
|
+
var select_1 = require("./select");
|
|
5
|
+
Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return select_1.Select; } });
|
|
6
|
+
var select_recipe_1 = require("./select.recipe");
|
|
7
|
+
Object.defineProperty(exports, "selectRecipe", { enumerable: true, get: function () { return select_recipe_1.selectRecipe; } });
|
|
@@ -0,0 +1,180 @@
|
|
|
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.Select = Select;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const lucide_react_1 = require("lucide-react");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const select_recipe_1 = require("./select.recipe");
|
|
41
|
+
function optionText(o) {
|
|
42
|
+
if (o.keywords)
|
|
43
|
+
return o.keywords;
|
|
44
|
+
return typeof o.label === "string" ? o.label : o.value;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A select / dropdown — the settings control, measured from Attio, with an
|
|
48
|
+
* optional Linear-style search. A `role="combobox"` trigger opens a
|
|
49
|
+
* `role="listbox"`; pass `searchable` to add a filter field at the top (with a
|
|
50
|
+
* "No results" empty state). Full keyboard model — ↑/↓ move, Enter/Space pick,
|
|
51
|
+
* Esc close, Home/End jump, opens upward when tight. Controlled or uncontrolled.
|
|
52
|
+
*/
|
|
53
|
+
function Select({ options, value, defaultValue, onValueChange, placeholder = "Select…", variant = "default", width = "full", searchable, searchPlaceholder = "Search…", disabled, className, "aria-label": ariaLabel, id, ...rest }) {
|
|
54
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
55
|
+
const selected = value ?? internal;
|
|
56
|
+
const [open, setOpen] = React.useState(false);
|
|
57
|
+
const [up, setUp] = React.useState(false);
|
|
58
|
+
const [pos, setPos] = React.useState({});
|
|
59
|
+
const [highlight, setHighlight] = React.useState(0);
|
|
60
|
+
const [query, setQuery] = React.useState("");
|
|
61
|
+
const rootRef = React.useRef(null);
|
|
62
|
+
const triggerRef = React.useRef(null);
|
|
63
|
+
const searchRef = React.useRef(null);
|
|
64
|
+
const selectedOption = options.find((o) => o.value === selected);
|
|
65
|
+
// The options shown, after applying the search filter.
|
|
66
|
+
const q = query.trim().toLowerCase();
|
|
67
|
+
const filtered = searchable && q
|
|
68
|
+
? options.filter((o) => optionText(o).toLowerCase().includes(q))
|
|
69
|
+
: options;
|
|
70
|
+
const enabledIndexes = filtered
|
|
71
|
+
.map((o, i) => (o.disabled ? -1 : i))
|
|
72
|
+
.filter((i) => i >= 0);
|
|
73
|
+
const openMenu = () => {
|
|
74
|
+
if (disabled)
|
|
75
|
+
return;
|
|
76
|
+
const rect = triggerRef.current?.getBoundingClientRect();
|
|
77
|
+
if (rect) {
|
|
78
|
+
const flipUp = window.innerHeight - rect.bottom < 260;
|
|
79
|
+
setUp(flipUp);
|
|
80
|
+
setPos({
|
|
81
|
+
left: rect.left,
|
|
82
|
+
minWidth: rect.width,
|
|
83
|
+
...(flipUp
|
|
84
|
+
? { bottom: window.innerHeight - rect.top + 4 }
|
|
85
|
+
: { top: rect.bottom + 4 }),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
setQuery("");
|
|
89
|
+
const sel = options.findIndex((o) => o.value === selected);
|
|
90
|
+
setHighlight(sel >= 0 ? sel : (enabledIndexes[0] ?? 0));
|
|
91
|
+
setOpen(true);
|
|
92
|
+
if (searchable)
|
|
93
|
+
requestAnimationFrame(() => searchRef.current?.focus({ preventScroll: true }));
|
|
94
|
+
};
|
|
95
|
+
const close = () => {
|
|
96
|
+
setOpen(false);
|
|
97
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
98
|
+
};
|
|
99
|
+
const pick = (opt) => {
|
|
100
|
+
if (!opt || opt.disabled)
|
|
101
|
+
return;
|
|
102
|
+
if (value === undefined)
|
|
103
|
+
setInternal(opt.value);
|
|
104
|
+
onValueChange?.(opt.value);
|
|
105
|
+
setOpen(false);
|
|
106
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
107
|
+
};
|
|
108
|
+
const moveHighlight = (dir) => {
|
|
109
|
+
if (enabledIndexes.length === 0)
|
|
110
|
+
return;
|
|
111
|
+
const pos = enabledIndexes.indexOf(highlight);
|
|
112
|
+
const nextPos = pos < 0
|
|
113
|
+
? dir > 0
|
|
114
|
+
? 0
|
|
115
|
+
: enabledIndexes.length - 1
|
|
116
|
+
: (pos + dir + enabledIndexes.length) % enabledIndexes.length;
|
|
117
|
+
setHighlight(enabledIndexes[nextPos] ?? 0);
|
|
118
|
+
};
|
|
119
|
+
const onNavKeys = (e) => {
|
|
120
|
+
switch (e.key) {
|
|
121
|
+
case "ArrowDown":
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
moveHighlight(1);
|
|
124
|
+
break;
|
|
125
|
+
case "ArrowUp":
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
moveHighlight(-1);
|
|
128
|
+
break;
|
|
129
|
+
case "Home":
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
setHighlight(enabledIndexes[0] ?? 0);
|
|
132
|
+
break;
|
|
133
|
+
case "End":
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
setHighlight(enabledIndexes[enabledIndexes.length - 1] ?? 0);
|
|
136
|
+
break;
|
|
137
|
+
case "Enter":
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
pick(filtered[highlight]);
|
|
140
|
+
break;
|
|
141
|
+
case "Escape":
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
close();
|
|
144
|
+
break;
|
|
145
|
+
case "Tab":
|
|
146
|
+
setOpen(false);
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const onTriggerKeyDown = (e) => {
|
|
151
|
+
if (!open) {
|
|
152
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
openMenu();
|
|
155
|
+
}
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
// when searchable, navigation is handled on the search input
|
|
159
|
+
if (!searchable)
|
|
160
|
+
onNavKeys(e);
|
|
161
|
+
};
|
|
162
|
+
React.useEffect(() => {
|
|
163
|
+
if (!open)
|
|
164
|
+
return;
|
|
165
|
+
const onDown = (e) => {
|
|
166
|
+
if (!rootRef.current?.contains(e.target))
|
|
167
|
+
setOpen(false);
|
|
168
|
+
};
|
|
169
|
+
document.addEventListener("pointerdown", onDown);
|
|
170
|
+
return () => document.removeEventListener("pointerdown", onDown);
|
|
171
|
+
}, [open]);
|
|
172
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: rootRef, className: (0, select_recipe_1.selectRecipe)({ variant, width, className }), ...rest, children: [(0, jsx_runtime_1.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: [(0, jsx_runtime_1.jsx)("span", { className: "select-value", children: selectedOption ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [selectedOption.color && ((0, jsx_runtime_1.jsx)("span", { className: "select-option-dot", style: { background: selectedOption.color } })), selectedOption.label] })) : ((0, jsx_runtime_1.jsx)("span", { className: "select-placeholder", children: placeholder })) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "select-chevron", size: 16, strokeWidth: 1.75 })] }), open && ((0, jsx_runtime_1.jsxs)("div", { className: "select-listbox", role: "listbox", "aria-label": ariaLabel, "data-up": up ? "" : undefined, style: pos, children: [searchable && ((0, jsx_runtime_1.jsxs)("div", { className: "select-search", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Search, { size: 15, strokeWidth: 1.75 }), (0, jsx_runtime_1.jsx)("input", { ref: searchRef, type: "text", placeholder: searchPlaceholder, "aria-label": searchPlaceholder, value: query, onChange: (e) => {
|
|
173
|
+
setQuery(e.target.value);
|
|
174
|
+
setHighlight(0);
|
|
175
|
+
}, onKeyDown: onNavKeys })] })), filtered.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "select-empty", children: "No results" })) : (filtered.map((opt, i) => {
|
|
176
|
+
const isSel = opt.value === selected;
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", role: "option", "aria-selected": isSel, disabled: opt.disabled, "data-disabled": opt.disabled ? "" : undefined, "data-highlighted": i === highlight ? "" : undefined, className: "select-option", onClick: () => pick(opt), onMouseEnter: () => setHighlight(i), children: [opt.color && ((0, jsx_runtime_1.jsx)("span", { className: "select-option-dot", style: { background: opt.color } })), (0, jsx_runtime_1.jsx)("span", { className: "select-option-label", children: opt.label }), isSel && ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "select-option-check", size: 15, strokeWidth: 2 }))] }, opt.value));
|
|
178
|
+
}))] }))] }));
|
|
179
|
+
}
|
|
180
|
+
Select.displayName = "Select";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A select / dropdown, measured from Attio's settings: a 32px combobox trigger
|
|
7
|
+
// (radius 9, value + a 16px chevron) over a listbox — radius 12, 4px padding, a
|
|
8
|
+
// layered soft shadow — of 32px options (radius 8, 6/8 padding) that show a
|
|
9
|
+
// check on the selected one and highlight on hover / keyboard. The listbox is
|
|
10
|
+
// portaled into this root (which is position:relative) so it escapes overflow
|
|
11
|
+
// while keeping these nested styles.
|
|
12
|
+
const config = (0, core_1.defineRecipe)({
|
|
13
|
+
name: "select",
|
|
14
|
+
base: `
|
|
15
|
+
position: relative; display: inline-flex; font-family: ${tokens_1.contract.font.sans};
|
|
16
|
+
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
17
|
+
|
|
18
|
+
& .select-trigger {
|
|
19
|
+
box-sizing: border-box; display: inline-flex; align-items: center; gap: ${tokens_1.contract.space["1.5"]};
|
|
20
|
+
height: ${tokens_1.contract.size.menuRow}; width: 100%; min-width: 0; margin: 0; padding: 0 ${tokens_1.contract.space["1.5"]} 0 ${tokens_1.contract.space["2"]};
|
|
21
|
+
border: none; border-radius: ${tokens_1.contract.radius.md}; background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, ${tokens_1.contract.fgPrimary} 7%, transparent);
|
|
22
|
+
font-family: inherit; font-size: ${tokens_1.contract.text.lg}; color: ${tokens_1.contract.fgPrimary}; cursor: pointer;
|
|
23
|
+
transition: background-color .12s ease, box-shadow .12s ease;
|
|
24
|
+
}
|
|
25
|
+
& .select-trigger:hover { background: ${tokens_1.contract.bgRaised}; }
|
|
26
|
+
& .select-trigger[data-open], & .select-trigger:focus-visible { outline: none; box-shadow: inset 0 0 0 1px ${tokens_1.contract.bgBrandSolid}; background: ${tokens_1.contract.bgSurface}; }
|
|
27
|
+
& .select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
28
|
+
& .select-value { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: ${tokens_1.contract.space["1.5"]}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
|
|
29
|
+
& .select-placeholder { color: ${tokens_1.contract.fgMuted}; }
|
|
30
|
+
& .select-chevron { flex-shrink: 0; color: ${tokens_1.contract.fgMuted}; transition: transform .15s ease; }
|
|
31
|
+
& .select-trigger[data-open] .select-chevron { transform: rotate(180deg); }
|
|
32
|
+
|
|
33
|
+
& .select-listbox {
|
|
34
|
+
position: fixed; z-index: 60; box-sizing: border-box; display: flex; flex-direction: column; gap: ${tokens_1.contract.space.px};
|
|
35
|
+
max-height: 280px; overflow-y: auto; padding: ${tokens_1.contract.space["1"]};
|
|
36
|
+
border-radius: ${tokens_1.contract.radius.xl}; background: ${tokens_1.contract.bgPopover};
|
|
37
|
+
box-shadow: ${tokens_1.elevation.floating};
|
|
38
|
+
transform-origin: top left; opacity: 1; transform: none; transition: opacity .08s ease, transform .08s ease;
|
|
39
|
+
}
|
|
40
|
+
& .select-listbox[data-up] { transform-origin: bottom; }
|
|
41
|
+
& .select-listbox { @starting-style { opacity: 0; transform: scale(0.97) translateY(-1px); } }
|
|
42
|
+
& .select-search { display: flex; align-items: center; gap: ${tokens_1.contract.space["2"]}; height: 34px; flex-shrink: 0; margin: calc(-1 * ${tokens_1.contract.space["1"]}) calc(-1 * ${tokens_1.contract.space["1"]}) ${tokens_1.contract.space["1"]}; padding: 0 ${tokens_1.contract.space["2.5"]}; border-bottom: 1px solid ${tokens_1.contract.borderSubtle}; color: ${tokens_1.contract.fgMuted}; }
|
|
43
|
+
& .select-search svg { flex-shrink: 0; }
|
|
44
|
+
& .select-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: ${tokens_1.contract.text.lg}; color: ${tokens_1.contract.fgPrimary}; }
|
|
45
|
+
& .select-search input::placeholder { color: ${tokens_1.contract.fgMuted}; }
|
|
46
|
+
& .select-empty { padding: ${tokens_1.contract.space["3"]} ${tokens_1.contract.space["2"]}; text-align: center; font-size: ${tokens_1.contract.text.md}; color: ${tokens_1.contract.fgMuted}; }
|
|
47
|
+
& .select-option {
|
|
48
|
+
box-sizing: border-box; display: flex; align-items: center; gap: ${tokens_1.contract.space["2"]}; height: ${tokens_1.contract.size.menuRow}; flex-shrink: 0;
|
|
49
|
+
padding: 0 ${tokens_1.contract.space["2"]}; margin: 0; border: none; background: none; border-radius: ${tokens_1.contract.radius.md};
|
|
50
|
+
font-family: inherit; font-size: ${tokens_1.contract.text.lg}; color: ${tokens_1.contract.fgPrimary}; text-align: start; cursor: pointer; white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
& .select-option[data-highlighted] { background: ${tokens_1.contract.bgRaised}; }
|
|
53
|
+
& .select-option[data-disabled] { opacity: 0.5; cursor: not-allowed; }
|
|
54
|
+
& .select-option-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: ${tokens_1.contract.radius.full}; }
|
|
55
|
+
& .select-option-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
56
|
+
& .select-option-check { flex-shrink: 0; color: ${tokens_1.contract.bgBrandSolid}; }
|
|
57
|
+
`,
|
|
58
|
+
variants: {
|
|
59
|
+
// ghost: borderless at rest (transparent), reveals a subtle fill on hover —
|
|
60
|
+
// Attio's inline selects (e.g. the sort configurator).
|
|
61
|
+
variant: {
|
|
62
|
+
default: "",
|
|
63
|
+
ghost: `
|
|
64
|
+
& .select-trigger { background: transparent; box-shadow: none; }
|
|
65
|
+
& .select-trigger:hover { background: ${tokens_1.contract.bgRaised}; box-shadow: none; }
|
|
66
|
+
& .select-trigger[data-open], & .select-trigger:focus-visible { background: transparent; box-shadow: inset 0 0 0 1px ${tokens_1.contract.bgBrandSolid}; }
|
|
67
|
+
`,
|
|
68
|
+
},
|
|
69
|
+
// full (default): fills its container, as before. auto: sizes to content.
|
|
70
|
+
width: {
|
|
71
|
+
full: `width: 100%;`,
|
|
72
|
+
auto: `width: auto;`,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
defaultVariants: { variant: "default", width: "full" },
|
|
76
|
+
compoundVariants: [],
|
|
77
|
+
});
|
|
78
|
+
exports.selectRecipe = Object.assign((0, core_1.resolveRecipe)(config), { config });
|
|
79
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skeletonRecipe = exports.Skeleton = void 0;
|
|
4
|
+
var skeleton_1 = require("./skeleton");
|
|
5
|
+
Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return skeleton_1.Skeleton; } });
|
|
6
|
+
var skeleton_recipe_1 = require("./skeleton.recipe");
|
|
7
|
+
Object.defineProperty(exports, "skeletonRecipe", { enumerable: true, get: function () { return skeleton_recipe_1.skeletonRecipe; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Skeleton = Skeleton;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const skeleton_recipe_1 = require("./skeleton.recipe");
|
|
6
|
+
/** A pulsing placeholder block sized to the content it stands in for. */
|
|
7
|
+
function Skeleton({ width, height = 16, circle, radius, className, ...rest }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", "data-circle": circle ? "" : undefined, className: (0, skeleton_recipe_1.skeletonRecipe)({ className }), ...rest,
|
|
9
|
+
// the consumer's style wins on conflict, but the component's
|
|
10
|
+
// own sizing still applies when they don't set it
|
|
11
|
+
style: { width, height, borderRadius: radius, ...rest.style } }));
|
|
12
|
+
}
|
|
13
|
+
Skeleton.displayName = "Skeleton";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skeletonRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A pulsing placeholder block for loading states.
|
|
7
|
+
const config = (0, core_1.defineRecipe)({
|
|
8
|
+
name: "skeleton",
|
|
9
|
+
globalCss: `@keyframes crisp-skeleton { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }`,
|
|
10
|
+
base: `display: block; background: color-mix(in srgb, ${tokens_1.contract.fgPrimary} 8%, transparent); border-radius: ${tokens_1.contract.radius.md}; animation: crisp-skeleton 1.4s ease-in-out infinite;
|
|
11
|
+
&[data-circle] { border-radius: ${tokens_1.contract.radius.full}; }`,
|
|
12
|
+
variants: {},
|
|
13
|
+
defaultVariants: {},
|
|
14
|
+
compoundVariants: [],
|
|
15
|
+
});
|
|
16
|
+
exports.skeletonRecipe = (0, core_1.resolveRecipe)(config);
|
|
17
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spinnerRecipe = exports.Spinner = void 0;
|
|
4
|
+
var spinner_1 = require("./spinner");
|
|
5
|
+
Object.defineProperty(exports, "Spinner", { enumerable: true, get: function () { return spinner_1.Spinner; } });
|
|
6
|
+
var spinner_recipe_1 = require("./spinner.recipe");
|
|
7
|
+
Object.defineProperty(exports, "spinnerRecipe", { enumerable: true, get: function () { return spinner_recipe_1.spinnerRecipe; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Spinner = Spinner;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const spinner_recipe_1 = require("./spinner.recipe");
|
|
6
|
+
/** A spinning ring indicator. Reports `role="status"` for assistive tech. */
|
|
7
|
+
function Spinner({ size = 16, "aria-label": ariaLabel = "Loading", className, ...rest }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("span", { role: "status", "aria-label": ariaLabel, className: (0, spinner_recipe_1.spinnerRecipe)({ className }), ...rest, style: {
|
|
9
|
+
width: size,
|
|
10
|
+
height: size,
|
|
11
|
+
borderWidth: Math.max(2, Math.round(size / 8)),
|
|
12
|
+
...rest.style,
|
|
13
|
+
} }));
|
|
14
|
+
}
|
|
15
|
+
Spinner.displayName = "Spinner";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spinnerRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A spinning ring loading indicator.
|
|
7
|
+
const config = (0, core_1.defineRecipe)({
|
|
8
|
+
name: "spinner",
|
|
9
|
+
globalCss: `@keyframes crisp-spin { to { transform: rotate(360deg); } }`,
|
|
10
|
+
base: `display: inline-block; box-sizing: border-box; width: 16px; height: 16px; border-radius: ${tokens_1.contract.radius.full}; border: 2px solid color-mix(in srgb, ${tokens_1.contract.fgPrimary} 15%, transparent); border-top-color: ${tokens_1.contract.fgMuted}; animation: crisp-spin 0.6s linear infinite;`,
|
|
11
|
+
variants: {},
|
|
12
|
+
defaultVariants: {},
|
|
13
|
+
compoundVariants: [],
|
|
14
|
+
});
|
|
15
|
+
exports.spinnerRecipe = (0, core_1.resolveRecipe)(config);
|
|
16
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stagebarRecipe = exports.StageBar = void 0;
|
|
4
|
+
var stagebar_1 = require("./stagebar");
|
|
5
|
+
Object.defineProperty(exports, "StageBar", { enumerable: true, get: function () { return stagebar_1.StageBar; } });
|
|
6
|
+
var stagebar_recipe_1 = require("./stagebar.recipe");
|
|
7
|
+
Object.defineProperty(exports, "stagebarRecipe", { enumerable: true, get: function () { return stagebar_recipe_1.stagebarRecipe; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StageBar = StageBar;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const stagebar_recipe_1 = require("./stagebar.recipe");
|
|
6
|
+
const DEFAULT = "#266df0";
|
|
7
|
+
/**
|
|
8
|
+
* A pipeline stage bar — measured from Attio's Deal-stage Highlight. Each stage
|
|
9
|
+
* is a segment tinted with its colour; the current stage is at full strength.
|
|
10
|
+
*/
|
|
11
|
+
function StageBar({ stages, current, "aria-label": ariaLabel, className, ...rest }) {
|
|
12
|
+
const currentIndex = typeof current === "number"
|
|
13
|
+
? current
|
|
14
|
+
: stages.findIndex((s) => s.label === current);
|
|
15
|
+
const currentStage = stages[currentIndex];
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, stagebar_recipe_1.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) => {
|
|
17
|
+
const color = stage.color ?? DEFAULT;
|
|
18
|
+
const on = i === currentIndex;
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: "stagebar-seg", style: {
|
|
20
|
+
background: on
|
|
21
|
+
? color
|
|
22
|
+
: `color-mix(in srgb, ${color} 18%, transparent)`,
|
|
23
|
+
} }, stage.label));
|
|
24
|
+
}) }));
|
|
25
|
+
}
|
|
26
|
+
StageBar.displayName = "StageBar";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stagebarRecipe = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
const tokens_1 = require("../../tokens");
|
|
6
|
+
// A pipeline stage indicator — Attio's Deal-stage Highlight bar: one segment per
|
|
7
|
+
// stage, each tinted with its stage colour, the current stage at full strength.
|
|
8
|
+
const config = (0, core_1.defineRecipe)({
|
|
9
|
+
name: "stagebar",
|
|
10
|
+
base: `display: flex; align-items: center; gap: ${tokens_1.contract.space["0.5"]}; width: 100%; height: 6px; font-family: ${tokens_1.contract.font.sans};
|
|
11
|
+
& .stagebar-seg { flex: 1; height: 100%; border-radius: ${tokens_1.contract.radius.full}; transition: background 0.2s ease; }`,
|
|
12
|
+
variants: {},
|
|
13
|
+
defaultVariants: {},
|
|
14
|
+
compoundVariants: [],
|
|
15
|
+
});
|
|
16
|
+
exports.stagebarRecipe = (0, core_1.resolveRecipe)(config);
|
|
17
|
+
exports.default = config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statcardRecipe = exports.StatCard = void 0;
|
|
4
|
+
var statcard_1 = require("./statcard");
|
|
5
|
+
Object.defineProperty(exports, "StatCard", { enumerable: true, get: function () { return statcard_1.StatCard; } });
|
|
6
|
+
var statcard_recipe_1 = require("./statcard.recipe");
|
|
7
|
+
Object.defineProperty(exports, "statcardRecipe", { enumerable: true, get: function () { return statcard_recipe_1.statcardRecipe; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatCard = StatCard;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const lucide_react_1 = require("lucide-react");
|
|
6
|
+
const statcard_recipe_1 = require("./statcard.recipe");
|
|
7
|
+
/**
|
|
8
|
+
* A single-metric KPI tile — measured from Attio's Reports number/insight cards.
|
|
9
|
+
* Label, a large value, and an optional up/down delta pill with a caption.
|
|
10
|
+
*/
|
|
11
|
+
function StatCard({ label, icon, value, delta, deltaSuffix = "%", caption, card, className, ...rest }) {
|
|
12
|
+
const trend = delta == null ? null : delta > 0 ? "up" : delta < 0 ? "down" : "flat";
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, statcard_recipe_1.statcardRecipe)({ card, className }), ...rest, children: [(0, jsx_runtime_1.jsxs)("span", { className: "statcard-label", children: [icon, label] }), (0, jsx_runtime_1.jsx)("span", { className: "statcard-value", children: value }), (trend != null || caption != null) && ((0, jsx_runtime_1.jsxs)("span", { className: "statcard-foot", children: [trend != null && ((0, jsx_runtime_1.jsxs)("span", { className: "statcard-delta", "data-trend": trend, children: [trend === "up" && (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowUp, { size: 12, strokeWidth: 2.5 }), trend === "down" && (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { size: 12, strokeWidth: 2.5 }), Math.abs(delta), deltaSuffix] })), caption] }))] }));
|
|
14
|
+
}
|
|
15
|
+
StatCard.displayName = "StatCard";
|