@crisp-ui-kit/crisp 0.31.5 → 0.32.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/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 +21 -19
- 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/dialog-description.js +1 -1
- package/dist/cjs/core/namespace.js +17 -0
- package/dist/cjs/core/resolve.js +5 -3
- package/dist/cjs/index.js +1 -1
- 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/cjs/tokens/elevation.js +4 -4
- package/dist/cjs/tokens/palette.js +2 -2
- package/dist/cjs/tokens/scale.js +6 -6
- package/dist/cjs/tokens/semantic.js +1 -1
- 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 +21 -19
- 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/dialog-description.js +1 -1
- package/dist/esm/core/namespace.js +14 -0
- package/dist/esm/core/resolve.js +5 -3
- package/dist/esm/index.js +1 -1
- 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/esm/tokens/elevation.js +4 -4
- package/dist/esm/tokens/palette.js +2 -2
- package/dist/esm/tokens/scale.js +6 -6
- package/dist/esm/tokens/semantic.js +1 -1
- 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/dialog-description.d.ts +1 -1
- package/dist/types/core/namespace.d.ts +2 -0
- package/dist/types/tokens/elevation.d.ts +4 -4
- 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
|
@@ -26,44 +26,44 @@ const config = defineRecipe({
|
|
|
26
26
|
|
|
27
27
|
/* the position words ("minimum"/"maximum") that ARIA concatenates onto a
|
|
28
28
|
thumb's name — read, never drawn */
|
|
29
|
-
& .slider-thumblabel {
|
|
29
|
+
& .crisp-slider-thumblabel {
|
|
30
30
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
31
31
|
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
|
32
32
|
}
|
|
33
|
-
& .slider-control { position: relative; height: 26px; display: flex; align-items: center; }
|
|
33
|
+
& .crisp-slider-control { position: relative; height: 26px; display: flex; align-items: center; }
|
|
34
34
|
|
|
35
|
-
& .slider-track {
|
|
35
|
+
& .crisp-slider-track {
|
|
36
36
|
position: relative; flex-grow: 1; height: ${c.space["1"]};
|
|
37
37
|
border-radius: ${c.radius.full}; background: ${c.bgNeutralWeak};
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
& .slider-range { position: absolute; height: 100%; background: ${c.bgBrandSolid}; }
|
|
42
|
-
& .slider-range[data-dir="ltr"] { left: var(--range-start); right: var(--range-end); }
|
|
43
|
-
& .slider-range[data-dir="rtl"] { right: var(--range-start); left: var(--range-end); }
|
|
41
|
+
& .crisp-slider-range { position: absolute; height: 100%; background: ${c.bgBrandSolid}; }
|
|
42
|
+
& .crisp-slider-range[data-dir="ltr"] { left: var(--range-start); right: var(--range-end); }
|
|
43
|
+
& .crisp-slider-range[data-dir="rtl"] { right: var(--range-start); left: var(--range-end); }
|
|
44
44
|
|
|
45
|
-
& .slider-thumb {
|
|
45
|
+
& .crisp-slider-thumb {
|
|
46
46
|
position: absolute; top: 50%;
|
|
47
47
|
width: ${c.space["5"]}; height: ${c.space["5"]};
|
|
48
48
|
transform: translate(-50%, -50%);
|
|
49
49
|
border: none; background: none; padding: 0;
|
|
50
50
|
}
|
|
51
|
-
& .slider-thumb[data-dir="ltr"] { left: calc(var(--thumb-position) * 1% + var(--thumb-offset)); }
|
|
52
|
-
& .slider-thumb[data-dir="rtl"] { right: calc(var(--thumb-position) * 1% + var(--thumb-offset)); }
|
|
53
|
-
& .slider-thumb::after {
|
|
51
|
+
& .crisp-slider-thumb[data-dir="ltr"] { left: calc(var(--thumb-position) * 1% + var(--thumb-offset)); }
|
|
52
|
+
& .crisp-slider-thumb[data-dir="rtl"] { right: calc(var(--thumb-position) * 1% + var(--thumb-offset)); }
|
|
53
|
+
& .crisp-slider-thumb::after {
|
|
54
54
|
content: ""; position: absolute; inset: 0;
|
|
55
55
|
border-radius: ${c.radius.full}; background: #fff; box-shadow: ${e.field};
|
|
56
56
|
outline: 2px solid transparent; outline-offset: 2px;
|
|
57
57
|
transition: transform .2s ease, outline-color .2s ease;
|
|
58
58
|
cursor: grab;
|
|
59
59
|
}
|
|
60
|
-
& .slider-thumb[data-thumb-dragging]::after { transform: scale(1.2); cursor: grabbing; }
|
|
61
|
-
& .slider-thumb:focus { outline: none; }
|
|
62
|
-
& .slider-thumb:focus-visible::after { outline-color: ${c.strokeFocusRing}; }
|
|
60
|
+
& .crisp-slider-thumb[data-thumb-dragging]::after { transform: scale(1.2); cursor: grabbing; }
|
|
61
|
+
& .crisp-slider-thumb:focus { outline: none; }
|
|
62
|
+
& .crisp-slider-thumb:focus-visible::after { outline-color: ${c.strokeFocusRing}; }
|
|
63
63
|
|
|
64
64
|
&[data-disabled] { cursor: not-allowed; }
|
|
65
|
-
&[data-disabled] .slider-range { background: ${c.fgDisabled}; }
|
|
66
|
-
&[data-disabled] .slider-thumb::after { cursor: not-allowed; }
|
|
65
|
+
&[data-disabled] .crisp-slider-range { background: ${c.fgDisabled}; }
|
|
66
|
+
&[data-disabled] .crisp-slider-thumb::after { cursor: not-allowed; }
|
|
67
67
|
`,
|
|
68
68
|
variants: {},
|
|
69
69
|
defaultVariants: {},
|
|
@@ -13,7 +13,7 @@ export function StageBar({ stages, current, "aria-label": ariaLabel, className,
|
|
|
13
13
|
return (_jsx("div", { className: stagebarRecipe({ className }), ...rest, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": stages.length, "aria-valuenow": currentIndex + 1, "aria-valuetext": currentStage?.label, "aria-label": ariaLabel, children: stages.map((stage, i) => {
|
|
14
14
|
const color = stage.color ?? DEFAULT;
|
|
15
15
|
const on = i === currentIndex;
|
|
16
|
-
return (_jsx("span", { className: "stagebar-seg", style: {
|
|
16
|
+
return (_jsx("span", { className: "crisp-stagebar-seg", style: {
|
|
17
17
|
background: on
|
|
18
18
|
? color
|
|
19
19
|
: `color-mix(in srgb, ${color} 18%, transparent)`,
|
|
@@ -5,7 +5,7 @@ import { contract as c } from "../../tokens/index.js";
|
|
|
5
5
|
const config = defineRecipe({
|
|
6
6
|
name: "stagebar",
|
|
7
7
|
base: `display: flex; align-items: center; gap: ${c.space["0.5"]}; width: 100%; height: 6px; font-family: ${c.font.sans};
|
|
8
|
-
& .stagebar-seg { flex: 1; height: 100%; border-radius: ${c.radius.full}; transition: background 0.2s ease; }`,
|
|
8
|
+
& .crisp-stagebar-seg { flex: 1; height: 100%; border-radius: ${c.radius.full}; transition: background 0.2s ease; }`,
|
|
9
9
|
variants: {},
|
|
10
10
|
defaultVariants: {},
|
|
11
11
|
compoundVariants: [],
|
|
@@ -7,6 +7,6 @@ import { statcardRecipe } from "./statcard.recipe.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export function StatCard({ label, icon, value, delta, deltaSuffix = "%", caption, card, className, ...rest }) {
|
|
9
9
|
const trend = delta == null ? null : delta > 0 ? "up" : delta < 0 ? "down" : "flat";
|
|
10
|
-
return (_jsxs("div", { className: statcardRecipe({ card, className }), ...rest, children: [_jsxs("span", { className: "statcard-label", children: [icon, label] }), _jsx("span", { className: "statcard-value", children: value }), (trend != null || caption != null) && (_jsxs("span", { className: "statcard-foot", children: [trend != null && (_jsxs("span", { className: "statcard-delta", "data-trend": trend, children: [trend === "up" && _jsx(ArrowUp, { size: 12, strokeWidth: 2.5 }), trend === "down" && _jsx(ArrowDown, { size: 12, strokeWidth: 2.5 }), Math.abs(delta), deltaSuffix] })), caption] }))] }));
|
|
10
|
+
return (_jsxs("div", { className: statcardRecipe({ card, className }), ...rest, children: [_jsxs("span", { className: "crisp-statcard-label", children: [icon, label] }), _jsx("span", { className: "crisp-statcard-value", children: value }), (trend != null || caption != null) && (_jsxs("span", { className: "crisp-statcard-foot", children: [trend != null && (_jsxs("span", { className: "crisp-statcard-delta", "data-trend": trend, children: [trend === "up" && _jsx(ArrowUp, { size: 12, strokeWidth: 2.5 }), trend === "down" && _jsx(ArrowDown, { size: 12, strokeWidth: 2.5 }), Math.abs(delta), deltaSuffix] })), caption] }))] }));
|
|
11
11
|
}
|
|
12
12
|
StatCard.displayName = "StatCard";
|
|
@@ -7,15 +7,15 @@ const config = defineRecipe({
|
|
|
7
7
|
name: "statcard",
|
|
8
8
|
base: `display: flex; flex-direction: column; gap: ${c.space["1.5"]}; box-sizing: border-box; font-family: ${c.font.sans};
|
|
9
9
|
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
10
|
-
& .statcard-label { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
11
|
-
& .statcard-label svg { color: ${c.fgMuted}; }
|
|
12
|
-
& .statcard-value { font-size: 28px; line-height: 32px; font-weight: ${c.weight.semibold}; letter-spacing: -0.4px; color: ${c.fgPrimary}; }
|
|
13
|
-
& .statcard-foot { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
14
|
-
& .statcard-delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; }
|
|
15
|
-
& .statcard-delta svg { flex-shrink: 0; }
|
|
16
|
-
& .statcard-delta[data-trend="up"] { background: color-mix(in srgb, ${c.bgSuccess} 16%, transparent); color: color-mix(in srgb, ${c.bgSuccess} 80%, ${c.fgPrimary}); }
|
|
17
|
-
& .statcard-delta[data-trend="down"] { background: color-mix(in srgb, ${c.bgDanger} 15%, transparent); color: color-mix(in srgb, ${c.bgDanger} 80%, ${c.fgPrimary}); }
|
|
18
|
-
& .statcard-delta[data-trend="flat"] { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: ${c.fgMuted}; }`,
|
|
10
|
+
& .crisp-statcard-label { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
11
|
+
& .crisp-statcard-label svg { color: ${c.fgMuted}; }
|
|
12
|
+
& .crisp-statcard-value { font-size: 28px; line-height: 32px; font-weight: ${c.weight.semibold}; letter-spacing: -0.4px; color: ${c.fgPrimary}; }
|
|
13
|
+
& .crisp-statcard-foot { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.sm}; color: ${c.fgMuted}; }
|
|
14
|
+
& .crisp-statcard-delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; }
|
|
15
|
+
& .crisp-statcard-delta svg { flex-shrink: 0; }
|
|
16
|
+
& .crisp-statcard-delta[data-trend="up"] { background: color-mix(in srgb, ${c.bgSuccess} 16%, transparent); color: color-mix(in srgb, ${c.bgSuccess} 80%, ${c.fgPrimary}); }
|
|
17
|
+
& .crisp-statcard-delta[data-trend="down"] { background: color-mix(in srgb, ${c.bgDanger} 15%, transparent); color: color-mix(in srgb, ${c.bgDanger} 80%, ${c.fgPrimary}); }
|
|
18
|
+
& .crisp-statcard-delta[data-trend="flat"] { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: ${c.fgMuted}; }`,
|
|
19
19
|
variants: {
|
|
20
20
|
// Opt-in chrome for consumers who want the tile self-contained instead of
|
|
21
21
|
// hand-wrapping it in <Card><CardBody>. Not measured as part of the
|
|
@@ -27,6 +27,6 @@ export const Switch = React.forwardRef(({ checked, defaultChecked = false, onChe
|
|
|
27
27
|
if (checked === undefined)
|
|
28
28
|
setInternal((v) => !v);
|
|
29
29
|
onCheckedChange?.(!on);
|
|
30
|
-
}, ...props, children: _jsx("span", { className: "switch-thumb" }) }), name && (on || required) && (_jsx("input", { className: "crisp-formvalue", style: formValueStyle, type: "checkbox", name: name, value: value, checked: on, required: required, tabIndex: -1, "aria-hidden": "true", onChange: () => { } }))] }));
|
|
30
|
+
}, ...props, children: _jsx("span", { className: "crisp-switch-thumb" }) }), name && (on || required) && (_jsx("input", { className: "crisp-formvalue", style: formValueStyle, type: "checkbox", name: name, value: value, checked: on, required: required, tabIndex: -1, "aria-hidden": "true", onChange: () => { } }))] }));
|
|
31
31
|
});
|
|
32
32
|
Switch.displayName = "Switch";
|
|
@@ -9,9 +9,9 @@ const config = defineRecipe({
|
|
|
9
9
|
display: inline-flex; align-items: center; flex-shrink: 0; width: 24px; height: 16px; padding: 0; margin: 0;
|
|
10
10
|
border: none; border-radius: ${c.radius.full}; background: color-mix(in srgb, ${c.fgPrimary} 9%, transparent);
|
|
11
11
|
cursor: pointer; transition: background-color .2s ease; -webkit-tap-highlight-color: transparent;
|
|
12
|
-
& .switch-thumb { width: 12px; height: 12px; margin: 0 2px; border-radius: ${c.radius.full}; background: #fff; transition: transform .2s ease; }
|
|
12
|
+
& .crisp-switch-thumb { width: 12px; height: 12px; margin: 0 2px; border-radius: ${c.radius.full}; background: #fff; transition: transform .2s ease; }
|
|
13
13
|
&[data-checked] { background: ${c.bgBrandSolid}; }
|
|
14
|
-
&[data-checked] .switch-thumb { transform: translateX(8px); }
|
|
14
|
+
&[data-checked] .crisp-switch-thumb { transform: translateX(8px); }
|
|
15
15
|
&:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 2px; }
|
|
16
16
|
&:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
17
17
|
`,
|
|
@@ -12,7 +12,7 @@ export const Table = React.forwardRef(({ interactive, surface, className, wrappe
|
|
|
12
12
|
interactive,
|
|
13
13
|
surface,
|
|
14
14
|
className: wrapperClassName,
|
|
15
|
-
}), children: _jsx("div", { ...scrollProps, className: `table-scroll${scrollProps?.className ? ` ${scrollProps.className}` : ""}`, children: _jsx("table", { ref: ref, className: className, ...props, children: children }) }) })));
|
|
15
|
+
}), children: _jsx("div", { ...scrollProps, className: `crisp-table-scroll${scrollProps?.className ? ` ${scrollProps.className}` : ""}`, children: _jsx("table", { ref: ref, className: className, ...props, children: children }) }) })));
|
|
16
16
|
Table.displayName = "Table";
|
|
17
17
|
export const TableHeader = React.forwardRef((props, ref) => _jsx("thead", { ref: ref, ...props }));
|
|
18
18
|
TableHeader.displayName = "TableHeader";
|
|
@@ -8,7 +8,7 @@ import { contract as c } from "../../tokens/index.js";
|
|
|
8
8
|
const config = defineRecipe({
|
|
9
9
|
name: "table",
|
|
10
10
|
base: `display: block; box-sizing: border-box; background: ${c.bgSurface};
|
|
11
|
-
& .table-scroll { overflow-x: auto; }
|
|
11
|
+
& .crisp-table-scroll { overflow-x: auto; }
|
|
12
12
|
& table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: ${c.font.sans}; font-size: ${c.text.lg}; color: ${c.fgPrimary}; }
|
|
13
13
|
& th, & td { position: relative; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border-bottom: 1px solid ${c.borderSubtle}; border-inline-end: 1px solid ${c.borderSubtle}; text-align: start; vertical-align: middle; white-space: nowrap; overflow: hidden; }
|
|
14
14
|
& th { height: ${c.size.tableHeader}; background: ${c.bgSurface}; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; letter-spacing: -0.14px; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); user-select: none; }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CLASS_PREFIX } from "../../core/namespace.js";
|
|
1
2
|
import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
2
3
|
// The measured chrome of the table toolbar: the Sort/Filter controls, the
|
|
3
4
|
// menu/popover surface they open into, the sort-condition rows, and the filter
|
|
@@ -13,67 +14,67 @@ import { contract as c, elevation as e } from "../../tokens/index.js";
|
|
|
13
14
|
// block, and those depend on following `.menu` in source order. Keeping the
|
|
14
15
|
// split preserves that cascade exactly, which is what lets the generated CSS
|
|
15
16
|
// stay byte-for-byte identical to what shipped before the extraction.
|
|
16
|
-
export const toolbarChromeHead = (p) => ` & .${p}-toolbar { display: flex; align-items: center; gap: ${c.space["1.5"]}; padding: 0 ${c.space["3"]} ${c.space["2"]}; }
|
|
17
|
-
& .${p}-search { display: flex; align-items: center; gap: ${c.space["1.5"]}; height: ${c.size.row}; padding: 0 ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; color: ${c.fgMuted}; }
|
|
18
|
-
& .${p}-search svg { flex-shrink: 0; }
|
|
19
|
-
& .${p}-search input { border: none; outline: none; background: transparent; font-family: inherit; font-size: ${c.text.md}; color: ${c.fgPrimary}; width: 180px; }
|
|
20
|
-
& .${p}-search input::placeholder { color: ${c.fgMuted}; }
|
|
21
|
-
& .${p}-tool { display: inline-flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; background: transparent; box-shadow: inset 0 0 0 1px ${c.borderDefault}; color: ${c.fgPrimary}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; transition: background-color .12s; }
|
|
22
|
-
& .${p}-tool:hover { background: ${c.bgRaised}; }
|
|
23
|
-
& .${p}-tool svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
24
|
-
& .${p}-tool--active { background: ${c.bgRaised}; }
|
|
25
|
-
& .${p}-tool--ghost { box-shadow: none; background: color-mix(in srgb, ${c.fgPrimary} 3%, transparent); color: ${c.fgMuted}; }
|
|
26
|
-
& .${p}-tool--ghost:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); }
|
|
27
|
-
& .${p}-toolgroup { position: relative; display: inline-flex; }
|
|
28
|
-
& .${p}-menu { position: absolute; top: calc(100% + ${c.space["1"]}); left: 0; z-index: 30; min-width: 232px; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; background: ${c.bgPopover}; box-shadow: ${e.floating}; display: flex; flex-direction: column; gap: ${c.space.px}; transform-origin: top; opacity: 1; transform: none; transition: opacity .13s ease, transform .13s ease; }
|
|
29
|
-
& .${p}-menu { @starting-style { opacity: 0; transform: scale(0.96); } }`;
|
|
30
|
-
export const toolbarChromeBody = (p) => ` & .${p}-menu-head { padding: ${c.space["1"]} ${c.space["2"]} ${c.space["0.5"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
31
|
-
& .${p}-sortpop { min-width: 460px; overflow: visible; padding: ${c.space["1.5"]}; gap: ${c.space["1"]}; }
|
|
32
|
-
& .${p}-sort-empty { padding: ${c.space["1"]} ${c.space["1"]} ${c.space["2"]}; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
33
|
-
& .${p}-sort-row { display: flex; align-items: center; gap: ${c.space["1.5"]}; }
|
|
34
|
-
& .${p}-sort-grip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 28px; flex-shrink: 0; margin-right: calc(-1 * ${c.space["1"]}); padding: 0; border: none; background: none; color: ${c.fgMuted}; cursor: grab; }
|
|
35
|
-
& .${p}-sort-grip:active { cursor: grabbing; }
|
|
36
|
-
& .${p}-sort-grip:hover { color: ${c.fgPrimary}; }
|
|
37
|
-
& .${p}-sort-optlabel { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; min-width: 0; }
|
|
38
|
-
& .${p}-sort-optlabel svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
39
|
-
& .${p}-sort-field { flex: 1; min-width: 0; }
|
|
40
|
-
& .${p}-sort-dir { width: 136px; flex-shrink: 0; }
|
|
41
|
-
& .${p}-sort-field .select-trigger, & .${p}-sort-dir .select-trigger { height: 28px; padding-right: ${c.space["1"]}; }
|
|
42
|
-
& .${p}-sort-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; padding: 0; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgMuted}; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
43
|
-
& .${p}-sort-remove:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
44
|
-
& .${p}-sort-addrow { display: flex; padding: ${c.space["0.5"]} 0; }
|
|
45
|
-
& .${p}-sort-add { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; padding: 0 ${c.space["2"]} 0 ${c.space["1.5"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.regular}; color: ${c.fgPrimary}; cursor: pointer; transition: background-color .12s; }
|
|
46
|
-
& .${p}-sort-add:hover { background: ${c.bgRaised}; }
|
|
47
|
-
& .${p}-sort-add svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
48
|
-
& .${p}-sort-foot { display: flex; padding: ${c.space["1.5"]} ${c.space["1"]} ${c.space["0.5"]}; }
|
|
49
|
-
& .${p}-sort-learn { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.lg}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); text-decoration: none; }
|
|
50
|
-
& .${p}-sort-learn svg { flex-shrink: 0; }
|
|
51
|
-
& .${p}-sort-learn:hover { color: ${c.fgPrimary}; }
|
|
52
|
-
& .${p}-menu-item { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align: left; cursor: pointer; }
|
|
53
|
-
& .${p}-menu-item:hover { background: ${c.bgRaised}; }
|
|
54
|
-
& .${p}-menu-item:disabled { opacity: 0.4; cursor: default; }
|
|
55
|
-
& .${p}-menu-item:disabled:hover { background: none; }
|
|
56
|
-
& .${p}-menu-item svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
57
|
-
& .${p}-menu-item[data-on] svg { color: ${c.bgBrandSolid}; }
|
|
58
|
-
& .${p}-menu-item .${p}-menu-check { margin-left: auto; }
|
|
59
|
-
& .${p}-menu-input { height: ${c.size.row}; margin: ${c.space["0.5"]}; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; background: ${c.bgSurface}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; }
|
|
60
|
-
& .${p}-menu-sep { height: 1px; background: ${c.borderSubtle}; margin: ${c.space["0.5"]} 0; }
|
|
61
|
-
& .${p}-menu--up { top: auto; bottom: calc(100% + ${c.space["1"]}); transform-origin: bottom; }
|
|
62
|
-
& .${p}-menu--right { left: auto; right: 0; }
|
|
63
|
-
& .${p}-menu--fixed { position: fixed; top: auto; left: auto; z-index: 40; }
|
|
64
|
-
& .${p}-menu--hdr { min-width: 200px; }
|
|
65
|
-
& .${p}-menu-item--danger { color: ${c.bgDanger}; }
|
|
66
|
-
& .${p}-menu-item--danger svg { color: ${c.bgDanger}; }
|
|
67
|
-
& .${p}-menu-item--danger:hover { background: color-mix(in srgb, ${c.bgDanger} 10%, transparent); }
|
|
68
|
-
& .${p}-menu-check { margin-left: auto; color: ${c.bgBrandSolid}; }
|
|
69
|
-
& .${p}-fchip { display: inline-flex; align-items: center; height: ${c.size.row}; padding-right: ${c.space["1"]}; border-radius: ${c.radius.md}; box-shadow: inset 0 0 0 1px ${c.borderDefault}; background: ${c.bgSurface}; font-size: ${c.text.md}; color: ${c.fgPrimary}; white-space: nowrap; }
|
|
70
|
-
& .${p}-fchip-main { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 100%; margin: 0; padding: 0 ${c.space["1"]} 0 ${c.space["2"]}; border: none; background: none; font-family: inherit; font-size: ${c.text.md}; color: ${c.fgPrimary}; cursor: pointer; }
|
|
71
|
-
& .${p}-fchip-field { font-weight: ${c.weight.medium}; }
|
|
72
|
-
& .${p}-fchip-op { color: ${c.fgMuted}; }
|
|
73
|
-
& .${p}-fchip-val { font-weight: ${c.weight.medium}; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
|
|
74
|
-
& .${p}-fchip-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; border-radius: ${c.radius.sm}; background: none; color: ${c.fgMuted}; cursor: pointer; }
|
|
75
|
-
& .${p}-fchip-x:hover { background: color-mix(in srgb, ${c.fgPrimary} 10%, transparent); color: ${c.fgPrimary}; }
|
|
76
|
-
& .${p}-spacer { flex: 1; }
|
|
77
|
-
& .${p}-count { font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
78
|
-
& .${p}-new { display: inline-flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; padding: 0 ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgBrandSolid}; color: ${c.fgOnBrand}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; transition: background-color .12s; }
|
|
79
|
-
& .${p}-new:hover { background: ${c.bgBrandSolidPressed}; }`;
|
|
17
|
+
export const toolbarChromeHead = (p) => ` & .${CLASS_PREFIX}${p}-toolbar { display: flex; align-items: center; gap: ${c.space["1.5"]}; padding: 0 ${c.space["3"]} ${c.space["2"]}; }
|
|
18
|
+
& .${CLASS_PREFIX}${p}-search { display: flex; align-items: center; gap: ${c.space["1.5"]}; height: ${c.size.row}; padding: 0 ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; color: ${c.fgMuted}; }
|
|
19
|
+
& .${CLASS_PREFIX}${p}-search svg { flex-shrink: 0; }
|
|
20
|
+
& .${CLASS_PREFIX}${p}-search input { border: none; outline: none; background: transparent; font-family: inherit; font-size: ${c.text.md}; color: ${c.fgPrimary}; width: 180px; }
|
|
21
|
+
& .${CLASS_PREFIX}${p}-search input::placeholder { color: ${c.fgMuted}; }
|
|
22
|
+
& .${CLASS_PREFIX}${p}-tool { display: inline-flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; background: transparent; box-shadow: inset 0 0 0 1px ${c.borderDefault}; color: ${c.fgPrimary}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; transition: background-color .12s; }
|
|
23
|
+
& .${CLASS_PREFIX}${p}-tool:hover { background: ${c.bgRaised}; }
|
|
24
|
+
& .${CLASS_PREFIX}${p}-tool svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
25
|
+
& .${CLASS_PREFIX}${p}-tool--active { background: ${c.bgRaised}; }
|
|
26
|
+
& .${CLASS_PREFIX}${p}-tool--ghost { box-shadow: none; background: color-mix(in srgb, ${c.fgPrimary} 3%, transparent); color: ${c.fgMuted}; }
|
|
27
|
+
& .${CLASS_PREFIX}${p}-tool--ghost:hover { background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); }
|
|
28
|
+
& .${CLASS_PREFIX}${p}-toolgroup { position: relative; display: inline-flex; }
|
|
29
|
+
& .${CLASS_PREFIX}${p}-menu { position: absolute; top: calc(100% + ${c.space["1"]}); left: 0; z-index: 30; min-width: 232px; padding: ${c.space["1"]}; border-radius: ${c.radius.lg}; background: ${c.bgPopover}; box-shadow: ${e.floating}; display: flex; flex-direction: column; gap: ${c.space.px}; transform-origin: top; opacity: 1; transform: none; transition: opacity .13s ease, transform .13s ease; }
|
|
30
|
+
& .${CLASS_PREFIX}${p}-menu { @starting-style { opacity: 0; transform: scale(0.96); } }`;
|
|
31
|
+
export const toolbarChromeBody = (p) => ` & .${CLASS_PREFIX}${p}-menu-head { padding: ${c.space["1"]} ${c.space["2"]} ${c.space["0.5"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
32
|
+
& .${CLASS_PREFIX}${p}-sortpop { min-width: 460px; overflow: visible; padding: ${c.space["1.5"]}; gap: ${c.space["1"]}; }
|
|
33
|
+
& .${CLASS_PREFIX}${p}-sort-empty { padding: ${c.space["1"]} ${c.space["1"]} ${c.space["2"]}; font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
34
|
+
& .${CLASS_PREFIX}${p}-sort-row { display: flex; align-items: center; gap: ${c.space["1.5"]}; }
|
|
35
|
+
& .${CLASS_PREFIX}${p}-sort-grip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 28px; flex-shrink: 0; margin-right: calc(-1 * ${c.space["1"]}); padding: 0; border: none; background: none; color: ${c.fgMuted}; cursor: grab; }
|
|
36
|
+
& .${CLASS_PREFIX}${p}-sort-grip:active { cursor: grabbing; }
|
|
37
|
+
& .${CLASS_PREFIX}${p}-sort-grip:hover { color: ${c.fgPrimary}; }
|
|
38
|
+
& .${CLASS_PREFIX}${p}-sort-optlabel { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; min-width: 0; }
|
|
39
|
+
& .${CLASS_PREFIX}${p}-sort-optlabel svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
40
|
+
& .${CLASS_PREFIX}${p}-sort-field { flex: 1; min-width: 0; }
|
|
41
|
+
& .${CLASS_PREFIX}${p}-sort-dir { width: 136px; flex-shrink: 0; }
|
|
42
|
+
& .${CLASS_PREFIX}${p}-sort-field .crisp-select-trigger, & .${CLASS_PREFIX}${p}-sort-dir .crisp-select-trigger { height: 28px; padding-right: ${c.space["1"]}; }
|
|
43
|
+
& .${CLASS_PREFIX}${p}-sort-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; padding: 0; margin: 0; border: none; border-radius: ${c.radius.md}; background: none; color: ${c.fgMuted}; cursor: pointer; transition: background-color .12s, color .12s; }
|
|
44
|
+
& .${CLASS_PREFIX}${p}-sort-remove:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
45
|
+
& .${CLASS_PREFIX}${p}-sort-addrow { display: flex; padding: ${c.space["0.5"]} 0; }
|
|
46
|
+
& .${CLASS_PREFIX}${p}-sort-add { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; padding: 0 ${c.space["2"]} 0 ${c.space["1.5"]}; margin: 0; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.regular}; color: ${c.fgPrimary}; cursor: pointer; transition: background-color .12s; }
|
|
47
|
+
& .${CLASS_PREFIX}${p}-sort-add:hover { background: ${c.bgRaised}; }
|
|
48
|
+
& .${CLASS_PREFIX}${p}-sort-add svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
49
|
+
& .${CLASS_PREFIX}${p}-sort-foot { display: flex; padding: ${c.space["1.5"]} ${c.space["1"]} ${c.space["0.5"]}; }
|
|
50
|
+
& .${CLASS_PREFIX}${p}-sort-learn { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; font-size: ${c.text.lg}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); text-decoration: none; }
|
|
51
|
+
& .${CLASS_PREFIX}${p}-sort-learn svg { flex-shrink: 0; }
|
|
52
|
+
& .${CLASS_PREFIX}${p}-sort-learn:hover { color: ${c.fgPrimary}; }
|
|
53
|
+
& .${CLASS_PREFIX}${p}-menu-item { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; text-align: left; cursor: pointer; }
|
|
54
|
+
& .${CLASS_PREFIX}${p}-menu-item:hover { background: ${c.bgRaised}; }
|
|
55
|
+
& .${CLASS_PREFIX}${p}-menu-item:disabled { opacity: 0.4; cursor: default; }
|
|
56
|
+
& .${CLASS_PREFIX}${p}-menu-item:disabled:hover { background: none; }
|
|
57
|
+
& .${CLASS_PREFIX}${p}-menu-item svg { flex-shrink: 0; color: ${c.fgMuted}; }
|
|
58
|
+
& .${CLASS_PREFIX}${p}-menu-item[data-on] svg { color: ${c.bgBrandSolid}; }
|
|
59
|
+
& .${CLASS_PREFIX}${p}-menu-item .${CLASS_PREFIX}${p}-menu-check { margin-left: auto; }
|
|
60
|
+
& .${CLASS_PREFIX}${p}-menu-input { height: ${c.size.row}; margin: ${c.space["0.5"]}; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; background: ${c.bgSurface}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; }
|
|
61
|
+
& .${CLASS_PREFIX}${p}-menu-sep { height: 1px; background: ${c.borderSubtle}; margin: ${c.space["0.5"]} 0; }
|
|
62
|
+
& .${CLASS_PREFIX}${p}-menu--up { top: auto; bottom: calc(100% + ${c.space["1"]}); transform-origin: bottom; }
|
|
63
|
+
& .${CLASS_PREFIX}${p}-menu--right { left: auto; right: 0; }
|
|
64
|
+
& .${CLASS_PREFIX}${p}-menu--fixed { position: fixed; top: auto; left: auto; z-index: 40; }
|
|
65
|
+
& .${CLASS_PREFIX}${p}-menu--hdr { min-width: 200px; }
|
|
66
|
+
& .${CLASS_PREFIX}${p}-menu-item--danger { color: ${c.bgDanger}; }
|
|
67
|
+
& .${CLASS_PREFIX}${p}-menu-item--danger svg { color: ${c.bgDanger}; }
|
|
68
|
+
& .${CLASS_PREFIX}${p}-menu-item--danger:hover { background: color-mix(in srgb, ${c.bgDanger} 10%, transparent); }
|
|
69
|
+
& .${CLASS_PREFIX}${p}-menu-check { margin-left: auto; color: ${c.bgBrandSolid}; }
|
|
70
|
+
& .${CLASS_PREFIX}${p}-fchip { display: inline-flex; align-items: center; height: ${c.size.row}; padding-right: ${c.space["1"]}; border-radius: ${c.radius.md}; box-shadow: inset 0 0 0 1px ${c.borderDefault}; background: ${c.bgSurface}; font-size: ${c.text.md}; color: ${c.fgPrimary}; white-space: nowrap; }
|
|
71
|
+
& .${CLASS_PREFIX}${p}-fchip-main { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 100%; margin: 0; padding: 0 ${c.space["1"]} 0 ${c.space["2"]}; border: none; background: none; font-family: inherit; font-size: ${c.text.md}; color: ${c.fgPrimary}; cursor: pointer; }
|
|
72
|
+
& .${CLASS_PREFIX}${p}-fchip-field { font-weight: ${c.weight.medium}; }
|
|
73
|
+
& .${CLASS_PREFIX}${p}-fchip-op { color: ${c.fgMuted}; }
|
|
74
|
+
& .${CLASS_PREFIX}${p}-fchip-val { font-weight: ${c.weight.medium}; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
|
|
75
|
+
& .${CLASS_PREFIX}${p}-fchip-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; border-radius: ${c.radius.sm}; background: none; color: ${c.fgMuted}; cursor: pointer; }
|
|
76
|
+
& .${CLASS_PREFIX}${p}-fchip-x:hover { background: color-mix(in srgb, ${c.fgPrimary} 10%, transparent); color: ${c.fgPrimary}; }
|
|
77
|
+
& .${CLASS_PREFIX}${p}-spacer { flex: 1; }
|
|
78
|
+
& .${CLASS_PREFIX}${p}-count { font-size: ${c.text.md}; color: ${c.fgMuted}; }
|
|
79
|
+
& .${CLASS_PREFIX}${p}-new { display: inline-flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; padding: 0 ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgBrandSolid}; color: ${c.fgOnBrand}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; cursor: pointer; transition: background-color .12s; }
|
|
80
|
+
& .${CLASS_PREFIX}${p}-new:hover { background: ${c.bgBrandSolidPressed}; }`;
|
|
@@ -122,7 +122,7 @@ export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsC
|
|
|
122
122
|
return;
|
|
123
123
|
const onDown = (e) => {
|
|
124
124
|
const t = e.target;
|
|
125
|
-
if (!t.closest(".tabletoolbar-menu, [data-menu-trigger]"))
|
|
125
|
+
if (!t.closest(".crisp-tabletoolbar-menu, [data-menu-trigger]"))
|
|
126
126
|
setOpenMenu(null);
|
|
127
127
|
};
|
|
128
128
|
const onKey = (e) => e.key === "Escape" && setOpenMenu(null);
|
|
@@ -154,7 +154,7 @@ export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsC
|
|
|
154
154
|
// with Escape because nothing in it is focused any more (#239).
|
|
155
155
|
const sortListRef = React.useRef(null);
|
|
156
156
|
const addSortRef = React.useRef(null);
|
|
157
|
-
const focusAfterSortRemoval = useFocusAfterRemoval(sortListRef, ".tabletoolbar-sort-remove", addSortRef);
|
|
157
|
+
const focusAfterSortRemoval = useFocusAfterRemoval(sortListRef, ".crisp-tabletoolbar-sort-remove", addSortRef);
|
|
158
158
|
const removeSort = (i) => {
|
|
159
159
|
focusAfterSortRemoval(i);
|
|
160
160
|
putSorts(sorts.filter((_, j) => j !== i));
|
|
@@ -178,44 +178,44 @@ export function TableToolbar({ columns, sorts: sortsProp, defaultSorts, onSortsC
|
|
|
178
178
|
: sorts.length
|
|
179
179
|
? `Sorted by ${columns.find((c) => c.key === sorts[0].key)?.label}${sorts.length > 1 ? ` +${sorts.length - 1}` : ""}`
|
|
180
180
|
: "Sort";
|
|
181
|
-
return (_jsx("div", { className: tabletoolbarRecipe({ className }), ...rest, children: _jsxs("div", { className: "tabletoolbar-toolbar", children: [_jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `tabletoolbar-tool${sorts.length ? " tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "sort" ? null : "sort"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "sort", "data-menu-trigger": true, children: [_jsx(ArrowUpDown, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), sortedLabel] }), openMenu === "sort" && (_jsxs("div", { ref: sortListRef, className: "tabletoolbar-menu tabletoolbar-sortpop", role: "dialog", "aria-label": sortLabel, children: [sorts.length === 0 ? (_jsx("div", { className: "tabletoolbar-sort-empty", children: noSortsLabel })) : (sorts.map((s, i) => (_jsxs("div", { className: "tabletoolbar-sort-row", onDragOver: (e) => {
|
|
181
|
+
return (_jsx("div", { className: tabletoolbarRecipe({ className }), ...rest, children: _jsxs("div", { className: "crisp-tabletoolbar-toolbar", children: [_jsxs("span", { className: "crisp-tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `crisp-tabletoolbar-tool${sorts.length ? " crisp-tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "sort" ? null : "sort"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "sort", "data-menu-trigger": true, children: [_jsx(ArrowUpDown, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), sortedLabel] }), openMenu === "sort" && (_jsxs("div", { ref: sortListRef, className: "crisp-tabletoolbar-menu crisp-tabletoolbar-sortpop", role: "dialog", "aria-label": sortLabel, children: [sorts.length === 0 ? (_jsx("div", { className: "crisp-tabletoolbar-sort-empty", children: noSortsLabel })) : (sorts.map((s, i) => (_jsxs("div", { className: "crisp-tabletoolbar-sort-row", onDragOver: (e) => {
|
|
182
182
|
if (dragSort !== null)
|
|
183
183
|
e.preventDefault();
|
|
184
184
|
}, onDrop: () => {
|
|
185
185
|
if (dragSort !== null)
|
|
186
186
|
moveSort(dragSort, i);
|
|
187
187
|
setDragSort(null);
|
|
188
|
-
}, children: [_jsx("button", { type: "button", className: "tabletoolbar-sort-grip", "aria-label": reorderSortLabel, draggable: true, onDragStart: () => setDragSort(i), onDragEnd: () => setDragSort(null), children: _jsx(GripVertical, { size: 15, strokeWidth: 1.75 }) }), _jsx(Select, { className: "tabletoolbar-sort-field", searchable: true, value: s.key, onValueChange: (k) => setSortField(i, k), options: columns.map((c) => ({
|
|
188
|
+
}, children: [_jsx("button", { type: "button", className: "crisp-tabletoolbar-sort-grip", "aria-label": reorderSortLabel, draggable: true, onDragStart: () => setDragSort(i), onDragEnd: () => setDragSort(null), children: _jsx(GripVertical, { size: 15, strokeWidth: 1.75 }) }), _jsx(Select, { className: "crisp-tabletoolbar-sort-field", searchable: true, value: s.key, onValueChange: (k) => setSortField(i, k), options: columns.map((c) => ({
|
|
189
189
|
value: c.key,
|
|
190
|
-
label: c.icon ? (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(c.icon, { size: 15, strokeWidth: 1.75 }), c.label] })) : (c.label),
|
|
190
|
+
label: c.icon ? (_jsxs("span", { className: "crisp-tabletoolbar-sort-optlabel", children: [_jsx(c.icon, { size: 15, strokeWidth: 1.75 }), c.label] })) : (c.label),
|
|
191
191
|
keywords: c.label,
|
|
192
|
-
})), "aria-label": sortFieldLabel }), _jsx(Select, { className: "tabletoolbar-sort-dir", value: s.dir, onValueChange: (d) => setSortDir(i, d), options: [
|
|
192
|
+
})), "aria-label": sortFieldLabel }), _jsx(Select, { className: "crisp-tabletoolbar-sort-dir", value: s.dir, onValueChange: (d) => setSortDir(i, d), options: [
|
|
193
193
|
{
|
|
194
194
|
value: "asc",
|
|
195
|
-
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }), ascendingLabel] })),
|
|
195
|
+
label: (_jsxs("span", { className: "crisp-tabletoolbar-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }), ascendingLabel] })),
|
|
196
196
|
keywords: ascendingLabel,
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
value: "desc",
|
|
200
|
-
label: (_jsxs("span", { className: "tabletoolbar-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }), descendingLabel] })),
|
|
200
|
+
label: (_jsxs("span", { className: "crisp-tabletoolbar-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }), descendingLabel] })),
|
|
201
201
|
keywords: descendingLabel,
|
|
202
202
|
},
|
|
203
|
-
], "aria-label": sortDirectionLabel }), _jsx("button", { type: "button", className: "tabletoolbar-sort-remove", onClick: () => removeSort(i), "aria-label": removeSortLabel, children: _jsx(X, { size: 15, strokeWidth: 1.75 }) })] }, s.key)))), _jsx("div", { className: "tabletoolbar-sort-addrow", children: _jsxs("button", { ref: addSortRef, type: "button", className: "tabletoolbar-sort-add", onClick: addSort, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), addSortLabel] }) }), helpHref && (_jsx("div", { className: "tabletoolbar-sort-foot", children: _jsxs("a", { className: "tabletoolbar-sort-learn", href: helpHref, target: "_blank", rel: "noreferrer", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), learnSortingLabel] }) }))] }))] }), _jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `tabletoolbar-tool tabletoolbar-tool--ghost${activeFilters ? " tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "filter" ? null : "filter"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "filter", "data-menu-trigger": true, children: [_jsx(ListFilter, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), filterTriggerLabel
|
|
203
|
+
], "aria-label": sortDirectionLabel }), _jsx("button", { type: "button", className: "crisp-tabletoolbar-sort-remove", onClick: () => removeSort(i), "aria-label": removeSortLabel, children: _jsx(X, { size: 15, strokeWidth: 1.75 }) })] }, s.key)))), _jsx("div", { className: "crisp-tabletoolbar-sort-addrow", children: _jsxs("button", { ref: addSortRef, type: "button", className: "crisp-tabletoolbar-sort-add", onClick: addSort, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), addSortLabel] }) }), helpHref && (_jsx("div", { className: "crisp-tabletoolbar-sort-foot", children: _jsxs("a", { className: "crisp-tabletoolbar-sort-learn", href: helpHref, target: "_blank", rel: "noreferrer", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), learnSortingLabel] }) }))] }))] }), _jsxs("span", { className: "crisp-tabletoolbar-toolgroup", children: [_jsxs("button", { type: "button", className: `crisp-tabletoolbar-tool crisp-tabletoolbar-tool--ghost${activeFilters ? " crisp-tabletoolbar-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "filter" ? null : "filter"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "filter", "data-menu-trigger": true, children: [_jsx(ListFilter, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), filterTriggerLabel
|
|
204
204
|
? filterTriggerLabel(activeFilters)
|
|
205
205
|
: activeFilters
|
|
206
206
|
? `Filter · ${activeFilters}`
|
|
207
|
-
: "Filter"] }), openMenu === "filter" && (_jsxs("div", { className: "tabletoolbar-menu", role: "dialog", "aria-label": filterFieldLabel, children: [_jsx("input", { className: "tabletoolbar-menu-input", placeholder: filterFieldPlaceholder, "aria-label": filterFieldLabel,
|
|
207
|
+
: "Filter"] }), openMenu === "filter" && (_jsxs("div", { className: "crisp-tabletoolbar-menu", role: "dialog", "aria-label": filterFieldLabel, children: [_jsx("input", { className: "crisp-tabletoolbar-menu-input", placeholder: filterFieldPlaceholder, "aria-label": filterFieldLabel,
|
|
208
208
|
// biome-ignore lint/a11y/noAutofocus: focus the picker on open
|
|
209
209
|
autoFocus: true, value: filterQuery, onChange: (e) => setFilterQuery(e.target.value) }), columns
|
|
210
210
|
.filter((col) => col.label
|
|
211
211
|
.toLowerCase()
|
|
212
212
|
.includes(filterQuery.trim().toLowerCase()))
|
|
213
|
-
.map((col) => (_jsxs("button", { type: "button", className: "tabletoolbar-menu-item", onClick: () => addFilter(col.key), children: [col.icon ? (_jsx(col.icon, { size: 15, strokeWidth: 1.75 })) : (_jsx("span", { style: { width: 15 } })), col.label] }, col.key)))] }))] }), filters.map((cond) => {
|
|
213
|
+
.map((col) => (_jsxs("button", { type: "button", className: "crisp-tabletoolbar-menu-item", onClick: () => addFilter(col.key), children: [col.icon ? (_jsx(col.icon, { size: 15, strokeWidth: 1.75 })) : (_jsx("span", { style: { width: 15 } })), col.label] }, col.key)))] }))] }), filters.map((cond) => {
|
|
214
214
|
const col = columns.find((c) => c.key === cond.key);
|
|
215
215
|
const open = openMenu === `fcond:${cond.id}`;
|
|
216
216
|
const hasValue = !opNeedsValue(cond.op) || cond.value.trim();
|
|
217
|
-
return (_jsxs("span", { className: "tabletoolbar-toolgroup", children: [_jsxs("span", { className: "tabletoolbar-fchip", children: [_jsxs("button", { type: "button", className: "tabletoolbar-fchip-main", "data-menu-trigger": true, "aria-haspopup": "dialog", onClick: () => setOpenMenu(open ? null : `fcond:${cond.id}`), children: [_jsx("span", { className: "tabletoolbar-fchip-field", children: col?.label }), hasValue ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "tabletoolbar-fchip-op", children: OP_LABELS[cond.op] }), opNeedsValue(cond.op) && (_jsx("span", { className: "tabletoolbar-fchip-val", children: cond.value }))] })) : (_jsx("span", { className: "tabletoolbar-fchip-op", children: selectConditionLabel }))] }), _jsx("button", { type: "button", className: "tabletoolbar-fchip-x", "aria-label": `Remove ${col?.label} filter`, onClick: () => removeFilter(cond.id), children: _jsx(X, { size: 13, strokeWidth: 2 }) })] }), open && (_jsxs("div", { className: "tabletoolbar-menu", role: "dialog", "aria-label": `${col?.label} condition`, children: [_jsxs("div", { className: "tabletoolbar-menu-head", children: [col?.label, " condition"] }), OP_ORDER.map((op) => (_jsxs("button", { type: "button", className: "tabletoolbar-menu-item", "data-on": cond.op === op ? "" : undefined, onClick: () => patchFilter(cond.id, { op }), children: [OP_LABELS[op], cond.op === op ? (_jsx(Check, { className: "tabletoolbar-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, op))), opNeedsValue(cond.op) && (_jsx("input", { className: "tabletoolbar-menu-input", placeholder: filterValuePlaceholder, "aria-label": `${col?.label} filter value`,
|
|
217
|
+
return (_jsxs("span", { className: "crisp-tabletoolbar-toolgroup", children: [_jsxs("span", { className: "crisp-tabletoolbar-fchip", children: [_jsxs("button", { type: "button", className: "crisp-tabletoolbar-fchip-main", "data-menu-trigger": true, "aria-haspopup": "dialog", onClick: () => setOpenMenu(open ? null : `fcond:${cond.id}`), children: [_jsx("span", { className: "crisp-tabletoolbar-fchip-field", children: col?.label }), hasValue ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "crisp-tabletoolbar-fchip-op", children: OP_LABELS[cond.op] }), opNeedsValue(cond.op) && (_jsx("span", { className: "crisp-tabletoolbar-fchip-val", children: cond.value }))] })) : (_jsx("span", { className: "crisp-tabletoolbar-fchip-op", children: selectConditionLabel }))] }), _jsx("button", { type: "button", className: "crisp-tabletoolbar-fchip-x", "aria-label": `Remove ${col?.label} filter`, onClick: () => removeFilter(cond.id), children: _jsx(X, { size: 13, strokeWidth: 2 }) })] }), open && (_jsxs("div", { className: "crisp-tabletoolbar-menu", role: "dialog", "aria-label": `${col?.label} condition`, children: [_jsxs("div", { className: "crisp-tabletoolbar-menu-head", children: [col?.label, " condition"] }), OP_ORDER.map((op) => (_jsxs("button", { type: "button", className: "crisp-tabletoolbar-menu-item", "data-on": cond.op === op ? "" : undefined, onClick: () => patchFilter(cond.id, { op }), children: [OP_LABELS[op], cond.op === op ? (_jsx(Check, { className: "crisp-tabletoolbar-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, op))), opNeedsValue(cond.op) && (_jsx("input", { className: "crisp-tabletoolbar-menu-input", placeholder: filterValuePlaceholder, "aria-label": `${col?.label} filter value`,
|
|
218
218
|
// biome-ignore lint/a11y/noAutofocus: focus the value field
|
|
219
219
|
autoFocus: true, value: cond.value, onChange: (e) => patchFilter(cond.id, { value: e.target.value }) }))] }))] }, cond.id));
|
|
220
|
-
}), _jsx("span", { className: "tabletoolbar-spacer" }), count != null && _jsx("span", { className: "tabletoolbar-count", children: count }), children] }) }));
|
|
220
|
+
}), _jsx("span", { className: "crisp-tabletoolbar-spacer" }), count != null && (_jsx("span", { className: "crisp-tabletoolbar-count", children: count })), children] }) }));
|
|
221
221
|
}
|
|
@@ -47,13 +47,13 @@ export function Tabs({ tabs, value, defaultValue, onValueChange, leading, childr
|
|
|
47
47
|
select,
|
|
48
48
|
listRef,
|
|
49
49
|
});
|
|
50
|
-
return (_jsxs("div", { className: tabsRecipe({ className }), ...rest, children: [_jsxs("div", { ref: listRef, className: "tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && _jsx("span", { className: "tabs-leading", children: leading }), tabs.map((t) => {
|
|
50
|
+
return (_jsxs("div", { className: tabsRecipe({ className }), ...rest, children: [_jsxs("div", { ref: listRef, className: "crisp-tabs-list", role: "tablist", "aria-label": ariaLabel, onKeyDown: onKeyDown, children: [leading && _jsx("span", { className: "crisp-tabs-leading", children: leading }), tabs.map((t) => {
|
|
51
51
|
const selected = t.value === active;
|
|
52
|
-
return (_jsxs("button", { type: "button", role: "tab", id: tabId(t.value), "aria-selected": selected, "aria-controls": children && selected ? panelId(t.value) : undefined, tabIndex: tabIndexFor(t.value), "data-value": t.value, "data-selected": selected ? "" : undefined, disabled: t.disabled, className: "tabs-tab", onClick: () => select(t.value), children: [t.icon, _jsx("span", { className: "tabs-tab-label", children: t.label }), t.badge != null && (_jsx("span", { className: "tabs-tab-badge", children: t.badge }))] }, t.value));
|
|
53
|
-
}), indicator && (_jsx("span", { className: "tabs-indicator", style: {
|
|
52
|
+
return (_jsxs("button", { type: "button", role: "tab", id: tabId(t.value), "aria-selected": selected, "aria-controls": children && selected ? panelId(t.value) : undefined, tabIndex: tabIndexFor(t.value), "data-value": t.value, "data-selected": selected ? "" : undefined, disabled: t.disabled, className: "crisp-tabs-tab", onClick: () => select(t.value), children: [t.icon, _jsx("span", { className: "tabs-tab-label", children: t.label }), t.badge != null && (_jsx("span", { className: "crisp-tabs-tab-badge", children: t.badge }))] }, t.value));
|
|
53
|
+
}), indicator && (_jsx("span", { className: "crisp-tabs-indicator", style: {
|
|
54
54
|
width: indicator.width,
|
|
55
55
|
transform: `translateX(${indicator.left}px)`,
|
|
56
|
-
} }))] }), children && (_jsx("div", { className: "tabs-panel", role: "tabpanel", id: panelId(active), "aria-labelledby": tabId(active),
|
|
56
|
+
} }))] }), children && (_jsx("div", { className: "crisp-tabs-panel", role: "tabpanel", id: panelId(active), "aria-labelledby": tabId(active),
|
|
57
57
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: a tabpanel is focusable per the WAI-ARIA tabs pattern
|
|
58
58
|
tabIndex: 0, children: children(active) }))] }));
|
|
59
59
|
}
|
|
@@ -12,18 +12,18 @@ const config = defineRecipe({
|
|
|
12
12
|
display: flex; flex-direction: column; min-height: 0; font-family: ${c.font.sans};
|
|
13
13
|
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
14
14
|
|
|
15
|
-
& .tabs-list { position: relative; display: flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; flex-shrink: 0; }
|
|
16
|
-
& .tabs-leading { display: inline-flex; align-items: center; margin-inline-end: ${c.space["1"]}; }
|
|
17
|
-
& .tabs-tab { position: relative; display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; box-shadow: inset 0 0 0 1px transparent; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; letter-spacing: -0.14px; color: ${c.fgMuted}; cursor: pointer; white-space: nowrap; transition: color .12s ease, background-color .12s ease, box-shadow .12s ease; }
|
|
18
|
-
& .tabs-tab svg { flex-shrink: 0; opacity: 0.85; }
|
|
19
|
-
& .tabs-tab:hover:not([data-selected]) { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
20
|
-
& .tabs-tab[data-selected] { color: ${c.fgPrimary}; background: ${c.bgSubtle}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; }
|
|
21
|
-
& .tabs-tab:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 1px; }
|
|
22
|
-
& .tabs-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); font-size: ${c.text.xs}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
23
|
-
& .tabs-tab[data-selected] .tabs-tab-badge { color: ${c.fgPrimary}; }
|
|
24
|
-
& .tabs-indicator { position: absolute; bottom: calc(-1 * ${c.space["2"]}); left: 0; height: 1px; background: ${c.fgPrimary}; border-radius: 2px 2px 0 0; transition: transform .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); pointer-events: none; }
|
|
25
|
-
& .tabs-panel { flex: 1; min-height: 0; }
|
|
26
|
-
& .tabs-panel:focus-visible { outline: none; }
|
|
15
|
+
& .crisp-tabs-list { position: relative; display: flex; align-items: center; gap: ${c.space["1"]}; height: ${c.size.row}; flex-shrink: 0; }
|
|
16
|
+
& .crisp-tabs-leading { display: inline-flex; align-items: center; margin-inline-end: ${c.space["1"]}; }
|
|
17
|
+
& .crisp-tabs-tab { position: relative; display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: 28px; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; box-shadow: inset 0 0 0 1px transparent; border-radius: ${c.radius.md}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; letter-spacing: -0.14px; color: ${c.fgMuted}; cursor: pointer; white-space: nowrap; transition: color .12s ease, background-color .12s ease, box-shadow .12s ease; }
|
|
18
|
+
& .crisp-tabs-tab svg { flex-shrink: 0; opacity: 0.85; }
|
|
19
|
+
& .crisp-tabs-tab:hover:not([data-selected]) { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
|
|
20
|
+
& .crisp-tabs-tab[data-selected] { color: ${c.fgPrimary}; background: ${c.bgSubtle}; box-shadow: inset 0 0 0 1px ${c.borderSubtle}; }
|
|
21
|
+
& .crisp-tabs-tab:focus-visible { outline: 2px solid ${c.bgBrandSolid}; outline-offset: 1px; }
|
|
22
|
+
& .crisp-tabs-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.sm}; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); font-size: ${c.text.xs}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
|
|
23
|
+
& .crisp-tabs-tab[data-selected] .crisp-tabs-tab-badge { color: ${c.fgPrimary}; }
|
|
24
|
+
& .crisp-tabs-indicator { position: absolute; bottom: calc(-1 * ${c.space["2"]}); left: 0; height: 1px; background: ${c.fgPrimary}; border-radius: 2px 2px 0 0; transition: transform .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); pointer-events: none; }
|
|
25
|
+
& .crisp-tabs-panel { flex: 1; min-height: 0; }
|
|
26
|
+
& .crisp-tabs-panel:focus-visible { outline: none; }
|
|
27
27
|
`,
|
|
28
28
|
variants: {},
|
|
29
29
|
defaultVariants: {},
|
|
@@ -11,10 +11,10 @@ export const Textarea = React.forwardRef(({ showCount, maxLength, className, wra
|
|
|
11
11
|
const [count, setCount] = React.useState(initial);
|
|
12
12
|
const len = value !== undefined ? String(value).length : count;
|
|
13
13
|
const counted = showCount && maxLength != null;
|
|
14
|
-
return (_jsxs("div", { className: textareaRecipe({ className: wrapperClassName }), "data-counted": counted ? "" : undefined, children: [_jsx("span", { className: "textarea-wrap", children: _jsx("textarea", { ref: ref, className: `textarea-field${className ? ` ${className}` : ""}`, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: (e) => {
|
|
14
|
+
return (_jsxs("div", { className: textareaRecipe({ className: wrapperClassName }), "data-counted": counted ? "" : undefined, children: [_jsx("span", { className: "crisp-textarea-wrap", children: _jsx("textarea", { ref: ref, className: `crisp-textarea-field${className ? ` ${className}` : ""}`, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: (e) => {
|
|
15
15
|
if (value === undefined)
|
|
16
16
|
setCount(e.target.value.length);
|
|
17
17
|
onChange?.(e);
|
|
18
|
-
}, ...props }) }), counted && (_jsxs("span", { className: "textarea-count", "data-over": len > (maxLength ?? 0) ? "" : undefined, "aria-hidden": "true", children: [len, " / ", maxLength] }))] }));
|
|
18
|
+
}, ...props }) }), counted && (_jsxs("span", { className: "crisp-textarea-count", "data-over": len > (maxLength ?? 0) ? "" : undefined, "aria-hidden": "true", children: [len, " / ", maxLength] }))] }));
|
|
19
19
|
});
|
|
20
20
|
Textarea.displayName = "Textarea";
|
|
@@ -8,7 +8,7 @@ const config = defineRecipe({
|
|
|
8
8
|
base: `
|
|
9
9
|
position: relative; display: block; width: 100%; font-family: ${c.font.sans};
|
|
10
10
|
|
|
11
|
-
& .textarea-field {
|
|
11
|
+
& .crisp-textarea-field {
|
|
12
12
|
box-sizing: border-box; display: block; width: 100%; min-height: 80px; resize: vertical;
|
|
13
13
|
margin: 0; padding: ${c.space["1.5"]} ${c.space["2.5"]}; border: none; border-radius: ${c.radius.md};
|
|
14
14
|
background: ${c.bgSurface}; box-shadow: ${e.field};
|
|
@@ -16,24 +16,24 @@ const config = defineRecipe({
|
|
|
16
16
|
outline: none; transition: box-shadow .15s ease;
|
|
17
17
|
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
|
18
18
|
}
|
|
19
|
-
& .textarea-field::placeholder { color: ${c.fgMuted}; }
|
|
20
|
-
& .textarea-field:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
19
|
+
& .crisp-textarea-field::placeholder { color: ${c.fgMuted}; }
|
|
20
|
+
& .crisp-textarea-field:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
21
21
|
|
|
22
22
|
/* seed-design's focus treatment, same as Input: a 2px ring on an ::after
|
|
23
23
|
overlay that is present-but-transparent at rest, so focusing never
|
|
24
24
|
shifts the box, animating only its colour. */
|
|
25
|
-
& .textarea-wrap { position: relative; display: block; }
|
|
26
|
-
& .textarea-wrap::after {
|
|
25
|
+
& .crisp-textarea-wrap { position: relative; display: block; }
|
|
26
|
+
& .crisp-textarea-wrap::after {
|
|
27
27
|
content: ""; position: absolute; inset: 0; border-radius: ${c.radius.md};
|
|
28
28
|
border: 2px solid transparent; transition: border-color .1s ease;
|
|
29
29
|
pointer-events: none;
|
|
30
30
|
}
|
|
31
|
-
& .textarea-wrap:focus-within::after { border-color: ${c.strokeFieldFocus}; }
|
|
32
|
-
&[data-invalid] .textarea-wrap::after { border-color: ${c.bgDanger}; }
|
|
33
|
-
&[data-invalid] .textarea-wrap:focus-within::after { border-color: ${c.bgDanger}; }
|
|
34
|
-
&[data-counted] .textarea-field { padding-bottom: ${c.space["5"]}; }
|
|
35
|
-
& .textarea-count { position: absolute; inset-inline-end: ${c.space["2.5"]}; bottom: ${c.space["1.5"]}; font-size: ${c.text.sm}; color: ${c.fgMuted}; pointer-events: none; }
|
|
36
|
-
& .textarea-count[data-over] { color: ${c.bgDanger}; }
|
|
31
|
+
& .crisp-textarea-wrap:focus-within::after { border-color: ${c.strokeFieldFocus}; }
|
|
32
|
+
&[data-invalid] .crisp-textarea-wrap::after { border-color: ${c.bgDanger}; }
|
|
33
|
+
&[data-invalid] .crisp-textarea-wrap:focus-within::after { border-color: ${c.bgDanger}; }
|
|
34
|
+
&[data-counted] .crisp-textarea-field { padding-bottom: ${c.space["5"]}; }
|
|
35
|
+
& .crisp-textarea-count { position: absolute; inset-inline-end: ${c.space["2.5"]}; bottom: ${c.space["1.5"]}; font-size: ${c.text.sm}; color: ${c.fgMuted}; pointer-events: none; }
|
|
36
|
+
& .crisp-textarea-count[data-over] { color: ${c.bgDanger}; }
|
|
37
37
|
`,
|
|
38
38
|
variants: {},
|
|
39
39
|
defaultVariants: {},
|
|
@@ -12,10 +12,10 @@ const ICONS = {
|
|
|
12
12
|
};
|
|
13
13
|
function ToastCard({ item, onClose, dismissLabel, }) {
|
|
14
14
|
const Icon = ICONS[item.tone ?? "info"];
|
|
15
|
-
return (_jsxs("div", { className: "toast", "data-tone": item.tone ?? "info", children: [_jsx("span", { className: "toast-icon", children: _jsx(Icon, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) }), _jsxs("div", { className: "toast-body", children: [_jsx("div", { className: "toast-title", children: item.title }), item.description != null && (_jsx("div", { className: "toast-desc", children: item.description })), item.action && (_jsx("button", { type: "button", className: "toast-action", onClick: () => {
|
|
15
|
+
return (_jsxs("div", { className: "crisp-toast", "data-tone": item.tone ?? "info", children: [_jsx("span", { className: "crisp-toast-icon", children: _jsx(Icon, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) }), _jsxs("div", { className: "crisp-toast-body", children: [_jsx("div", { className: "crisp-toast-title", children: item.title }), item.description != null && (_jsx("div", { className: "crisp-toast-desc", children: item.description })), item.action && (_jsx("button", { type: "button", className: "crisp-toast-action", onClick: () => {
|
|
16
16
|
item.action?.onClick();
|
|
17
17
|
onClose();
|
|
18
|
-
}, children: item.action.label }))] }), _jsx("button", { type: "button", className: "toast-close", "aria-label": dismissLabel, onClick: onClose, children: _jsx(X, { size: 15, strokeWidth: 2, "aria-hidden": "true" }) })] }));
|
|
18
|
+
}, children: item.action.label }))] }), _jsx("button", { type: "button", className: "crisp-toast-close", "aria-label": dismissLabel, onClick: onClose, children: _jsx(X, { size: 15, strokeWidth: 2, "aria-hidden": "true" }) })] }));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Wrap your app in a `ToastProvider`, then call `useToast().toast({...})` from
|
|
@@ -33,7 +33,7 @@ export function ToastProvider({ children, duration = 4000, dismissLabel = "Dismi
|
|
|
33
33
|
// the stack, which is the only sensible place left.
|
|
34
34
|
const viewportRef = React.useRef(null);
|
|
35
35
|
const cameFrom = React.useRef(null);
|
|
36
|
-
const focusAfterDismiss = useFocusAfterRemoval(viewportRef, ".toast-close", cameFrom);
|
|
36
|
+
const focusAfterDismiss = useFocusAfterRemoval(viewportRef, ".crisp-toast-close", cameFrom);
|
|
37
37
|
// Tracked from the document, not from the viewport's own focus event: a
|
|
38
38
|
// focusin's relatedTarget is the element LOSING focus, which browsers fill
|
|
39
39
|
// in and happy-dom does not, and either way it is only right when focus
|
|
@@ -71,7 +71,7 @@ export function ToastProvider({ children, duration = 4000, dismissLabel = "Dismi
|
|
|
71
71
|
return () => map.forEach(clearTimeout);
|
|
72
72
|
}, []);
|
|
73
73
|
const api = React.useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
|
|
74
|
-
return (_jsxs(ToastContext.Provider, { value: api, children: [children, _jsx("div", { className: toastRecipe(), children: _jsx("div", { ref: viewportRef, className: "toast-viewport", role: "region", "aria-label": regionLabel, "aria-live": "polite", "aria-atomic": "false", children: items.map((t, i) => (_jsx(ToastCard, { item: t, onClose: () => {
|
|
74
|
+
return (_jsxs(ToastContext.Provider, { value: api, children: [children, _jsx("div", { className: toastRecipe(), children: _jsx("div", { ref: viewportRef, className: "crisp-toast-viewport", role: "region", "aria-label": regionLabel, "aria-live": "polite", "aria-atomic": "false", children: items.map((t, i) => (_jsx(ToastCard, { item: t, onClose: () => {
|
|
75
75
|
focusAfterDismiss(i);
|
|
76
76
|
dismiss(t.id);
|
|
77
77
|
}, dismissLabel: dismissLabel }, t.id))) }) })] }));
|