@crisp-ui-kit/crisp 0.31.6 → 0.32.1
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/NOTICE +88 -0
- package/README.md +22 -0
- package/dist/accordion.css +13 -13
- package/dist/accordion.layered.css +23 -0
- package/dist/appshell.css +11 -11
- package/dist/appshell.layered.css +25 -0
- package/dist/authshell.css +23 -23
- package/dist/authshell.layered.css +59 -0
- package/dist/avatar.css +23 -23
- package/dist/avatar.layered.css +41 -0
- package/dist/avatargroup.css +2 -2
- package/dist/avatargroup.layered.css +7 -0
- package/dist/badge.css +31 -31
- package/dist/badge.layered.css +51 -0
- package/dist/barchart.css +15 -15
- package/dist/barchart.layered.css +25 -0
- package/dist/base.css +4 -4
- package/dist/board.css +20 -20
- package/dist/board.layered.css +34 -0
- package/dist/breadcrumb.css +8 -8
- package/dist/breadcrumb.layered.css +13 -0
- package/dist/bulkbar.css +13 -13
- package/dist/bulkbar.layered.css +23 -0
- package/dist/button.css +21 -21
- package/dist/button.layered.css +46 -0
- package/dist/callout.css +15 -15
- package/dist/callout.layered.css +18 -0
- package/dist/card.css +14 -14
- package/dist/card.layered.css +30 -0
- package/dist/checkbox.css +9 -9
- package/dist/checkbox.layered.css +21 -0
- package/dist/cjs/components/accordion/accordion.js +1 -1
- package/dist/cjs/components/accordion/accordion.recipe.js +10 -10
- package/dist/cjs/components/badge/badge.js +1 -1
- package/dist/cjs/components/badge/badge.recipe.js +1 -1
- package/dist/cjs/components/barchart/barchart.js +3 -3
- package/dist/cjs/components/barchart/barchart.recipe.js +14 -14
- package/dist/cjs/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.recipe.js +6 -6
- package/dist/cjs/components/bulkbar/bulkbar.js +2 -2
- package/dist/cjs/components/bulkbar/bulkbar.recipe.js +10 -10
- package/dist/cjs/components/callout/callout.js +1 -1
- package/dist/cjs/components/callout/callout.recipe.js +9 -9
- package/dist/cjs/components/card/card.js +3 -3
- package/dist/cjs/components/card/card.recipe.js +5 -5
- package/dist/cjs/components/columncalc/columncalc.js +1 -1
- package/dist/cjs/components/columncalc/columncalc.recipe.js +16 -9
- package/dist/cjs/components/contextmenu/contextmenu.js +4 -4
- package/dist/cjs/components/contextmenu/contextmenu.recipe.js +9 -9
- package/dist/cjs/components/datatable/datatable.js +32 -22
- package/dist/cjs/components/datatable/datatable.recipe.js +57 -57
- package/dist/cjs/components/datepicker/datepicker.js +12 -12
- package/dist/cjs/components/datepicker/datepicker.recipe.js +45 -45
- package/dist/cjs/components/datepickerfield/datepickerfield.js +2 -2
- package/dist/cjs/components/datepickerfield/datepickerfield.recipe.js +9 -9
- package/dist/cjs/components/dialog/dialog.js +5 -5
- package/dist/cjs/components/dialog/dialog.recipe.js +16 -16
- package/dist/cjs/components/donutchart/donutchart.js +1 -1
- package/dist/cjs/components/donutchart/donutchart.recipe.js +12 -12
- package/dist/cjs/components/drawer/drawer.js +3 -3
- package/dist/cjs/components/drawer/drawer.recipe.js +14 -14
- package/dist/cjs/components/emptystate/emptystate.js +1 -1
- package/dist/cjs/components/emptystate/emptystate.recipe.js +9 -9
- package/dist/cjs/components/fileupload/fileupload.js +3 -3
- package/dist/cjs/components/fileupload/fileupload.recipe.js +23 -23
- package/dist/cjs/components/formfield/formfield.js +1 -1
- package/dist/cjs/components/formfield/formfield.recipe.js +5 -5
- package/dist/cjs/components/input/input.js +1 -1
- package/dist/cjs/components/input/input.recipe.js +6 -6
- package/dist/cjs/components/linechart/linechart.js +4 -4
- package/dist/cjs/components/linechart/linechart.recipe.js +14 -14
- package/dist/cjs/components/menu/menu.js +6 -6
- package/dist/cjs/components/menu/menu.recipe.js +19 -19
- package/dist/cjs/components/multiselect/multiselect.js +5 -5
- package/dist/cjs/components/multiselect/multiselect.recipe.js +29 -29
- package/dist/cjs/components/popover/popover.js +1 -1
- package/dist/cjs/components/popover/popover.recipe.js +3 -3
- package/dist/cjs/components/progress/progress.js +2 -2
- package/dist/cjs/components/progress/progress.recipe.js +3 -3
- package/dist/cjs/components/quantitypicker/quantitypicker.js +2 -2
- package/dist/cjs/components/quantitypicker/quantitypicker.recipe.js +16 -16
- package/dist/cjs/components/radiogroup/radiogroup.js +1 -1
- package/dist/cjs/components/radiogroup/radiogroup.recipe.js +14 -14
- package/dist/cjs/components/resizablepanel/resizablepanel.js +3 -3
- package/dist/cjs/components/resizablepanel/resizablepanel.recipe.js +24 -24
- package/dist/cjs/components/segmented/segmented.js +4 -4
- package/dist/cjs/components/segmented/segmented.recipe.js +7 -7
- package/dist/cjs/components/select/select.js +3 -3
- package/dist/cjs/components/select/select.recipe.js +25 -25
- package/dist/cjs/components/slider/slider.js +2 -2
- package/dist/cjs/components/slider/slider.recipe.js +15 -15
- package/dist/cjs/components/stagebar/stagebar.js +1 -1
- package/dist/cjs/components/stagebar/stagebar.recipe.js +1 -1
- package/dist/cjs/components/statcard/statcard.js +1 -1
- package/dist/cjs/components/statcard/statcard.recipe.js +9 -9
- package/dist/cjs/components/switch/switch.js +1 -1
- package/dist/cjs/components/switch/switch.recipe.js +2 -2
- package/dist/cjs/components/table/table.js +1 -1
- package/dist/cjs/components/table/table.recipe.js +1 -1
- package/dist/cjs/components/tabletoolbar/tabletoolbar.chrome.js +65 -64
- package/dist/cjs/components/tabletoolbar/tabletoolbar.js +13 -13
- package/dist/cjs/components/tabs/tabs.js +4 -4
- package/dist/cjs/components/tabs/tabs.recipe.js +12 -12
- package/dist/cjs/components/textarea/textarea.js +2 -2
- package/dist/cjs/components/textarea/textarea.recipe.js +11 -11
- package/dist/cjs/components/toast/toast.js +4 -4
- package/dist/cjs/components/toast/toast.recipe.js +14 -14
- package/dist/cjs/components/wheelpicker/wheelpicker.js +2 -2
- package/dist/cjs/components/wheelpicker/wheelpicker.recipe.js +19 -19
- package/dist/cjs/core/namespace.js +17 -0
- package/dist/cjs/core/resolve.js +5 -3
- package/dist/cjs/product/appshell/appshell.js +2 -2
- package/dist/cjs/product/appshell/appshell.recipe.js +8 -8
- package/dist/cjs/product/authshell/authshell.js +1 -1
- package/dist/cjs/product/authshell/authshell.recipe.js +20 -20
- package/dist/cjs/product/board/board.js +3 -3
- package/dist/cjs/product/board/board.recipe.js +17 -17
- package/dist/cjs/product/command/command.js +3 -3
- package/dist/cjs/product/command/command.recipe.js +25 -25
- package/dist/cjs/product/entitycard/entitycard.js +1 -1
- package/dist/cjs/product/entitycard/entitycard.recipe.js +7 -7
- package/dist/cjs/product/flowcanvas/flowcanvas.js +5 -5
- package/dist/cjs/product/flowcanvas/flowcanvas.recipe.js +11 -11
- package/dist/cjs/product/inbox/inbox.js +1 -1
- package/dist/cjs/product/inbox/inbox.recipe.js +22 -22
- package/dist/cjs/product/listpage/listpage.js +3 -3
- package/dist/cjs/product/listpage/listpage.recipe.js +18 -18
- package/dist/cjs/product/navitem/navitem.js +1 -1
- package/dist/cjs/product/navitem/navitem.recipe.js +2 -2
- package/dist/cjs/product/onboarding/onboarding.js +1 -1
- package/dist/cjs/product/onboarding/onboarding.recipe.js +19 -19
- package/dist/cjs/product/recordpage/recordpage.js +24 -24
- package/dist/cjs/product/recordpage/recordpage.recipe.js +117 -117
- package/dist/cjs/product/recordpanel/recordpanel.js +4 -4
- package/dist/cjs/product/recordpanel/recordpanel.recipe.js +15 -15
- package/dist/cjs/product/recordstable/recordstable.js +48 -48
- package/dist/cjs/product/recordstable/recordstable.recipe.js +87 -87
- package/dist/cjs/product/recordstable/recordstable.tag.js +8 -8
- package/dist/cjs/product/richtext/richtext.js +4 -4
- package/dist/cjs/product/richtext/richtext.recipe.js +21 -21
- package/dist/cjs/product/settingssection/settingssection.js +1 -1
- package/dist/cjs/product/settingssection/settingssection.recipe.js +6 -6
- package/dist/cjs/product/settingsshell/settingsshell.js +1 -1
- package/dist/cjs/product/settingsshell/settingsshell.recipe.js +20 -20
- package/dist/cjs/product/sidebar/sidebar.js +2 -2
- package/dist/cjs/product/sidebar/sidebar.recipe.js +21 -21
- package/dist/cjs/product/tasklist/tasklist.js +2 -2
- package/dist/cjs/product/tasklist/tasklist.recipe.js +14 -14
- package/dist/cjs/product/trialbanner/trialbanner.js +1 -1
- package/dist/cjs/product/trialbanner/trialbanner.recipe.js +6 -6
- package/dist/cjs/product/viewtoggle/viewtoggle.js +1 -1
- package/dist/cjs/product/viewtoggle/viewtoggle.recipe.js +4 -4
- package/dist/cjs/tokens/contract.js +3 -2
- package/dist/columncalc.css +19 -12
- package/dist/columncalc.layered.css +35 -0
- package/dist/command.css +28 -28
- package/dist/command.layered.css +44 -0
- package/dist/contextmenu.css +12 -12
- package/dist/contextmenu.layered.css +22 -0
- package/dist/datatable.css +66 -66
- package/dist/datatable.layered.css +108 -0
- package/dist/datepicker.css +86 -86
- package/dist/datepicker.layered.css +179 -0
- package/dist/datepickerfield.css +19 -19
- package/dist/datepickerfield.layered.css +29 -0
- package/dist/dialog.css +19 -19
- package/dist/dialog.layered.css +29 -0
- package/dist/divider.css +2 -2
- package/dist/divider.layered.css +7 -0
- package/dist/donutchart.css +15 -15
- package/dist/donutchart.layered.css +26 -0
- package/dist/drawer.css +17 -17
- package/dist/drawer.layered.css +27 -0
- package/dist/emptystate.css +15 -15
- package/dist/emptystate.layered.css +22 -0
- package/dist/entitycard.css +14 -14
- package/dist/entitycard.layered.css +28 -0
- package/dist/esm/components/accordion/accordion.js +1 -1
- package/dist/esm/components/accordion/accordion.recipe.js +10 -10
- package/dist/esm/components/badge/badge.js +1 -1
- package/dist/esm/components/badge/badge.recipe.js +1 -1
- package/dist/esm/components/barchart/barchart.js +3 -3
- package/dist/esm/components/barchart/barchart.recipe.js +14 -14
- package/dist/esm/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/esm/components/breadcrumb/breadcrumb.recipe.js +6 -6
- package/dist/esm/components/bulkbar/bulkbar.js +2 -2
- package/dist/esm/components/bulkbar/bulkbar.recipe.js +10 -10
- package/dist/esm/components/callout/callout.js +1 -1
- package/dist/esm/components/callout/callout.recipe.js +9 -9
- package/dist/esm/components/card/card.js +3 -3
- package/dist/esm/components/card/card.recipe.js +5 -5
- package/dist/esm/components/columncalc/columncalc.js +1 -1
- package/dist/esm/components/columncalc/columncalc.recipe.js +16 -9
- package/dist/esm/components/contextmenu/contextmenu.js +4 -4
- package/dist/esm/components/contextmenu/contextmenu.recipe.js +9 -9
- package/dist/esm/components/datatable/datatable.js +32 -22
- package/dist/esm/components/datatable/datatable.recipe.js +57 -57
- package/dist/esm/components/datepicker/datepicker.js +12 -12
- package/dist/esm/components/datepicker/datepicker.recipe.js +45 -45
- package/dist/esm/components/datepickerfield/datepickerfield.js +2 -2
- package/dist/esm/components/datepickerfield/datepickerfield.recipe.js +9 -9
- package/dist/esm/components/dialog/dialog.js +5 -5
- package/dist/esm/components/dialog/dialog.recipe.js +16 -16
- package/dist/esm/components/donutchart/donutchart.js +1 -1
- package/dist/esm/components/donutchart/donutchart.recipe.js +12 -12
- package/dist/esm/components/drawer/drawer.js +3 -3
- package/dist/esm/components/drawer/drawer.recipe.js +14 -14
- package/dist/esm/components/emptystate/emptystate.js +1 -1
- package/dist/esm/components/emptystate/emptystate.recipe.js +9 -9
- package/dist/esm/components/fileupload/fileupload.js +3 -3
- package/dist/esm/components/fileupload/fileupload.recipe.js +23 -23
- package/dist/esm/components/formfield/formfield.js +1 -1
- package/dist/esm/components/formfield/formfield.recipe.js +5 -5
- package/dist/esm/components/input/input.js +1 -1
- package/dist/esm/components/input/input.recipe.js +6 -6
- package/dist/esm/components/linechart/linechart.js +4 -4
- package/dist/esm/components/linechart/linechart.recipe.js +14 -14
- package/dist/esm/components/menu/menu.js +6 -6
- package/dist/esm/components/menu/menu.recipe.js +19 -19
- package/dist/esm/components/multiselect/multiselect.js +5 -5
- package/dist/esm/components/multiselect/multiselect.recipe.js +29 -29
- package/dist/esm/components/popover/popover.js +1 -1
- package/dist/esm/components/popover/popover.recipe.js +3 -3
- package/dist/esm/components/progress/progress.js +2 -2
- package/dist/esm/components/progress/progress.recipe.js +3 -3
- package/dist/esm/components/quantitypicker/quantitypicker.js +2 -2
- package/dist/esm/components/quantitypicker/quantitypicker.recipe.js +16 -16
- package/dist/esm/components/radiogroup/radiogroup.js +1 -1
- package/dist/esm/components/radiogroup/radiogroup.recipe.js +14 -14
- package/dist/esm/components/resizablepanel/resizablepanel.js +3 -3
- package/dist/esm/components/resizablepanel/resizablepanel.recipe.js +24 -24
- package/dist/esm/components/segmented/segmented.js +4 -4
- package/dist/esm/components/segmented/segmented.recipe.js +7 -7
- package/dist/esm/components/select/select.js +3 -3
- package/dist/esm/components/select/select.recipe.js +25 -25
- package/dist/esm/components/slider/slider.js +2 -2
- package/dist/esm/components/slider/slider.recipe.js +15 -15
- package/dist/esm/components/stagebar/stagebar.js +1 -1
- package/dist/esm/components/stagebar/stagebar.recipe.js +1 -1
- package/dist/esm/components/statcard/statcard.js +1 -1
- package/dist/esm/components/statcard/statcard.recipe.js +9 -9
- package/dist/esm/components/switch/switch.js +1 -1
- package/dist/esm/components/switch/switch.recipe.js +2 -2
- package/dist/esm/components/table/table.js +1 -1
- package/dist/esm/components/table/table.recipe.js +1 -1
- package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +65 -64
- package/dist/esm/components/tabletoolbar/tabletoolbar.js +13 -13
- package/dist/esm/components/tabs/tabs.js +4 -4
- package/dist/esm/components/tabs/tabs.recipe.js +12 -12
- package/dist/esm/components/textarea/textarea.js +2 -2
- package/dist/esm/components/textarea/textarea.recipe.js +11 -11
- package/dist/esm/components/toast/toast.js +4 -4
- package/dist/esm/components/toast/toast.recipe.js +14 -14
- package/dist/esm/components/wheelpicker/wheelpicker.js +2 -2
- package/dist/esm/components/wheelpicker/wheelpicker.recipe.js +19 -19
- package/dist/esm/core/namespace.js +14 -0
- package/dist/esm/core/resolve.js +5 -3
- package/dist/esm/product/appshell/appshell.js +2 -2
- package/dist/esm/product/appshell/appshell.recipe.js +8 -8
- package/dist/esm/product/authshell/authshell.js +1 -1
- package/dist/esm/product/authshell/authshell.recipe.js +20 -20
- package/dist/esm/product/board/board.js +3 -3
- package/dist/esm/product/board/board.recipe.js +17 -17
- package/dist/esm/product/command/command.js +3 -3
- package/dist/esm/product/command/command.recipe.js +25 -25
- package/dist/esm/product/entitycard/entitycard.js +1 -1
- package/dist/esm/product/entitycard/entitycard.recipe.js +7 -7
- package/dist/esm/product/flowcanvas/flowcanvas.js +5 -5
- package/dist/esm/product/flowcanvas/flowcanvas.recipe.js +11 -11
- package/dist/esm/product/inbox/inbox.js +1 -1
- package/dist/esm/product/inbox/inbox.recipe.js +22 -22
- package/dist/esm/product/listpage/listpage.js +3 -3
- package/dist/esm/product/listpage/listpage.recipe.js +18 -18
- package/dist/esm/product/navitem/navitem.js +1 -1
- package/dist/esm/product/navitem/navitem.recipe.js +2 -2
- package/dist/esm/product/onboarding/onboarding.js +1 -1
- package/dist/esm/product/onboarding/onboarding.recipe.js +19 -19
- package/dist/esm/product/recordpage/recordpage.js +24 -24
- package/dist/esm/product/recordpage/recordpage.recipe.js +117 -117
- package/dist/esm/product/recordpanel/recordpanel.js +4 -4
- package/dist/esm/product/recordpanel/recordpanel.recipe.js +15 -15
- package/dist/esm/product/recordstable/recordstable.js +48 -48
- package/dist/esm/product/recordstable/recordstable.recipe.js +87 -87
- package/dist/esm/product/recordstable/recordstable.tag.js +8 -8
- package/dist/esm/product/richtext/richtext.js +4 -4
- package/dist/esm/product/richtext/richtext.recipe.js +21 -21
- package/dist/esm/product/settingssection/settingssection.js +1 -1
- package/dist/esm/product/settingssection/settingssection.recipe.js +6 -6
- package/dist/esm/product/settingsshell/settingsshell.js +1 -1
- package/dist/esm/product/settingsshell/settingsshell.recipe.js +20 -20
- package/dist/esm/product/sidebar/sidebar.js +2 -2
- package/dist/esm/product/sidebar/sidebar.recipe.js +21 -21
- package/dist/esm/product/tasklist/tasklist.js +2 -2
- package/dist/esm/product/tasklist/tasklist.recipe.js +14 -14
- package/dist/esm/product/trialbanner/trialbanner.js +1 -1
- package/dist/esm/product/trialbanner/trialbanner.recipe.js +6 -6
- package/dist/esm/product/viewtoggle/viewtoggle.js +1 -1
- package/dist/esm/product/viewtoggle/viewtoggle.recipe.js +4 -4
- package/dist/esm/tokens/contract.js +3 -2
- package/dist/fileupload.css +46 -46
- package/dist/fileupload.layered.css +91 -0
- package/dist/flowcanvas.css +13 -13
- package/dist/flowcanvas.layered.css +17 -0
- package/dist/formfield.css +7 -7
- package/dist/formfield.layered.css +10 -0
- package/dist/inbox.css +26 -26
- package/dist/inbox.layered.css +41 -0
- package/dist/input.css +17 -17
- package/dist/input.layered.css +45 -0
- package/dist/kbd.css +2 -2
- package/dist/kbd.layered.css +5 -0
- package/dist/linechart.css +14 -14
- package/dist/linechart.layered.css +17 -0
- package/dist/listpage.css +22 -22
- package/dist/listpage.layered.css +41 -0
- package/dist/menu.css +29 -29
- package/dist/menu.layered.css +48 -0
- package/dist/multiselect.css +42 -42
- package/dist/multiselect.layered.css +63 -0
- package/dist/navitem.css +14 -14
- package/dist/navitem.layered.css +25 -0
- package/dist/onboarding.css +24 -24
- package/dist/onboarding.layered.css +39 -0
- package/dist/popover.css +6 -6
- package/dist/popover.layered.css +16 -0
- package/dist/progress.css +7 -7
- package/dist/progress.layered.css +17 -0
- package/dist/quantitypicker.css +34 -34
- package/dist/quantitypicker.layered.css +80 -0
- package/dist/radiogroup.css +18 -18
- package/dist/radiogroup.layered.css +33 -0
- package/dist/recordpage.css +122 -122
- package/dist/recordpage.layered.css +153 -0
- package/dist/recordpanel.css +31 -31
- package/dist/recordpanel.layered.css +50 -0
- package/dist/recordstable.css +162 -162
- package/dist/recordstable.layered.css +222 -0
- package/dist/resizablepanel.css +26 -26
- package/dist/resizablepanel.layered.css +55 -0
- package/dist/richtext.css +24 -24
- package/dist/richtext.layered.css +38 -0
- package/dist/segmented.css +10 -10
- package/dist/segmented.layered.css +20 -0
- package/dist/select.css +43 -43
- package/dist/select.layered.css +72 -0
- package/dist/settingssection.css +8 -8
- package/dist/settingssection.layered.css +11 -0
- package/dist/settingsshell.css +23 -23
- package/dist/settingsshell.layered.css +44 -0
- package/dist/sidebar.css +27 -27
- package/dist/sidebar.layered.css +40 -0
- package/dist/skeleton.css +4 -4
- package/dist/skeleton.layered.css +15 -0
- package/dist/slider.css +23 -23
- package/dist/slider.layered.css +58 -0
- package/dist/spinner.css +3 -3
- package/dist/spinner.layered.css +14 -0
- package/dist/stagebar.css +4 -4
- package/dist/stagebar.layered.css +14 -0
- package/dist/statcard.css +14 -14
- package/dist/statcard.layered.css +21 -0
- package/dist/styles.css +1816 -1725
- package/dist/styles.layered.css +2932 -0
- package/dist/switch.css +7 -7
- package/dist/switch.layered.css +22 -0
- package/dist/table.css +16 -16
- package/dist/table.layered.css +36 -0
- package/dist/tabletoolbar.css +67 -67
- package/dist/tabletoolbar.layered.css +80 -0
- package/dist/tabs.css +15 -15
- package/dist/tabs.layered.css +29 -0
- package/dist/tasklist.css +17 -17
- package/dist/tasklist.layered.css +34 -0
- package/dist/textarea.css +18 -18
- package/dist/textarea.layered.css +42 -0
- package/dist/toast.css +17 -17
- package/dist/toast.layered.css +27 -0
- package/dist/tokens.css +199 -115
- package/dist/tooltip.css +3 -3
- package/dist/tooltip.layered.css +13 -0
- package/dist/trialbanner.css +13 -13
- package/dist/trialbanner.layered.css +28 -0
- package/dist/types/core/namespace.d.ts +2 -0
- package/dist/viewtoggle.css +10 -10
- package/dist/viewtoggle.layered.css +23 -0
- package/dist/wheelpicker.css +29 -29
- package/dist/wheelpicker.layered.css +70 -0
- package/licenses/Apache-2.0.txt +201 -0
- package/package.json +5 -2
|
@@ -80,7 +80,7 @@ function formatCell(type, v, symbol) {
|
|
|
80
80
|
// display string belongs -- as an entity's name, a status' label -- while the
|
|
81
81
|
// raw value keeps driving structure and tone.
|
|
82
82
|
function renderTyped(col, value, avatarTone, display) {
|
|
83
|
-
const empty = _jsx("span", { className: "datatable-muted", children: "\u2014" });
|
|
83
|
+
const empty = _jsx("span", { className: "crisp-datatable-muted", children: "\u2014" });
|
|
84
84
|
switch (col.type) {
|
|
85
85
|
case "entity": {
|
|
86
86
|
const raw = (typeof value === "object" && value ? value : { name: asText(value) });
|
|
@@ -89,7 +89,7 @@ function renderTyped(col, value, avatarTone, display) {
|
|
|
89
89
|
const e = display ? { ...raw, name: display } : raw;
|
|
90
90
|
if (!e.name)
|
|
91
91
|
return empty;
|
|
92
|
-
return (_jsxs("span", { className: "datatable-entity", children: [_jsx("span", { className: "datatable-avatar", "data-tone": avatarTone === "hashed" ? toneFor(raw.name) : undefined, children: e.avatar ? (_jsx("img", { src: e.avatar, alt: "" })) : (initials(e.name).slice(0, 2)) }), _jsx("span", { className: "datatable-entity-name", children: e.name })] }));
|
|
92
|
+
return (_jsxs("span", { className: "crisp-datatable-entity", children: [_jsx("span", { className: "crisp-datatable-avatar", "data-tone": avatarTone === "hashed" ? toneFor(raw.name) : undefined, children: e.avatar ? (_jsx("img", { src: e.avatar, alt: "" })) : (initials(e.name).slice(0, 2)) }), _jsx("span", { className: "crisp-datatable-entity-name", children: e.name })] }));
|
|
93
93
|
}
|
|
94
94
|
case "tags": {
|
|
95
95
|
// asking for a format on a tag column means "render it your way" -- show
|
|
@@ -99,7 +99,7 @@ function renderTyped(col, value, avatarTone, display) {
|
|
|
99
99
|
const tags = Array.isArray(value) ? value : [];
|
|
100
100
|
if (!tags.length)
|
|
101
101
|
return empty;
|
|
102
|
-
return (_jsx("span", { className: "datatable-tags", children: tags.map((t) => (_jsx("span", { className: "datatable-tag", "data-tone": col.tones?.[t] ?? toneFor(t), children: t }, t))) }));
|
|
102
|
+
return (_jsx("span", { className: "crisp-datatable-tags", children: tags.map((t) => (_jsx("span", { className: "crisp-datatable-tag", "data-tone": col.tones?.[t] ?? toneFor(t), children: t }, t))) }));
|
|
103
103
|
}
|
|
104
104
|
case "status": {
|
|
105
105
|
const s = asText(value);
|
|
@@ -107,14 +107,14 @@ function renderTyped(col, value, avatarTone, display) {
|
|
|
107
107
|
return empty;
|
|
108
108
|
// tone is looked up by the RAW status, so formatting the label (casing,
|
|
109
109
|
// translation) can never silently repaint the chip
|
|
110
|
-
return (_jsx("span", { className: "datatable-tag", "data-tone": col.tones?.[s] ?? toneFor(s), children: display || s }));
|
|
110
|
+
return (_jsx("span", { className: "crisp-datatable-tag", "data-tone": col.tones?.[s] ?? toneFor(s), children: display || s }));
|
|
111
111
|
}
|
|
112
112
|
default: {
|
|
113
113
|
const text = display || formatCell(col.type, value, col.symbol);
|
|
114
114
|
const isNum = col.type === "number" || col.type === "currency";
|
|
115
115
|
if (!text)
|
|
116
116
|
return empty;
|
|
117
|
-
return isNum ? _jsx("span", { className: "datatable-num", children: text }) : text;
|
|
117
|
+
return isNum ? _jsx("span", { className: "crisp-datatable-num", children: text }) : text;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -366,21 +366,29 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
366
366
|
// sticky attrs for the leading column(s): grip col (index -2) + selection
|
|
367
367
|
// col (-1) + first data column (0). Each offsets by whatever leading
|
|
368
368
|
// columns come before it, so the group stays contiguous when scrolled.
|
|
369
|
+
// `insetInlineStart`, never `left`: the offset pins the column to the
|
|
370
|
+
// LEADING edge, which is the right one under `dir="rtl"`. A physical `left`
|
|
371
|
+
// pins to the trailing edge instead, and the column scrolls out of view the
|
|
372
|
+
// moment sticky would have engaged (#285). RecordsTable does the same job in
|
|
373
|
+
// CSS and has used the logical property since #91 -- this offset is computed
|
|
374
|
+
// here rather than in a recipe, which is why that sweep could not reach it.
|
|
369
375
|
const stickyCol = (index) => {
|
|
370
376
|
if (!stickyFirst)
|
|
371
377
|
return {};
|
|
372
378
|
if (showGrip && index === -2)
|
|
373
|
-
return { "data-sticky": "", style: {
|
|
379
|
+
return { "data-sticky": "", style: { insetInlineStart: 0 } };
|
|
374
380
|
if (selectable && index === -1)
|
|
375
381
|
return {
|
|
376
382
|
"data-sticky": "",
|
|
377
|
-
style: {
|
|
383
|
+
style: { insetInlineStart: showGrip ? GRIP_W : 0 },
|
|
378
384
|
};
|
|
379
385
|
if (index === 0)
|
|
380
386
|
return {
|
|
381
387
|
"data-sticky": "",
|
|
382
388
|
"data-sticky-edge": "",
|
|
383
|
-
style: {
|
|
389
|
+
style: {
|
|
390
|
+
insetInlineStart: (showGrip ? GRIP_W : 0) + (selectable ? CHECK_W : 0),
|
|
391
|
+
},
|
|
384
392
|
};
|
|
385
393
|
return {};
|
|
386
394
|
};
|
|
@@ -417,13 +425,13 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
417
425
|
function ChevronFor({ colKey }) {
|
|
418
426
|
const dir = sortDirByKey.get(colKey);
|
|
419
427
|
if (dir)
|
|
420
|
-
return dir === "asc" ? (_jsx(ArrowUp, { className: "datatable-chevron", size: 13, strokeWidth: 2 })) : (_jsx(ArrowDown, { className: "datatable-chevron", size: 13, strokeWidth: 2 }));
|
|
421
|
-
return (_jsx(ChevronsUpDown, { className: "datatable-chevron", size: 13, strokeWidth: 2 }));
|
|
428
|
+
return dir === "asc" ? (_jsx(ArrowUp, { className: "crisp-datatable-chevron", size: 13, strokeWidth: 2 })) : (_jsx(ArrowDown, { className: "crisp-datatable-chevron", size: 13, strokeWidth: 2 }));
|
|
429
|
+
return (_jsx(ChevronsUpDown, { className: "crisp-datatable-chevron", size: 13, strokeWidth: 2 }));
|
|
422
430
|
}
|
|
423
|
-
return (_jsxs("div", { ref: gridRef, className: datatableRecipe({ className }), tabIndex: -1, onKeyDown: onGridKeyDown, ...rest, children: [(filterable || showCount || toolbar || columnMenu) && (_jsxs("div", { className: "datatable-toolbar", children: [columnMenu && (_jsxs(Menu, { align: "start", trigger: _jsxs("button", { type: "button", className: "datatable-viewsettings", children: [_jsx(SlidersHorizontal, { size: 14, strokeWidth: 1.75 }), "View settings"] }), children: [_jsx("div", { className: "datatable-group-label", children: "Columns" }), allColumns.map((c) => (_jsxs(MenuItem, { onSelect: () => c.hidden ? showColumn(c.key) : hideColumn(c.key), children: [_jsx(Check, { size: 14, strokeWidth: 2, style: { opacity: c.hidden ? 0 : 1 } }), typeof c.header === "string" ? c.header : c.key] }, c.key)))] })), filterable && (_jsxs("span", { className: "datatable-search", children: [_jsx(Search, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), _jsx("input", { type: "search", placeholder: searchPlaceholder, value: query, onChange: (e) => setQuery(e.target.value), "aria-label": searchLabel })] })), showCount && (_jsx("span", { className: "datatable-count", children: countLabel(rows.length, data.length) })), toolbar] })), _jsxs(Table, { interactive: interactive, surface: surface, style: { minWidth }, scrollProps: {
|
|
431
|
+
return (_jsxs("div", { ref: gridRef, className: datatableRecipe({ className }), tabIndex: -1, onKeyDown: onGridKeyDown, ...rest, children: [(filterable || showCount || toolbar || columnMenu) && (_jsxs("div", { className: "crisp-datatable-toolbar", children: [columnMenu && (_jsxs(Menu, { align: "start", trigger: _jsxs("button", { type: "button", className: "crisp-datatable-viewsettings", children: [_jsx(SlidersHorizontal, { size: 14, strokeWidth: 1.75 }), "View settings"] }), children: [_jsx("div", { className: "crisp-datatable-group-label", children: "Columns" }), allColumns.map((c) => (_jsxs(MenuItem, { onSelect: () => c.hidden ? showColumn(c.key) : hideColumn(c.key), children: [_jsx(Check, { size: 14, strokeWidth: 2, style: { opacity: c.hidden ? 0 : 1 } }), typeof c.header === "string" ? c.header : c.key] }, c.key)))] })), filterable && (_jsxs("span", { className: "crisp-datatable-search", children: [_jsx(Search, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), _jsx("input", { type: "search", placeholder: searchPlaceholder, value: query, onChange: (e) => setQuery(e.target.value), "aria-label": searchLabel })] })), showCount && (_jsx("span", { className: "crisp-datatable-count", children: countLabel(rows.length, data.length) })), toolbar] })), _jsxs(Table, { interactive: interactive, surface: surface, style: { minWidth }, scrollProps: {
|
|
424
432
|
onScroll: (e) => setScrolledX(e.currentTarget.scrollLeft > 0),
|
|
425
433
|
...(scrolledX ? { "data-scrolled-x": "" } : {}),
|
|
426
|
-
}, children: [_jsxs("colgroup", { children: [showGrip && _jsx("col", { style: { width: GRIP_W } }), selectable && _jsx("col", { style: { width: CHECK_W } }), columns.map((col) => (_jsx("col", { style: { width: colWidth(col) } }, col.key)))] }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [showGrip && (_jsx(TableHead, { className: "datatable-col-grip", ...stickyCol(-2) })), selectable && (_jsx(TableHead, { className: "datatable-col-check", ...stickyCol(-1), children: _jsx("span", { className: "datatable-check", children: _jsx(Checkbox, { "aria-label": selectAllLabel, checked: allSelected, indeterminate: someSelected, onChange: toggleAll }) }) })), columns.map((col, i) => {
|
|
434
|
+
}, children: [_jsxs("colgroup", { children: [showGrip && _jsx("col", { style: { width: GRIP_W } }), selectable && _jsx("col", { style: { width: CHECK_W } }), columns.map((col) => (_jsx("col", { style: { width: colWidth(col) } }, col.key)))] }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [showGrip && (_jsx(TableHead, { className: "crisp-datatable-col-grip", ...stickyCol(-2) })), selectable && (_jsx(TableHead, { className: "crisp-datatable-col-check", ...stickyCol(-1), children: _jsx("span", { className: "crisp-datatable-check", children: _jsx(Checkbox, { "aria-label": selectAllLabel, checked: allSelected, indeterminate: someSelected, onChange: toggleAll }) }) })), columns.map((col, i) => {
|
|
427
435
|
const Icon = col.icon;
|
|
428
436
|
// The sort direction was painted (`data-sorted`) and never
|
|
429
437
|
// announced: a screen reader heard the same header before and
|
|
@@ -439,10 +447,10 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
439
447
|
? "ascending"
|
|
440
448
|
: "descending"
|
|
441
449
|
: "none";
|
|
442
|
-
const inner = (_jsxs("span", { className: "datatable-th-inner", children: [Icon ? _jsx(Icon, { size: 14, strokeWidth: 1.75 }) : null, _jsx("span", { className: "datatable-th-label", children: col.header }), col.sortable ? _jsx(ChevronFor, { colKey: col.key }) : null] }));
|
|
450
|
+
const inner = (_jsxs("span", { className: "crisp-datatable-th-inner", children: [Icon ? _jsx(Icon, { size: 14, strokeWidth: 1.75 }) : null, _jsx("span", { className: "crisp-datatable-th-label", children: col.header }), col.sortable ? _jsx(ChevronFor, { colKey: col.key }) : null] }));
|
|
443
451
|
return (_jsxs(TableHead, { align: alignFor(col), "aria-sort": ariaSort, ...stickyCol(i), children: [renaming === col.key ? (_jsx("input", {
|
|
444
452
|
// biome-ignore lint/a11y/noAutofocus: the rename item opens this field
|
|
445
|
-
autoFocus: true, className: "datatable-th-rename", defaultValue: typeof col.header === "string" ? col.header : "", "aria-label": `Rename column`, onBlur: (e) => {
|
|
453
|
+
autoFocus: true, className: "crisp-datatable-th-rename", defaultValue: typeof col.header === "string" ? col.header : "", "aria-label": `Rename column`, onBlur: (e) => {
|
|
446
454
|
renameColumn(col.key, e.currentTarget.value);
|
|
447
455
|
setRenaming(null);
|
|
448
456
|
}, onKeyDown: (e) => {
|
|
@@ -452,10 +460,10 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
452
460
|
}
|
|
453
461
|
else if (e.key === "Escape")
|
|
454
462
|
setRenaming(null);
|
|
455
|
-
} })) : columnMenu ? (_jsxs(Menu, { align: "start", trigger: _jsx("button", { type: "button", className: "datatable-sort", "data-sorted": sortDirByKey.get(col.key), "aria-label": `${typeof col.header === "string"
|
|
463
|
+
} })) : columnMenu ? (_jsxs(Menu, { align: "start", trigger: _jsx("button", { type: "button", className: "crisp-datatable-sort", "data-sorted": sortDirByKey.get(col.key), "aria-label": `${typeof col.header === "string"
|
|
456
464
|
? col.header
|
|
457
|
-
: col.key} column options`, children: inner }), children: [_jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "asc" }), children: "Sort ascending" }), _jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "desc" }), children: "Sort descending" }), col.managed === false ? null : (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onSelect: () => moveColumn(col.key, -1), children: "Move left" }), _jsx(MenuItem, { onSelect: () => moveColumn(col.key, 1), children: "Move right" }), _jsx(MenuItem, { onSelect: () => setRenaming(col.key), children: "Edit column label" }), _jsx(MenuItem, { onSelect: () => hideColumn(col.key), children: "Hide from view" })] }))] })) : col.sortable ? (_jsx("button", { type: "button", className: "datatable-sort", "data-sorted": sortDirByKey.get(col.key), onClick: () => cycleSort(col.key), children: inner })) : (inner), col.resizable !== false && (_jsx("span", { className: "datatable-resize", "data-resizing": resizingKey === col.key ? "" : undefined, onPointerDown: (e) => startResize(col, e), onPointerMove: moveResize, onPointerUp: endResize }))] }, col.key));
|
|
458
|
-
})] }) }), _jsx(TableBody, { children: error ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "datatable-empty", children: error }) }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "datatable-empty", children: empty }) }) })) : (groupedRows.map(({ group, rows: groupRows }) => (_jsxs(React.Fragment, { children: [group !== null && (_jsx(TableRow, { children: _jsxs(TableCell, { colSpan: totalCols, className: "datatable-group", children: [_jsx("span", { className: "datatable-group-label", children: group }), _jsx("span", { className: "datatable-group-count", children: groupRows.length })] }) })), groupRows.map((row) => (_jsxs(TableRow, { "data-selected": selected.has(row.id) ? "" : undefined, "data-drop-target": showGrip &&
|
|
465
|
+
: col.key} column options`, children: inner }), children: [_jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "asc" }), children: "Sort ascending" }), _jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "desc" }), children: "Sort descending" }), col.managed === false ? null : (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onSelect: () => moveColumn(col.key, -1), children: "Move left" }), _jsx(MenuItem, { onSelect: () => moveColumn(col.key, 1), children: "Move right" }), _jsx(MenuItem, { onSelect: () => setRenaming(col.key), children: "Edit column label" }), _jsx(MenuItem, { onSelect: () => hideColumn(col.key), children: "Hide from view" })] }))] })) : col.sortable ? (_jsx("button", { type: "button", className: "crisp-datatable-sort", "data-sorted": sortDirByKey.get(col.key), onClick: () => cycleSort(col.key), children: inner })) : (inner), col.resizable !== false && (_jsx("span", { className: "crisp-datatable-resize", "data-resizing": resizingKey === col.key ? "" : undefined, onPointerDown: (e) => startResize(col, e), onPointerMove: moveResize, onPointerUp: endResize }))] }, col.key));
|
|
466
|
+
})] }) }), _jsx(TableBody, { children: error ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "crisp-datatable-empty", children: error }) }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "crisp-datatable-empty", children: empty }) }) })) : (groupedRows.map(({ group, rows: groupRows }) => (_jsxs(React.Fragment, { children: [group !== null && (_jsx(TableRow, { children: _jsxs(TableCell, { colSpan: totalCols, className: "crisp-datatable-group", children: [_jsx("span", { className: "crisp-datatable-group-label", children: group }), _jsx("span", { className: "crisp-datatable-group-count", children: groupRows.length })] }) })), groupRows.map((row) => (_jsxs(TableRow, { "data-selected": selected.has(row.id) ? "" : undefined, "data-drop-target": showGrip &&
|
|
459
467
|
dragRowId &&
|
|
460
468
|
dragRowId !== row.id &&
|
|
461
469
|
dropRowId === row.id
|
|
@@ -471,18 +479,18 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
471
479
|
e.preventDefault();
|
|
472
480
|
reorderRows(dragRowId, row.id);
|
|
473
481
|
}
|
|
474
|
-
: undefined, children: [showGrip && (_jsx(TableCell, { className: "datatable-col-grip", ...stickyCol(-2), onClick: (e) => e.stopPropagation(), children: _jsx("button", { type: "button", className: "datatable-grip", "aria-label": reorderRowLabel, draggable: true, onDragStart: (e) => {
|
|
482
|
+
: undefined, children: [showGrip && (_jsx(TableCell, { className: "crisp-datatable-col-grip", ...stickyCol(-2), onClick: (e) => e.stopPropagation(), children: _jsx("button", { type: "button", className: "crisp-datatable-grip", "aria-label": reorderRowLabel, draggable: true, onDragStart: (e) => {
|
|
475
483
|
setDragRowId(row.id);
|
|
476
484
|
e.dataTransfer.effectAllowed = "move";
|
|
477
485
|
}, onDragEnd: () => {
|
|
478
486
|
setDragRowId(null);
|
|
479
487
|
setDropRowId(null);
|
|
480
|
-
}, children: _jsx(GripVertical, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) }) })), selectable && (_jsx(TableCell, { className: "datatable-col-check", ...stickyCol(-1), onClick: (e) => e.stopPropagation(), children: _jsx("span", { className: "datatable-check", children: _jsx(Checkbox, { "aria-label": selectRowLabel(row), checked: selected.has(row.id), onChange: () => toggleRow(row.id) }) }) })), columns.map((col, i) => {
|
|
488
|
+
}, children: _jsx(GripVertical, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) }) })), selectable && (_jsx(TableCell, { className: "crisp-datatable-col-check", ...stickyCol(-1), onClick: (e) => e.stopPropagation(), children: _jsx("span", { className: "crisp-datatable-check", children: _jsx(Checkbox, { "aria-label": selectRowLabel(row), checked: selected.has(row.id), onChange: () => toggleRow(row.id) }) }) })), columns.map((col, i) => {
|
|
481
489
|
const isEditing = editing?.id === row.id && editing?.key === col.key;
|
|
482
490
|
const value = cellValue(col, row);
|
|
483
491
|
const sticky = stickyCol(i);
|
|
484
492
|
if (isEditing) {
|
|
485
|
-
return (_jsx(TableCell, { align: alignFor(col), ...sticky, onClick: (e) => e.stopPropagation(), children: _jsx("input", { className: "datatable-edit",
|
|
493
|
+
return (_jsx(TableCell, { align: alignFor(col), ...sticky, onClick: (e) => e.stopPropagation(), children: _jsx("input", { className: "crisp-datatable-edit",
|
|
486
494
|
// biome-ignore lint/a11y/noAutofocus: focus the field the moment it opens
|
|
487
495
|
autoFocus: true, ...editorFor(col), "data-editor": editorFor(col).type, defaultValue: col.type === "date"
|
|
488
496
|
? toDateInputValue(value)
|
|
@@ -493,7 +501,9 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
493
501
|
setEditing(null);
|
|
494
502
|
}, onBlur: (e) => commitEdit(row.id, col.key, e.currentTarget.value) }) }, col.key));
|
|
495
503
|
}
|
|
496
|
-
return (_jsx(TableCell, { align: alignFor(col), ...sticky, className: col.editable
|
|
504
|
+
return (_jsx(TableCell, { align: alignFor(col), ...sticky, className: col.editable
|
|
505
|
+
? "crisp-datatable-editable"
|
|
506
|
+
: undefined, "data-selected": selCell?.id === row.id && selCell?.key === col.key
|
|
497
507
|
? ""
|
|
498
508
|
: undefined, onClick: (e) => {
|
|
499
509
|
// the keyboard model's anchor; also opens the
|
|
@@ -511,6 +521,6 @@ export function DataTable({ columns: columnsProp, data, selectable = false, sele
|
|
|
511
521
|
}, children: col.render
|
|
512
522
|
? col.render(value, row)
|
|
513
523
|
: renderTyped(col, value, avatarTone, col.format?.(value, row)) }, col.key));
|
|
514
|
-
})] }, row.id)))] }, group ?? "__ungrouped")))) }), (hasSummary || onAddRow) && (_jsxs(TableFooter, { children: [hasSummary && (_jsxs(TableRow, { children: [showGrip && _jsx(TableCell, { ...stickyCol(-2) }), selectable && _jsx(TableCell, { ...stickyCol(-1) }), columns.map((col, i) => (_jsx(TableCell, { align: alignFor(col), ...stickyCol(i), children: col.summary ? col.summary(rows) : null }, col.key)))] })), onAddRow && (_jsx(TableRow, { children: _jsx(TableCell, { className: "datatable-addcell", colSpan: totalCols, children: _jsxs("button", { type: "button", className: "datatable-addrow", onClick: onAddRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), addRowLabel] }) }) }))] }))] })] }));
|
|
524
|
+
})] }, row.id)))] }, group ?? "__ungrouped")))) }), (hasSummary || onAddRow) && (_jsxs(TableFooter, { children: [hasSummary && (_jsxs(TableRow, { children: [showGrip && _jsx(TableCell, { ...stickyCol(-2) }), selectable && _jsx(TableCell, { ...stickyCol(-1) }), columns.map((col, i) => (_jsx(TableCell, { align: alignFor(col), ...stickyCol(i), children: col.summary ? col.summary(rows) : null }, col.key)))] })), onAddRow && (_jsx(TableRow, { children: _jsx(TableCell, { className: "crisp-datatable-addcell", colSpan: totalCols, children: _jsxs("button", { type: "button", className: "crisp-datatable-addrow", onClick: onAddRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), addRowLabel] }) }) }))] }))] })] }));
|
|
515
525
|
}
|
|
516
526
|
DataTable.displayName = "DataTable";
|
|
@@ -7,13 +7,13 @@ import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
|
7
7
|
const config = defineRecipe({
|
|
8
8
|
name: "datatable",
|
|
9
9
|
base: `display: flex; flex-direction: column; gap: ${c.space["2.5"]}; font-family: ${c.font.sans};
|
|
10
|
-
& .datatable-toolbar { display: flex; align-items: center; gap: ${c.space["2"]}; }
|
|
11
|
-
& .datatable-search { position: relative; flex: 1; max-width: 280px; display: inline-flex; align-items: center; }
|
|
12
|
-
& .datatable-search svg { position: absolute; inset-inline-start: ${c.space["2"]}; color: ${c.fgMuted}; pointer-events: none; }
|
|
13
|
-
& .datatable-search input { width: 100%; height: 32px; padding: 0 ${c.space["2"]} 0 ${c.space["6"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; transition: box-shadow .15s; }
|
|
14
|
-
& .datatable-search input::placeholder { color: ${c.fgMuted}; }
|
|
15
|
-
& .datatable-search input:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
16
|
-
& .datatable-count { margin-inline-start: auto; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
10
|
+
& .crisp-datatable-toolbar { display: flex; align-items: center; gap: ${c.space["2"]}; }
|
|
11
|
+
& .crisp-datatable-search { position: relative; flex: 1; max-width: 280px; display: inline-flex; align-items: center; }
|
|
12
|
+
& .crisp-datatable-search svg { position: absolute; inset-inline-start: ${c.space["2"]}; color: ${c.fgMuted}; pointer-events: none; }
|
|
13
|
+
& .crisp-datatable-search input { width: 100%; height: 32px; padding: 0 ${c.space["2"]} 0 ${c.space["6"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; transition: box-shadow .15s; }
|
|
14
|
+
& .crisp-datatable-search input::placeholder { color: ${c.fgMuted}; }
|
|
15
|
+
& .crisp-datatable-search input:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
16
|
+
& .crisp-datatable-count { margin-inline-start: auto; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
17
17
|
/* The header cell has no padding of its own -- the button owns the
|
|
18
18
|
full cell so the whole header is clickable (its own inset is 12px).
|
|
19
19
|
Mirrors the summary-row fix. */
|
|
@@ -25,71 +25,71 @@ const config = defineRecipe({
|
|
|
25
25
|
-sized box to truncate against, and the th's own overflow hard-clipped
|
|
26
26
|
it with no "...". Fill the wrapper, scoped to th so Menu's default
|
|
27
27
|
(correct everywhere else) is untouched. */
|
|
28
|
-
& th .menu { width: 100%; height: 100%; }
|
|
29
|
-
& .datatable-th-inner { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; }
|
|
30
|
-
& .datatable-th-inner > svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
28
|
+
& th .crisp-menu { width: 100%; height: 100%; }
|
|
29
|
+
& .crisp-datatable-th-inner { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; }
|
|
30
|
+
& .crisp-datatable-th-inner > svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
31
31
|
/* The summary cell has NO padding of its own -- the calculation trigger
|
|
32
32
|
owns the whole 246x37 area so a click anywhere in the cell opens the
|
|
33
33
|
menu. Zero the cell's inset and let ColumnCalc supply the 12px. */
|
|
34
34
|
& tfoot td { padding: 0; }
|
|
35
35
|
/* Group heading row -- a view is grouped under a subtle label with the
|
|
36
36
|
bucket's count beside it. */
|
|
37
|
-
& .datatable-viewsettings { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
38
|
-
& .datatable-viewsettings:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
39
|
-
& .datatable-group-label { padding: ${c.space["1.5"]} ${c.space["2"]} ${c.space["1"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
40
|
-
& .datatable-group { height: ${c.size.menuRow}; padding: 0 ${c.space["3"]}; background: ${c.bgSubtle}; border-bottom: 1px solid ${c.borderSubtle}; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); }
|
|
41
|
-
& .datatable-group-count { margin-inline-start: ${c.space["1.5"]}; color: ${c.fgMuted}; font-variant-numeric: tabular-nums; }
|
|
42
|
-
& .datatable-th-rename { width: 100%; min-width: 0; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["1"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; color: ${c.fgPrimary}; outline: none; }
|
|
43
|
-
& .datatable-th-rename:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
44
|
-
& .datatable-th-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
45
|
-
& .datatable-sort { display: flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: start; cursor: pointer; }
|
|
46
|
-
& th[data-align="right"] .datatable-sort { justify-content: flex-end; }
|
|
47
|
-
& .datatable-chevron { margin-inline-start: auto; flex-shrink: 0; color: ${c.fgMuted}; opacity: 0; transition: opacity .12s; }
|
|
48
|
-
& th[data-align="right"] .datatable-chevron { margin-inline-start: 0; }
|
|
49
|
-
& .datatable-sort:hover .datatable-chevron { opacity: 0.6; }
|
|
50
|
-
& .datatable-sort[data-sorted] .datatable-chevron { opacity: 1; color: ${c.fgPrimary}; }
|
|
37
|
+
& .crisp-datatable-viewsettings { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
38
|
+
& .crisp-datatable-viewsettings:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
39
|
+
& .crisp-datatable-group-label { padding: ${c.space["1.5"]} ${c.space["2"]} ${c.space["1"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
40
|
+
& .crisp-datatable-group { height: ${c.size.menuRow}; padding: 0 ${c.space["3"]}; background: ${c.bgSubtle}; border-bottom: 1px solid ${c.borderSubtle}; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); }
|
|
41
|
+
& .crisp-datatable-group-count { margin-inline-start: ${c.space["1.5"]}; color: ${c.fgMuted}; font-variant-numeric: tabular-nums; }
|
|
42
|
+
& .crisp-datatable-th-rename { width: 100%; min-width: 0; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["1"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; color: ${c.fgPrimary}; outline: none; }
|
|
43
|
+
& .crisp-datatable-th-rename:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
44
|
+
& .crisp-datatable-th-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
45
|
+
& .crisp-datatable-sort { display: flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: start; cursor: pointer; }
|
|
46
|
+
& th[data-align="right"] .crisp-datatable-sort { justify-content: flex-end; }
|
|
47
|
+
& .crisp-datatable-chevron { margin-inline-start: auto; flex-shrink: 0; color: ${c.fgMuted}; opacity: 0; transition: opacity .12s; }
|
|
48
|
+
& th[data-align="right"] .crisp-datatable-chevron { margin-inline-start: 0; }
|
|
49
|
+
& .crisp-datatable-sort:hover .crisp-datatable-chevron { opacity: 0.6; }
|
|
50
|
+
& .crisp-datatable-sort[data-sorted] .crisp-datatable-chevron { opacity: 1; color: ${c.fgPrimary}; }
|
|
51
51
|
/* sticky first column(s) + horizontal scroll shadow — RecordsTable's feel */
|
|
52
52
|
& th[data-sticky], & td[data-sticky] { position: sticky; z-index: 1; background: ${c.bgSurface}; }
|
|
53
53
|
& th[data-sticky] { z-index: 3; }
|
|
54
54
|
& tbody tr[data-selected] td[data-sticky] { background: color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface}); }
|
|
55
55
|
& tbody tr:hover td[data-sticky] { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); }
|
|
56
|
-
& .table-scroll[data-scrolled-x] [data-sticky-edge] { clip-path: inset(0 -38px 0 0); box-shadow: 6px 0 16px 4px rgba(0,0,0,0.12); }
|
|
56
|
+
& .crisp-table-scroll[data-scrolled-x] [data-sticky-edge] { clip-path: inset(0 -38px 0 0); box-shadow: 6px 0 16px 4px rgba(0,0,0,0.12); }
|
|
57
57
|
/* add-row + summary footer */
|
|
58
|
-
& .datatable-addcell { padding: 0; border-top: none; }
|
|
59
|
-
& .datatable-addrow { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border: none; border-top: 1px solid ${c.borderSubtle}; background: ${c.bgSurface}; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.lg}; cursor: pointer; transition: background-color .12s; }
|
|
60
|
-
& .datatable-addrow:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
61
|
-
& .datatable-addrow svg { flex-shrink: 0; }
|
|
62
|
-
& .datatable-check { display: flex; align-items: center; justify-content: center; }
|
|
63
|
-
& .datatable-col-check { width: 40px; padding: 0; text-align: center; }
|
|
58
|
+
& .crisp-datatable-addcell { padding: 0; border-top: none; }
|
|
59
|
+
& .crisp-datatable-addrow { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border: none; border-top: 1px solid ${c.borderSubtle}; background: ${c.bgSurface}; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.lg}; cursor: pointer; transition: background-color .12s; }
|
|
60
|
+
& .crisp-datatable-addrow:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
61
|
+
& .crisp-datatable-addrow svg { flex-shrink: 0; }
|
|
62
|
+
& .crisp-datatable-check { display: flex; align-items: center; justify-content: center; }
|
|
63
|
+
& .crisp-datatable-col-check { width: 40px; padding: 0; text-align: center; }
|
|
64
64
|
& tbody tr[data-selected] td { background: color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface}); }
|
|
65
65
|
& tbody tr[data-selected]:hover td { background: color-mix(in srgb, ${c.fgPrimary} 4%, color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface})); }
|
|
66
|
-
& .datatable-editable:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); cursor: text; }
|
|
67
|
-
& .datatable-edit { width: 100%; height: 28px; margin: 0; padding: 0 ${c.space["1.5"]}; border: none; border-radius: ${c.radius.sm}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; vertical-align: middle; }
|
|
68
|
-
& .datatable-edit:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
69
|
-
& .datatable-empty { padding: ${c.space["8"]} ${c.space["3"]}; text-align: center; color: ${c.fgMuted}; font-size: ${c.text.lg}; }
|
|
66
|
+
& .crisp-datatable-editable:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); cursor: text; }
|
|
67
|
+
& .crisp-datatable-edit { width: 100%; height: 28px; margin: 0; padding: 0 ${c.space["1.5"]}; border: none; border-radius: ${c.radius.sm}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; vertical-align: middle; }
|
|
68
|
+
& .crisp-datatable-edit:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
|
|
69
|
+
& .crisp-datatable-empty { padding: ${c.space["8"]} ${c.space["3"]}; text-align: center; color: ${c.fgMuted}; font-size: ${c.text.lg}; }
|
|
70
70
|
/* fixed layout so column widths (and resize) are exact — like RecordsTable */
|
|
71
71
|
& table { table-layout: fixed; }
|
|
72
72
|
/* column resize grip */
|
|
73
|
-
& .datatable-resize { position: absolute; top: 0; inset-inline-end: -3px; width: 9px; height: 100%; cursor: col-resize; z-index: 6; touch-action: none; }
|
|
74
|
-
& .datatable-resize::after { content: ""; position: absolute; top: 0; inset-inline-start: 3px; width: 2px; height: 100%; background: ${c.bgBrandSolid}; opacity: 0; transition: opacity .12s; }
|
|
75
|
-
& .datatable-resize:hover::after, & .datatable-resize[data-resizing]::after { opacity: 1; }
|
|
73
|
+
& .crisp-datatable-resize { position: absolute; top: 0; inset-inline-end: -3px; width: 9px; height: 100%; cursor: col-resize; z-index: 6; touch-action: none; }
|
|
74
|
+
& .crisp-datatable-resize::after { content: ""; position: absolute; top: 0; inset-inline-start: 3px; width: 2px; height: 100%; background: ${c.bgBrandSolid}; opacity: 0; transition: opacity .12s; }
|
|
75
|
+
& .crisp-datatable-resize:hover::after, & .crisp-datatable-resize[data-resizing]::after { opacity: 1; }
|
|
76
76
|
/* typed cells — entity (avatar + name), colour-coded tags, numbers, dates */
|
|
77
|
-
& .datatable-entity { display: flex; align-items: center; gap: ${c.space["1.5"]}; min-width: 0; color: ${c.fgPrimary}; font-weight: ${c.weight.medium}; }
|
|
78
|
-
& .datatable-entity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
79
|
-
& .datatable-avatar { width: ${c.size.icon}; height: ${c.size.icon}; border-radius: ${c.radius.sm}; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; font-weight: ${c.weight.semibold}; text-transform: uppercase; color: ${c.fgOnBrand}; background: ${c.bgBrandSolid}; }
|
|
80
|
-
& .datatable-avatar[data-tone="success"] { background: ${c.bgSuccess}; } & .datatable-avatar[data-tone="warning"] { background: ${c.bgWarning}; } & .datatable-avatar[data-tone="danger"] { background: ${c.bgDanger}; } & .datatable-avatar[data-tone="purple"] { background: ${c.bgPurple}; } & .datatable-avatar[data-tone="cyan"] { background: ${c.bgCyan}; } & .datatable-avatar[data-tone="orange"] { background: ${c.bgOrange}; }
|
|
81
|
-
& .datatable-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
|
|
82
|
-
& .datatable-tags { display: flex; align-items: center; gap: ${c.space["1"]}; overflow: hidden; }
|
|
83
|
-
& .datatable-tag { display: inline-flex; align-items: center; height: ${c.size.chip}; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.chip}; font-size: ${c.text.lg}; line-height: 20px; font-weight: ${c.weight.medium}; white-space: nowrap; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: color-mix(in srgb, ${c.fgPrimary} 82%, transparent); }
|
|
84
|
-
& .datatable-tag[data-tone="brand"] { background: color-mix(in srgb, ${c.bgBrandSolid} 14%, transparent); color: color-mix(in srgb, ${c.bgBrandSolid} 82%, ${c.fgPrimary}); }
|
|
85
|
-
& .datatable-tag[data-tone="success"] { background: color-mix(in srgb, ${c.bgSuccess} 16%, transparent); color: color-mix(in srgb, ${c.bgSuccess} 78%, ${c.fgPrimary}); }
|
|
86
|
-
& .datatable-tag[data-tone="warning"] { background: color-mix(in srgb, ${c.bgWarning} 18%, transparent); color: color-mix(in srgb, ${c.bgWarning} 82%, ${c.fgPrimary}); }
|
|
87
|
-
& .datatable-tag[data-tone="danger"] { background: color-mix(in srgb, ${c.bgDanger} 15%, transparent); color: color-mix(in srgb, ${c.bgDanger} 80%, ${c.fgPrimary}); }
|
|
88
|
-
& .datatable-tag[data-tone="purple"] { background: color-mix(in srgb, ${c.bgPurple} 16%, transparent); color: color-mix(in srgb, ${c.bgPurple} 80%, ${c.fgPrimary}); }
|
|
89
|
-
& .datatable-tag[data-tone="cyan"] { background: color-mix(in srgb, ${c.bgCyan} 18%, transparent); color: color-mix(in srgb, ${c.bgCyan} 82%, ${c.fgPrimary}); }
|
|
90
|
-
& .datatable-tag[data-tone="orange"] { background: color-mix(in srgb, ${c.bgOrange} 16%, transparent); color: color-mix(in srgb, ${c.bgOrange} 82%, ${c.fgPrimary}); }
|
|
91
|
-
& .datatable-num { font-variant-numeric: tabular-nums; }
|
|
92
|
-
& .datatable-muted { color: ${c.fgMuted}; }
|
|
77
|
+
& .crisp-datatable-entity { display: flex; align-items: center; gap: ${c.space["1.5"]}; min-width: 0; color: ${c.fgPrimary}; font-weight: ${c.weight.medium}; }
|
|
78
|
+
& .crisp-datatable-entity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
79
|
+
& .crisp-datatable-avatar { width: ${c.size.icon}; height: ${c.size.icon}; border-radius: ${c.radius.sm}; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; font-weight: ${c.weight.semibold}; text-transform: uppercase; color: ${c.fgOnBrand}; background: ${c.bgBrandSolid}; }
|
|
80
|
+
& .crisp-datatable-avatar[data-tone="success"] { background: ${c.bgSuccess}; } & .crisp-datatable-avatar[data-tone="warning"] { background: ${c.bgWarning}; } & .crisp-datatable-avatar[data-tone="danger"] { background: ${c.bgDanger}; } & .crisp-datatable-avatar[data-tone="purple"] { background: ${c.bgPurple}; } & .crisp-datatable-avatar[data-tone="cyan"] { background: ${c.bgCyan}; } & .crisp-datatable-avatar[data-tone="orange"] { background: ${c.bgOrange}; }
|
|
81
|
+
& .crisp-datatable-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
|
|
82
|
+
& .crisp-datatable-tags { display: flex; align-items: center; gap: ${c.space["1"]}; overflow: hidden; }
|
|
83
|
+
& .crisp-datatable-tag { display: inline-flex; align-items: center; height: ${c.size.chip}; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.chip}; font-size: ${c.text.lg}; line-height: 20px; font-weight: ${c.weight.medium}; white-space: nowrap; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: color-mix(in srgb, ${c.fgPrimary} 82%, transparent); }
|
|
84
|
+
& .crisp-datatable-tag[data-tone="brand"] { background: color-mix(in srgb, ${c.bgBrandSolid} 14%, transparent); color: color-mix(in srgb, ${c.bgBrandSolid} 82%, ${c.fgPrimary}); }
|
|
85
|
+
& .crisp-datatable-tag[data-tone="success"] { background: color-mix(in srgb, ${c.bgSuccess} 16%, transparent); color: color-mix(in srgb, ${c.bgSuccess} 78%, ${c.fgPrimary}); }
|
|
86
|
+
& .crisp-datatable-tag[data-tone="warning"] { background: color-mix(in srgb, ${c.bgWarning} 18%, transparent); color: color-mix(in srgb, ${c.bgWarning} 82%, ${c.fgPrimary}); }
|
|
87
|
+
& .crisp-datatable-tag[data-tone="danger"] { background: color-mix(in srgb, ${c.bgDanger} 15%, transparent); color: color-mix(in srgb, ${c.bgDanger} 80%, ${c.fgPrimary}); }
|
|
88
|
+
& .crisp-datatable-tag[data-tone="purple"] { background: color-mix(in srgb, ${c.bgPurple} 16%, transparent); color: color-mix(in srgb, ${c.bgPurple} 80%, ${c.fgPrimary}); }
|
|
89
|
+
& .crisp-datatable-tag[data-tone="cyan"] { background: color-mix(in srgb, ${c.bgCyan} 18%, transparent); color: color-mix(in srgb, ${c.bgCyan} 82%, ${c.fgPrimary}); }
|
|
90
|
+
& .crisp-datatable-tag[data-tone="orange"] { background: color-mix(in srgb, ${c.bgOrange} 16%, transparent); color: color-mix(in srgb, ${c.bgOrange} 82%, ${c.fgPrimary}); }
|
|
91
|
+
& .crisp-datatable-num { font-variant-numeric: tabular-nums; }
|
|
92
|
+
& .crisp-datatable-muted { color: ${c.fgMuted}; }
|
|
93
93
|
/* row drag-to-reorder -- a Settings > Objects > Attributes screen measures
|
|
94
94
|
a leading 20px grip column, a 16px grip icon, and the row's own
|
|
95
95
|
hairline doubling as the drop indicator (it tints toward the brand
|
|
@@ -98,9 +98,9 @@ const config = defineRecipe({
|
|
|
98
98
|
draggable + dataTransfer, the same one column reorder already uses
|
|
99
99
|
(RecordsTable's reorderColumn) -- not a proprietary
|
|
100
100
|
pointer-events implementation. */
|
|
101
|
-
& .datatable-col-grip { width: 20px; padding: 0; text-align: center; }
|
|
102
|
-
& .datatable-grip { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; border: none; border-radius: 0; background: none; font-family: inherit; color: ${c.fgMuted}; cursor: grab; }
|
|
103
|
-
& .datatable-grip:active { cursor: grabbing; }
|
|
101
|
+
& .crisp-datatable-col-grip { width: 20px; padding: 0; text-align: center; }
|
|
102
|
+
& .crisp-datatable-grip { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; border: none; border-radius: 0; background: none; font-family: inherit; color: ${c.fgMuted}; cursor: grab; }
|
|
103
|
+
& .crisp-datatable-grip:active { cursor: grabbing; }
|
|
104
104
|
& tbody tr[data-drop-target] td, & tbody tr[data-drop-target] th { box-shadow: inset 0 2px 0 0 ${c.bgBrandSolid}; transition: box-shadow .12s; }`,
|
|
105
105
|
variants: {},
|
|
106
106
|
defaultVariants: {},
|
|
@@ -6,15 +6,15 @@ import * as React from "react";
|
|
|
6
6
|
import { WheelPicker } from "../wheelpicker/index.js";
|
|
7
7
|
import { datepickerRecipe } from "./datepicker.recipe.js";
|
|
8
8
|
function WeekdayRow({ api, semantic = true, }) {
|
|
9
|
-
return (_jsx("div", { role: semantic ? "row" : undefined, "aria-hidden": semantic ? undefined : true, className: "datepicker-weekday-row", children: api.weekdayLabels.map((weekday) => (_jsx("div", { role: semantic ? "columnheader" : undefined, "aria-label": semantic ? weekday.long : undefined, className: "datepicker-weekday", children: _jsx("span", { "aria-hidden": "true", children: weekday.short }) }, weekday.key))) }));
|
|
9
|
+
return (_jsx("div", { role: semantic ? "row" : undefined, "aria-hidden": semantic ? undefined : true, className: "crisp-datepicker-weekday-row", children: api.weekdayLabels.map((weekday) => (_jsx("div", { role: semantic ? "columnheader" : undefined, "aria-label": semantic ? weekday.long : undefined, className: "crisp-datepicker-weekday", children: _jsx("span", { "aria-hidden": "true", children: weekday.short }) }, weekday.key))) }));
|
|
10
10
|
}
|
|
11
11
|
function DateCellView({ cell, renderDateCellContent, renderDateCellSupplement, }) {
|
|
12
12
|
// a leading/trailing blank in the grid: still a gridcell, so the row keeps
|
|
13
13
|
// seven columns for a screen reader, but nothing to press
|
|
14
14
|
if (cell === null)
|
|
15
|
-
return (_jsx("div", { role: "gridcell", className: "datepicker-empty-cell" }));
|
|
15
|
+
return (_jsx("div", { role: "gridcell", className: "crisp-datepicker-empty-cell" }));
|
|
16
16
|
const { cellProps, buttonProps, key: _key, ...renderProps } = cell;
|
|
17
|
-
return (_jsx("div", { ...cellProps, className: "datepicker-cell", children: _jsx("button", { ...buttonProps, type: "button", className: "datepicker-date", children: _jsx("span", { className: "datepicker-date-content", children: renderDateCellContent ? (renderDateCellContent(renderProps)) : (_jsxs(_Fragment, { children: [_jsx("span", { "data-date-picker-day": "", children: cell.formattedDay }), renderDateCellSupplement?.(renderProps)] })) }) }) }));
|
|
17
|
+
return (_jsx("div", { ...cellProps, className: "crisp-datepicker-cell", children: _jsx("button", { ...buttonProps, type: "button", className: "crisp-datepicker-date", children: _jsx("span", { className: "crisp-datepicker-date-content", children: renderDateCellContent ? (renderDateCellContent(renderProps)) : (_jsxs(_Fragment, { children: [_jsx("span", { "data-date-picker-day": "", children: cell.formattedDay }), renderDateCellSupplement?.(renderProps)] })) }) }) }));
|
|
18
18
|
}
|
|
19
19
|
function NavigationButton({ direction, className, ...props }) {
|
|
20
20
|
const Icon = direction === "left" ? ChevronLeft : ChevronRight;
|
|
@@ -24,9 +24,9 @@ function Header({ api }) {
|
|
|
24
24
|
// in RTL the chevrons swap: "previous" is on the right
|
|
25
25
|
const previousDirection = api.isRtl ? "right" : "left";
|
|
26
26
|
const nextDirection = api.isRtl ? "left" : "right";
|
|
27
|
-
return (_jsxs("div", { className: "datepicker-header", children: [_jsxs("button", { ...api.monthYearButtonProps, "aria-controls": api.isWheelOpen
|
|
27
|
+
return (_jsxs("div", { className: "crisp-datepicker-header", children: [_jsxs("button", { ...api.monthYearButtonProps, "aria-controls": api.isWheelOpen
|
|
28
28
|
? api.monthYearButtonProps["aria-controls"]
|
|
29
|
-
: undefined, type: "button", id: `${api.rootProps.id}-header-label`, className: "datepicker-header-label", children: [_jsx("span", { "data-date-picker-header-label": "", children: api.headerLabel }), _jsx("span", { className: "datepicker-header-chevron", "data-open": api.isWheelOpen ? "" : undefined, children: _jsx(ChevronDown, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) })] }), _jsxs("div", { className: "datepicker-nav", children: [_jsx(NavigationButton, { ...api.previousButtonProps, direction: previousDirection, className: "datepicker-nav-button" }), _jsx(NavigationButton, { ...api.nextButtonProps, direction: nextDirection, className: "datepicker-nav-button" })] })] }));
|
|
29
|
+
: undefined, type: "button", id: `${api.rootProps.id}-header-label`, className: "crisp-datepicker-header-label", children: [_jsx("span", { "data-date-picker-header-label": "", children: api.headerLabel }), _jsx("span", { className: "crisp-datepicker-header-chevron", "data-open": api.isWheelOpen ? "" : undefined, children: _jsx(ChevronDown, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) })] }), _jsxs("div", { className: "crisp-datepicker-nav", children: [_jsx(NavigationButton, { ...api.previousButtonProps, direction: previousDirection, className: "crisp-datepicker-nav-button" }), _jsx(NavigationButton, { ...api.nextButtonProps, direction: nextDirection, className: "crisp-datepicker-nav-button" })] })] }));
|
|
30
30
|
}
|
|
31
31
|
function TwoMonthHeader({ api, label, labelId, position, }) {
|
|
32
32
|
const isFirst = position === "first";
|
|
@@ -37,19 +37,19 @@ function TwoMonthHeader({ api, label, labelId, position, }) {
|
|
|
37
37
|
: isFirst
|
|
38
38
|
? "left"
|
|
39
39
|
: "right";
|
|
40
|
-
return (_jsxs("div", { className: "datepicker-two-month-header", children: [_jsx("div", { id: labelId, className: "datepicker-two-month-label", children: label }), _jsx(NavigationButton, { ...(isFirst ? api.previousButtonProps : api.nextButtonProps), direction: direction, "data-placement": isFirst ? "start" : "end", className: "datepicker-nav-button" })] }));
|
|
40
|
+
return (_jsxs("div", { className: "crisp-datepicker-two-month-header", children: [_jsx("div", { id: labelId, className: "crisp-datepicker-two-month-label", children: label }), _jsx(NavigationButton, { ...(isFirst ? api.previousButtonProps : api.nextButtonProps), direction: direction, "data-placement": isFirst ? "start" : "end", className: "crisp-datepicker-nav-button" })] }));
|
|
41
41
|
}
|
|
42
42
|
function MonthView({ api, month, renderDateCellContent, renderDateCellSupplement, showWeekdays, showMonthLabel, renderHeader, monthRef, }) {
|
|
43
43
|
const labelId = `${api.rootProps.id}-${month.key}-label`;
|
|
44
44
|
const headerLabelId = `${api.rootProps.id}-header-label`;
|
|
45
|
-
return (_jsxs("div", { ref: monthRef, className: "datepicker-month", children: [renderHeader?.(labelId), showMonthLabel ? (_jsx("div", { id: labelId, className: "datepicker-month-label", children: month.label })) : (_jsx("span", { id: labelId, className: "datepicker-live-region", children: month.label })), _jsxs("div", { ...api.gridProps, "aria-labelledby": showMonthLabel || renderHeader
|
|
45
|
+
return (_jsxs("div", { ref: monthRef, className: "crisp-datepicker-month", children: [renderHeader?.(labelId), showMonthLabel ? (_jsx("div", { id: labelId, className: "crisp-datepicker-month-label", children: month.label })) : (_jsx("span", { id: labelId, className: "crisp-datepicker-live-region", children: month.label })), _jsxs("div", { ...api.gridProps, "aria-labelledby": showMonthLabel || renderHeader
|
|
46
46
|
? labelId
|
|
47
47
|
: api.visibleRange === "month"
|
|
48
48
|
? headerLabelId
|
|
49
|
-
: labelId, className: "datepicker-grid", children: [showWeekdays && _jsx(WeekdayRow, { api: api }), month.weeks.map((week) => (_jsx("div", { role: "row", className: "datepicker-week-row", children: week.cells.map((cell, index) => (_jsx(DateCellView, { cell: cell, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement }, cell?.key ?? `${week.key}-empty-${index}`))) }, week.key)))] })] }));
|
|
49
|
+
: labelId, className: "crisp-datepicker-grid", children: [showWeekdays && _jsx(WeekdayRow, { api: api }), month.weeks.map((week) => (_jsx("div", { role: "row", className: "crisp-datepicker-week-row", children: week.cells.map((cell, index) => (_jsx(DateCellView, { cell: cell, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement }, cell?.key ?? `${week.key}-empty-${index}`))) }, week.key)))] })] }));
|
|
50
50
|
}
|
|
51
51
|
function WheelView({ api }) {
|
|
52
|
-
return (_jsx("div", { ...api.wheelProps, className: "datepicker-wheel-container", children: _jsx(WheelPicker, { className: "datepicker-wheel", "aria-label": api.headerLabel, columns: [
|
|
52
|
+
return (_jsx("div", { ...api.wheelProps, className: "crisp-datepicker-wheel-container", children: _jsx(WheelPicker, { className: "crisp-datepicker-wheel", "aria-label": api.headerLabel, columns: [
|
|
53
53
|
{
|
|
54
54
|
key: "year",
|
|
55
55
|
label: api.ariaLabels.yearWheel,
|
|
@@ -90,13 +90,13 @@ const DatePickerImplementation = React.forwardRef((props, forwardedRef) => {
|
|
|
90
90
|
}, ...mergeProps(api.rootProps, rootProps), "aria-label": rootAriaLabel, "aria-labelledby": ariaLabelledby, className: datepickerRecipe({
|
|
91
91
|
visibleRange: api.visibleRange,
|
|
92
92
|
className,
|
|
93
|
-
}), style: styleOf({ height, minHeight, maxHeight }), children: [api.visibleRange === "continuous" ? (_jsxs("div", { ref: api.refs.continuousScroll, ...api.continuousScrollProps, "data-date-picker-continuous-scroll": "", className: "datepicker-continuous-scroll", children: [_jsx(WeekdayRow, { api: api, semantic: false }), _jsxs("div", { className: "datepicker-continuous-content", children: [_jsx("div", { "aria-hidden": "true", className: "datepicker-continuous-spacer", style: { height: api.virtual.topHeight } }), api.months.map((month) => (_jsx(MonthView, { api: api, month: month, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement, showWeekdays: false, showMonthLabel: true, monthRef: api.refs.continuousMonth(month.key) }, month.key))), _jsx("div", { "aria-hidden": "true", className: "datepicker-continuous-spacer", style: { height: api.virtual.bottomHeight } })] })] })) : (_jsxs(_Fragment, { children: [api.visibleRange !== "twoMonths" && _jsx(Header, { api: api }), _jsx("div", { "data-wheel-open": api.isWheelOpen && api.visibleRange !== "twoMonths"
|
|
93
|
+
}), style: styleOf({ height, minHeight, maxHeight }), children: [api.visibleRange === "continuous" ? (_jsxs("div", { ref: api.refs.continuousScroll, ...api.continuousScrollProps, "data-date-picker-continuous-scroll": "", className: "crisp-datepicker-continuous-scroll", children: [_jsx(WeekdayRow, { api: api, semantic: false }), _jsxs("div", { className: "crisp-datepicker-continuous-content", children: [_jsx("div", { "aria-hidden": "true", className: "datepicker-continuous-spacer", style: { height: api.virtual.topHeight } }), api.months.map((month) => (_jsx(MonthView, { api: api, month: month, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement, showWeekdays: false, showMonthLabel: true, monthRef: api.refs.continuousMonth(month.key) }, month.key))), _jsx("div", { "aria-hidden": "true", className: "datepicker-continuous-spacer", style: { height: api.virtual.bottomHeight } })] })] })) : (_jsxs(_Fragment, { children: [api.visibleRange !== "twoMonths" && _jsx(Header, { api: api }), _jsx("div", { "data-wheel-open": api.isWheelOpen && api.visibleRange !== "twoMonths"
|
|
94
94
|
? ""
|
|
95
95
|
: undefined, "aria-hidden": api.isWheelOpen && api.visibleRange !== "twoMonths"
|
|
96
96
|
? true
|
|
97
|
-
: undefined, className: "datepicker-months", children: api.months.map((month, index) => (_jsx(MonthView, { api: api, month: month, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement, showWeekdays: true, showMonthLabel: false, renderHeader: api.visibleRange === "twoMonths"
|
|
97
|
+
: undefined, className: "crisp-datepicker-months", children: api.months.map((month, index) => (_jsx(MonthView, { api: api, month: month, renderDateCellContent: renderDateCellContent, renderDateCellSupplement: renderDateCellSupplement, showWeekdays: true, showMonthLabel: false, renderHeader: api.visibleRange === "twoMonths"
|
|
98
98
|
? (labelId) => (_jsx(TwoMonthHeader, { api: api, label: month.label, labelId: labelId, position: index === 0 ? "first" : "last" }))
|
|
99
|
-
: undefined }, month.key))) }), api.isWheelOpen && api.visibleRange !== "twoMonths" && (_jsx(WheelView, { api: api }))] })), _jsx("span", { ...api.liveRegionProps, className: "datepicker-live-region", children: api.headerLabel })] }));
|
|
99
|
+
: undefined }, month.key))) }), api.isWheelOpen && api.visibleRange !== "twoMonths" && (_jsx(WheelView, { api: api }))] })), _jsx("span", { ...api.liveRegionProps, className: "crisp-datepicker-live-region", children: api.headerLabel })] }));
|
|
100
100
|
});
|
|
101
101
|
DatePickerImplementation.displayName = "DatePickerImplementation";
|
|
102
102
|
export const DatePicker = React.forwardRef((props, ref) => (_jsx(DatePickerImplementation, { ref: ref, ...props, visibleRange: "month" })));
|