foldkit-mixins-ui 0.20.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/accordion.d.ts +66 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +87 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.d.ts +68 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +59 -0
- package/dist/alert.js.map +1 -0
- package/dist/anchor.d.ts +86 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +180 -0
- package/dist/anchor.js.map +1 -0
- package/dist/angleSlider.d.ts +119 -0
- package/dist/angleSlider.d.ts.map +1 -0
- package/dist/angleSlider.js +229 -0
- package/dist/angleSlider.js.map +1 -0
- package/dist/appShell.d.ts +58 -0
- package/dist/appShell.d.ts.map +1 -0
- package/dist/appShell.js +53 -0
- package/dist/appShell.js.map +1 -0
- package/dist/aspectRatio.d.ts +23 -0
- package/dist/aspectRatio.d.ts.map +1 -0
- package/dist/aspectRatio.js +17 -0
- package/dist/aspectRatio.js.map +1 -0
- package/dist/avatar.d.ts +98 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +110 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +27 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +18 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.d.ts +101 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +104 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.d.ts +50 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +39 -0
- package/dist/button.js.map +1 -0
- package/dist/buttonGroup.d.ts +44 -0
- package/dist/buttonGroup.d.ts.map +1 -0
- package/dist/buttonGroup.js +33 -0
- package/dist/buttonGroup.js.map +1 -0
- package/dist/calendar.d.ts +352 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +755 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +125 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +144 -0
- package/dist/card.js.map +1 -0
- package/dist/carousel.d.ts +153 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +343 -0
- package/dist/carousel.js.map +1 -0
- package/dist/cascadeSelect.d.ts +207 -0
- package/dist/cascadeSelect.d.ts.map +1 -0
- package/dist/cascadeSelect.js +490 -0
- package/dist/cascadeSelect.js.map +1 -0
- package/dist/chart/scale.d.ts +40 -0
- package/dist/chart/scale.d.ts.map +1 -0
- package/dist/chart/scale.js +106 -0
- package/dist/chart/scale.js.map +1 -0
- package/dist/chart.d.ts +165 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +365 -0
- package/dist/chart.js.map +1 -0
- package/dist/chatMessage.d.ts +124 -0
- package/dist/chatMessage.d.ts.map +1 -0
- package/dist/chatMessage.js +118 -0
- package/dist/chatMessage.js.map +1 -0
- package/dist/checkbox.d.ts +22 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +36 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/checkboxGroup.d.ts +70 -0
- package/dist/checkboxGroup.d.ts.map +1 -0
- package/dist/checkboxGroup.js +110 -0
- package/dist/checkboxGroup.js.map +1 -0
- package/dist/choices.d.ts +7 -0
- package/dist/choices.d.ts.map +1 -0
- package/dist/choices.js +10 -0
- package/dist/choices.js.map +1 -0
- package/dist/codeBlock.d.ts +79 -0
- package/dist/codeBlock.d.ts.map +1 -0
- package/dist/codeBlock.js +75 -0
- package/dist/codeBlock.js.map +1 -0
- package/dist/colorPicker.d.ts +239 -0
- package/dist/colorPicker.d.ts.map +1 -0
- package/dist/colorPicker.js +724 -0
- package/dist/colorPicker.js.map +1 -0
- package/dist/combobox.d.ts +162 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +244 -0
- package/dist/combobox.js.map +1 -0
- package/dist/comboboxShared.d.ts +96 -0
- package/dist/comboboxShared.d.ts.map +1 -0
- package/dist/comboboxShared.js +370 -0
- package/dist/comboboxShared.js.map +1 -0
- package/dist/comboboxView.d.ts +39 -0
- package/dist/comboboxView.d.ts.map +1 -0
- package/dist/comboboxView.js +51 -0
- package/dist/comboboxView.js.map +1 -0
- package/dist/command.d.ts +145 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +220 -0
- package/dist/command.js.map +1 -0
- package/dist/datePicker.d.ts +54 -0
- package/dist/datePicker.d.ts.map +1 -0
- package/dist/datePicker.js +88 -0
- package/dist/datePicker.js.map +1 -0
- package/dist/datePickerUtils.d.ts +23 -0
- package/dist/datePickerUtils.d.ts.map +1 -0
- package/dist/datePickerUtils.js +71 -0
- package/dist/datePickerUtils.js.map +1 -0
- package/dist/datePickerView.d.ts +368 -0
- package/dist/datePickerView.d.ts.map +1 -0
- package/dist/datePickerView.js +128 -0
- package/dist/datePickerView.js.map +1 -0
- package/dist/dialog.d.ts +90 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +112 -0
- package/dist/dialog.js.map +1 -0
- package/dist/direction.d.ts +26 -0
- package/dist/direction.d.ts.map +1 -0
- package/dist/direction.js +63 -0
- package/dist/direction.js.map +1 -0
- package/dist/disclosure.d.ts +15 -0
- package/dist/disclosure.d.ts.map +1 -0
- package/dist/disclosure.js +23 -0
- package/dist/disclosure.js.map +1 -0
- package/dist/drawer.d.ts +118 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +208 -0
- package/dist/drawer.js.map +1 -0
- package/dist/empty.d.ts +35 -0
- package/dist/empty.d.ts.map +1 -0
- package/dist/empty.js +30 -0
- package/dist/empty.js.map +1 -0
- package/dist/field.d.ts +12 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +18 -0
- package/dist/field.js.map +1 -0
- package/dist/fieldset.d.ts +16 -0
- package/dist/fieldset.d.ts.map +1 -0
- package/dist/fieldset.js +18 -0
- package/dist/fieldset.js.map +1 -0
- package/dist/figure.d.ts +24 -0
- package/dist/figure.d.ts.map +1 -0
- package/dist/figure.js +25 -0
- package/dist/figure.js.map +1 -0
- package/dist/fileDrop.d.ts +22 -0
- package/dist/fileDrop.d.ts.map +1 -0
- package/dist/fileDrop.js +25 -0
- package/dist/fileDrop.js.map +1 -0
- package/dist/floatingPanel.d.ts +226 -0
- package/dist/floatingPanel.d.ts.map +1 -0
- package/dist/floatingPanel.js +435 -0
- package/dist/floatingPanel.js.map +1 -0
- package/dist/hoverIntent.d.ts +48 -0
- package/dist/hoverIntent.d.ts.map +1 -0
- package/dist/hoverIntent.js +84 -0
- package/dist/hoverIntent.js.map +1 -0
- package/dist/icon.d.ts +31 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +22 -0
- package/dist/icon.js.map +1 -0
- package/dist/icons.d.ts +17 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +32 -0
- package/dist/icons.js.map +1 -0
- package/dist/image.d.ts +85 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +201 -0
- package/dist/image.js.map +1 -0
- package/dist/imageAttributes.d.ts +5 -0
- package/dist/imageAttributes.d.ts.map +1 -0
- package/dist/imageAttributes.js +22 -0
- package/dist/imageAttributes.js.map +1 -0
- package/dist/imageCropper.d.ts +284 -0
- package/dist/imageCropper.d.ts.map +1 -0
- package/dist/imageCropper.js +922 -0
- package/dist/imageCropper.js.map +1 -0
- package/dist/index.d.ts +183 -0
- package/dist/index.js +177 -0
- package/dist/input.d.ts +64 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +76 -0
- package/dist/input.js.map +1 -0
- package/dist/inputCopy.d.ts +89 -0
- package/dist/inputCopy.d.ts.map +1 -0
- package/dist/inputCopy.js +120 -0
- package/dist/inputCopy.js.map +1 -0
- package/dist/item.d.ts +78 -0
- package/dist/item.d.ts.map +1 -0
- package/dist/item.js +75 -0
- package/dist/item.js.map +1 -0
- package/dist/kbd.d.ts +42 -0
- package/dist/kbd.d.ts.map +1 -0
- package/dist/kbd.js +28 -0
- package/dist/kbd.js.map +1 -0
- package/dist/label.d.ts +26 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +18 -0
- package/dist/label.js.map +1 -0
- package/dist/listbox.d.ts +144 -0
- package/dist/listbox.d.ts.map +1 -0
- package/dist/listbox.js +220 -0
- package/dist/listbox.js.map +1 -0
- package/dist/listboxShared.d.ts +74 -0
- package/dist/listboxShared.d.ts.map +1 -0
- package/dist/listboxShared.js +307 -0
- package/dist/listboxShared.js.map +1 -0
- package/dist/listboxView.d.ts +33 -0
- package/dist/listboxView.d.ts.map +1 -0
- package/dist/listboxView.js +49 -0
- package/dist/listboxView.js.map +1 -0
- package/dist/marquee.d.ts +104 -0
- package/dist/marquee.d.ts.map +1 -0
- package/dist/marquee.js +126 -0
- package/dist/marquee.js.map +1 -0
- package/dist/menu.d.ts +556 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +891 -0
- package/dist/menu.js.map +1 -0
- package/dist/menuUtils.d.ts +20 -0
- package/dist/menuUtils.d.ts.map +1 -0
- package/dist/menuUtils.js +56 -0
- package/dist/menuUtils.js.map +1 -0
- package/dist/menuView.d.ts +70 -0
- package/dist/menuView.d.ts.map +1 -0
- package/dist/menuView.js +293 -0
- package/dist/menuView.js.map +1 -0
- package/dist/menubar.d.ts +201 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +263 -0
- package/dist/menubar.js.map +1 -0
- package/dist/messageScroller.d.ts +122 -0
- package/dist/messageScroller.d.ts.map +1 -0
- package/dist/messageScroller.js +252 -0
- package/dist/messageScroller.js.map +1 -0
- package/dist/meter.d.ts +44 -0
- package/dist/meter.d.ts.map +1 -0
- package/dist/meter.js +50 -0
- package/dist/meter.js.map +1 -0
- package/dist/nav.d.ts +178 -0
- package/dist/nav.d.ts.map +1 -0
- package/dist/nav.js +363 -0
- package/dist/nav.js.map +1 -0
- package/dist/numberField.d.ts +51 -0
- package/dist/numberField.d.ts.map +1 -0
- package/dist/numberField.js +97 -0
- package/dist/numberField.js.map +1 -0
- package/dist/otpField.d.ts +47 -0
- package/dist/otpField.d.ts.map +1 -0
- package/dist/otpField.js +54 -0
- package/dist/otpField.js.map +1 -0
- package/dist/pagination.d.ts +91 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +94 -0
- package/dist/pagination.js.map +1 -0
- package/dist/passwordInput.d.ts +85 -0
- package/dist/passwordInput.d.ts.map +1 -0
- package/dist/passwordInput.js +105 -0
- package/dist/passwordInput.js.map +1 -0
- package/dist/patterns.d.ts +875 -0
- package/dist/patterns.d.ts.map +1 -0
- package/dist/patterns.js +1047 -0
- package/dist/patterns.js.map +1 -0
- package/dist/popover.d.ts +39 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +62 -0
- package/dist/popover.js.map +1 -0
- package/dist/popupScroll.d.ts +15 -0
- package/dist/popupScroll.d.ts.map +1 -0
- package/dist/popupScroll.js +12 -0
- package/dist/popupScroll.js.map +1 -0
- package/dist/popupView.d.ts +64 -0
- package/dist/popupView.d.ts.map +1 -0
- package/dist/popupView.js +43 -0
- package/dist/popupView.js.map +1 -0
- package/dist/progress.d.ts +65 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +87 -0
- package/dist/progress.js.map +1 -0
- package/dist/qrCode.d.ts +95 -0
- package/dist/qrCode.d.ts.map +1 -0
- package/dist/qrCode.js +182 -0
- package/dist/qrCode.js.map +1 -0
- package/dist/questionnaire.d.ts +289 -0
- package/dist/questionnaire.d.ts.map +1 -0
- package/dist/questionnaire.js +512 -0
- package/dist/questionnaire.js.map +1 -0
- package/dist/radioGroup.d.ts +57 -0
- package/dist/radioGroup.d.ts.map +1 -0
- package/dist/radioGroup.js +77 -0
- package/dist/radioGroup.js.map +1 -0
- package/dist/rating.d.ts +78 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +117 -0
- package/dist/rating.js.map +1 -0
- package/dist/recipes/accordion.d.ts +61 -0
- package/dist/recipes/accordion.d.ts.map +1 -0
- package/dist/recipes/accordion.js +206 -0
- package/dist/recipes/accordion.js.map +1 -0
- package/dist/recipes/alert.d.ts +34 -0
- package/dist/recipes/alert.d.ts.map +1 -0
- package/dist/recipes/alert.js +151 -0
- package/dist/recipes/alert.js.map +1 -0
- package/dist/recipes/angleSlider.d.ts +52 -0
- package/dist/recipes/angleSlider.d.ts.map +1 -0
- package/dist/recipes/angleSlider.js +162 -0
- package/dist/recipes/angleSlider.js.map +1 -0
- package/dist/recipes/appShell.d.ts +21 -0
- package/dist/recipes/appShell.d.ts.map +1 -0
- package/dist/recipes/appShell.js +132 -0
- package/dist/recipes/appShell.js.map +1 -0
- package/dist/recipes/aspectRatio.d.ts +16 -0
- package/dist/recipes/aspectRatio.d.ts.map +1 -0
- package/dist/recipes/aspectRatio.js +24 -0
- package/dist/recipes/aspectRatio.js.map +1 -0
- package/dist/recipes/avatar.d.ts +66 -0
- package/dist/recipes/avatar.d.ts.map +1 -0
- package/dist/recipes/avatar.js +138 -0
- package/dist/recipes/avatar.js.map +1 -0
- package/dist/recipes/badge.d.ts +21 -0
- package/dist/recipes/badge.d.ts.map +1 -0
- package/dist/recipes/badge.js +73 -0
- package/dist/recipes/badge.js.map +1 -0
- package/dist/recipes/breadcrumb.d.ts +24 -0
- package/dist/recipes/breadcrumb.d.ts.map +1 -0
- package/dist/recipes/breadcrumb.js +101 -0
- package/dist/recipes/breadcrumb.js.map +1 -0
- package/dist/recipes/button.d.ts +60 -0
- package/dist/recipes/button.d.ts.map +1 -0
- package/dist/recipes/button.js +193 -0
- package/dist/recipes/button.js.map +1 -0
- package/dist/recipes/buttonGroup.d.ts +23 -0
- package/dist/recipes/buttonGroup.d.ts.map +1 -0
- package/dist/recipes/buttonGroup.js +81 -0
- package/dist/recipes/buttonGroup.js.map +1 -0
- package/dist/recipes/calendar.d.ts +57 -0
- package/dist/recipes/calendar.d.ts.map +1 -0
- package/dist/recipes/calendar.js +265 -0
- package/dist/recipes/calendar.js.map +1 -0
- package/dist/recipes/card.d.ts +116 -0
- package/dist/recipes/card.d.ts.map +1 -0
- package/dist/recipes/card.js +368 -0
- package/dist/recipes/card.js.map +1 -0
- package/dist/recipes/carousel.d.ts +21 -0
- package/dist/recipes/carousel.d.ts.map +1 -0
- package/dist/recipes/carousel.js +187 -0
- package/dist/recipes/carousel.js.map +1 -0
- package/dist/recipes/cascadeSelect.d.ts +49 -0
- package/dist/recipes/cascadeSelect.d.ts.map +1 -0
- package/dist/recipes/cascadeSelect.js +171 -0
- package/dist/recipes/cascadeSelect.js.map +1 -0
- package/dist/recipes/chart.d.ts +66 -0
- package/dist/recipes/chart.d.ts.map +1 -0
- package/dist/recipes/chart.js +258 -0
- package/dist/recipes/chart.js.map +1 -0
- package/dist/recipes/chatMessage.d.ts +45 -0
- package/dist/recipes/chatMessage.d.ts.map +1 -0
- package/dist/recipes/chatMessage.js +189 -0
- package/dist/recipes/chatMessage.js.map +1 -0
- package/dist/recipes/checkboxGroup.d.ts +29 -0
- package/dist/recipes/checkboxGroup.d.ts.map +1 -0
- package/dist/recipes/checkboxGroup.js +114 -0
- package/dist/recipes/checkboxGroup.js.map +1 -0
- package/dist/recipes/codeBlock.d.ts +11 -0
- package/dist/recipes/codeBlock.d.ts.map +1 -0
- package/dist/recipes/codeBlock.js +91 -0
- package/dist/recipes/codeBlock.js.map +1 -0
- package/dist/recipes/colorPicker.d.ts +36 -0
- package/dist/recipes/colorPicker.d.ts.map +1 -0
- package/dist/recipes/colorPicker.js +192 -0
- package/dist/recipes/colorPicker.js.map +1 -0
- package/dist/recipes/combobox.d.ts +61 -0
- package/dist/recipes/combobox.d.ts.map +1 -0
- package/dist/recipes/combobox.js +129 -0
- package/dist/recipes/combobox.js.map +1 -0
- package/dist/recipes/command.d.ts +33 -0
- package/dist/recipes/command.d.ts.map +1 -0
- package/dist/recipes/command.js +201 -0
- package/dist/recipes/command.js.map +1 -0
- package/dist/recipes/datePicker.d.ts +17 -0
- package/dist/recipes/datePicker.d.ts.map +1 -0
- package/dist/recipes/datePicker.js +54 -0
- package/dist/recipes/datePicker.js.map +1 -0
- package/dist/recipes/design.d.ts +721 -0
- package/dist/recipes/design.d.ts.map +1 -0
- package/dist/recipes/design.js +348 -0
- package/dist/recipes/design.js.map +1 -0
- package/dist/recipes/dialog.d.ts +34 -0
- package/dist/recipes/dialog.d.ts.map +1 -0
- package/dist/recipes/dialog.js +130 -0
- package/dist/recipes/dialog.js.map +1 -0
- package/dist/recipes/drawer.d.ts +26 -0
- package/dist/recipes/drawer.d.ts.map +1 -0
- package/dist/recipes/drawer.js +135 -0
- package/dist/recipes/drawer.js.map +1 -0
- package/dist/recipes/empty.d.ts +40 -0
- package/dist/recipes/empty.d.ts.map +1 -0
- package/dist/recipes/empty.js +94 -0
- package/dist/recipes/empty.js.map +1 -0
- package/dist/recipes/field.d.ts +84 -0
- package/dist/recipes/field.d.ts.map +1 -0
- package/dist/recipes/field.js +190 -0
- package/dist/recipes/field.js.map +1 -0
- package/dist/recipes/figure.d.ts +12 -0
- package/dist/recipes/figure.d.ts.map +1 -0
- package/dist/recipes/figure.js +33 -0
- package/dist/recipes/figure.js.map +1 -0
- package/dist/recipes/fileDrop.d.ts +5 -0
- package/dist/recipes/fileDrop.d.ts.map +1 -0
- package/dist/recipes/fileDrop.js +35 -0
- package/dist/recipes/fileDrop.js.map +1 -0
- package/dist/recipes/floatingPanel.d.ts +24 -0
- package/dist/recipes/floatingPanel.d.ts.map +1 -0
- package/dist/recipes/floatingPanel.js +214 -0
- package/dist/recipes/floatingPanel.js.map +1 -0
- package/dist/recipes/hoverCard.d.ts +13 -0
- package/dist/recipes/hoverCard.d.ts.map +1 -0
- package/dist/recipes/hoverCard.js +60 -0
- package/dist/recipes/hoverCard.js.map +1 -0
- package/dist/recipes/icon.d.ts +16 -0
- package/dist/recipes/icon.d.ts.map +1 -0
- package/dist/recipes/icon.js +36 -0
- package/dist/recipes/icon.js.map +1 -0
- package/dist/recipes/image.d.ts +51 -0
- package/dist/recipes/image.d.ts.map +1 -0
- package/dist/recipes/image.js +72 -0
- package/dist/recipes/image.js.map +1 -0
- package/dist/recipes/imageCropper.d.ts +43 -0
- package/dist/recipes/imageCropper.d.ts.map +1 -0
- package/dist/recipes/imageCropper.js +220 -0
- package/dist/recipes/imageCropper.js.map +1 -0
- package/dist/recipes/index.d.ts +80 -0
- package/dist/recipes/index.js +80 -0
- package/dist/recipes/inputCopy.d.ts +9 -0
- package/dist/recipes/inputCopy.d.ts.map +1 -0
- package/dist/recipes/inputCopy.js +76 -0
- package/dist/recipes/inputCopy.js.map +1 -0
- package/dist/recipes/item.d.ts +52 -0
- package/dist/recipes/item.d.ts.map +1 -0
- package/dist/recipes/item.js +139 -0
- package/dist/recipes/item.js.map +1 -0
- package/dist/recipes/kbd.d.ts +6 -0
- package/dist/recipes/kbd.d.ts.map +1 -0
- package/dist/recipes/kbd.js +42 -0
- package/dist/recipes/kbd.js.map +1 -0
- package/dist/recipes/label.d.ts +4 -0
- package/dist/recipes/label.d.ts.map +1 -0
- package/dist/recipes/label.js +19 -0
- package/dist/recipes/label.js.map +1 -0
- package/dist/recipes/listbox.d.ts +85 -0
- package/dist/recipes/listbox.d.ts.map +1 -0
- package/dist/recipes/listbox.js +158 -0
- package/dist/recipes/listbox.js.map +1 -0
- package/dist/recipes/marquee.d.ts +26 -0
- package/dist/recipes/marquee.d.ts.map +1 -0
- package/dist/recipes/marquee.js +107 -0
- package/dist/recipes/marquee.js.map +1 -0
- package/dist/recipes/menu.d.ts +32 -0
- package/dist/recipes/menu.d.ts.map +1 -0
- package/dist/recipes/menu.js +110 -0
- package/dist/recipes/menu.js.map +1 -0
- package/dist/recipes/menubar.d.ts +36 -0
- package/dist/recipes/menubar.d.ts.map +1 -0
- package/dist/recipes/menubar.js +40 -0
- package/dist/recipes/menubar.js.map +1 -0
- package/dist/recipes/messageScroller.d.ts +7 -0
- package/dist/recipes/messageScroller.d.ts.map +1 -0
- package/dist/recipes/messageScroller.js +82 -0
- package/dist/recipes/messageScroller.js.map +1 -0
- package/dist/recipes/meter.d.ts +7 -0
- package/dist/recipes/meter.d.ts.map +1 -0
- package/dist/recipes/meter.js +38 -0
- package/dist/recipes/meter.js.map +1 -0
- package/dist/recipes/nav.d.ts +29 -0
- package/dist/recipes/nav.d.ts.map +1 -0
- package/dist/recipes/nav.js +173 -0
- package/dist/recipes/nav.js.map +1 -0
- package/dist/recipes/numberField.d.ts +10 -0
- package/dist/recipes/numberField.d.ts.map +1 -0
- package/dist/recipes/numberField.js +80 -0
- package/dist/recipes/numberField.js.map +1 -0
- package/dist/recipes/otpField.d.ts +8 -0
- package/dist/recipes/otpField.d.ts.map +1 -0
- package/dist/recipes/otpField.js +81 -0
- package/dist/recipes/otpField.js.map +1 -0
- package/dist/recipes/pagination.d.ts +28 -0
- package/dist/recipes/pagination.d.ts.map +1 -0
- package/dist/recipes/pagination.js +104 -0
- package/dist/recipes/pagination.js.map +1 -0
- package/dist/recipes/passwordInput.d.ts +26 -0
- package/dist/recipes/passwordInput.d.ts.map +1 -0
- package/dist/recipes/passwordInput.js +87 -0
- package/dist/recipes/passwordInput.js.map +1 -0
- package/dist/recipes/popover.d.ts +46 -0
- package/dist/recipes/popover.d.ts.map +1 -0
- package/dist/recipes/popover.js +124 -0
- package/dist/recipes/popover.js.map +1 -0
- package/dist/recipes/popup.d.ts +48 -0
- package/dist/recipes/popup.d.ts.map +1 -0
- package/dist/recipes/popup.js +147 -0
- package/dist/recipes/popup.js.map +1 -0
- package/dist/recipes/progress.d.ts +69 -0
- package/dist/recipes/progress.d.ts.map +1 -0
- package/dist/recipes/progress.js +197 -0
- package/dist/recipes/progress.js.map +1 -0
- package/dist/recipes/qrCode.d.ts +27 -0
- package/dist/recipes/qrCode.d.ts.map +1 -0
- package/dist/recipes/qrCode.js +69 -0
- package/dist/recipes/qrCode.js.map +1 -0
- package/dist/recipes/questionnaire.d.ts +30 -0
- package/dist/recipes/questionnaire.d.ts.map +1 -0
- package/dist/recipes/questionnaire.js +105 -0
- package/dist/recipes/questionnaire.js.map +1 -0
- package/dist/recipes/radio.d.ts +38 -0
- package/dist/recipes/radio.d.ts.map +1 -0
- package/dist/recipes/radio.js +109 -0
- package/dist/recipes/radio.js.map +1 -0
- package/dist/recipes/rating.d.ts +39 -0
- package/dist/recipes/rating.d.ts.map +1 -0
- package/dist/recipes/rating.js +98 -0
- package/dist/recipes/rating.js.map +1 -0
- package/dist/recipes/resizable.d.ts +15 -0
- package/dist/recipes/resizable.d.ts.map +1 -0
- package/dist/recipes/resizable.js +91 -0
- package/dist/recipes/resizable.js.map +1 -0
- package/dist/recipes/scrollArea.d.ts +21 -0
- package/dist/recipes/scrollArea.d.ts.map +1 -0
- package/dist/recipes/scrollArea.js +60 -0
- package/dist/recipes/scrollArea.js.map +1 -0
- package/dist/recipes/scrollBars.d.ts +13 -0
- package/dist/recipes/scrollBars.d.ts.map +1 -0
- package/dist/recipes/scrollBars.js +90 -0
- package/dist/recipes/scrollBars.js.map +1 -0
- package/dist/recipes/segmented.d.ts +46 -0
- package/dist/recipes/segmented.d.ts.map +1 -0
- package/dist/recipes/segmented.js +153 -0
- package/dist/recipes/segmented.js.map +1 -0
- package/dist/recipes/select.d.ts +26 -0
- package/dist/recipes/select.d.ts.map +1 -0
- package/dist/recipes/select.js +74 -0
- package/dist/recipes/select.js.map +1 -0
- package/dist/recipes/separator.d.ts +51 -0
- package/dist/recipes/separator.d.ts.map +1 -0
- package/dist/recipes/separator.js +100 -0
- package/dist/recipes/separator.js.map +1 -0
- package/dist/recipes/sheet.d.ts +48 -0
- package/dist/recipes/sheet.d.ts.map +1 -0
- package/dist/recipes/sheet.js +227 -0
- package/dist/recipes/sheet.js.map +1 -0
- package/dist/recipes/sidebar.d.ts +38 -0
- package/dist/recipes/sidebar.d.ts.map +1 -0
- package/dist/recipes/sidebar.js +332 -0
- package/dist/recipes/sidebar.js.map +1 -0
- package/dist/recipes/signaturePad.d.ts +38 -0
- package/dist/recipes/signaturePad.d.ts.map +1 -0
- package/dist/recipes/signaturePad.js +138 -0
- package/dist/recipes/signaturePad.js.map +1 -0
- package/dist/recipes/skeleton.d.ts +23 -0
- package/dist/recipes/skeleton.d.ts.map +1 -0
- package/dist/recipes/skeleton.js +92 -0
- package/dist/recipes/skeleton.js.map +1 -0
- package/dist/recipes/slider.d.ts +67 -0
- package/dist/recipes/slider.d.ts.map +1 -0
- package/dist/recipes/slider.js +289 -0
- package/dist/recipes/slider.js.map +1 -0
- package/dist/recipes/spinner.d.ts +53 -0
- package/dist/recipes/spinner.d.ts.map +1 -0
- package/dist/recipes/spinner.js +140 -0
- package/dist/recipes/spinner.js.map +1 -0
- package/dist/recipes/steps.d.ts +59 -0
- package/dist/recipes/steps.d.ts.map +1 -0
- package/dist/recipes/steps.js +283 -0
- package/dist/recipes/steps.js.map +1 -0
- package/dist/recipes/table.d.ts +54 -0
- package/dist/recipes/table.d.ts.map +1 -0
- package/dist/recipes/table.js +191 -0
- package/dist/recipes/table.js.map +1 -0
- package/dist/recipes/tabs.d.ts +42 -0
- package/dist/recipes/tabs.d.ts.map +1 -0
- package/dist/recipes/tabs.js +188 -0
- package/dist/recipes/tabs.js.map +1 -0
- package/dist/recipes/tagsInput.d.ts +16 -0
- package/dist/recipes/tagsInput.d.ts.map +1 -0
- package/dist/recipes/tagsInput.js +125 -0
- package/dist/recipes/tagsInput.js.map +1 -0
- package/dist/recipes/thinkingIndicator.d.ts +44 -0
- package/dist/recipes/thinkingIndicator.d.ts.map +1 -0
- package/dist/recipes/thinkingIndicator.js +152 -0
- package/dist/recipes/thinkingIndicator.js.map +1 -0
- package/dist/recipes/thinkingSteps.d.ts +30 -0
- package/dist/recipes/thinkingSteps.d.ts.map +1 -0
- package/dist/recipes/thinkingSteps.js +158 -0
- package/dist/recipes/thinkingSteps.js.map +1 -0
- package/dist/recipes/timer.d.ts +43 -0
- package/dist/recipes/timer.d.ts.map +1 -0
- package/dist/recipes/timer.js +108 -0
- package/dist/recipes/timer.js.map +1 -0
- package/dist/recipes/toast.d.ts +22 -0
- package/dist/recipes/toast.d.ts.map +1 -0
- package/dist/recipes/toast.js +239 -0
- package/dist/recipes/toast.js.map +1 -0
- package/dist/recipes/toggle.d.ts +53 -0
- package/dist/recipes/toggle.d.ts.map +1 -0
- package/dist/recipes/toggle.js +143 -0
- package/dist/recipes/toggle.js.map +1 -0
- package/dist/recipes/tooltip.d.ts +14 -0
- package/dist/recipes/tooltip.d.ts.map +1 -0
- package/dist/recipes/tooltip.js +50 -0
- package/dist/recipes/tooltip.js.map +1 -0
- package/dist/recipes/tour.d.ts +15 -0
- package/dist/recipes/tour.d.ts.map +1 -0
- package/dist/recipes/tour.js +109 -0
- package/dist/recipes/tour.js.map +1 -0
- package/dist/recipes/treeView.d.ts +19 -0
- package/dist/recipes/treeView.d.ts.map +1 -0
- package/dist/recipes/treeView.js +150 -0
- package/dist/recipes/treeView.js.map +1 -0
- package/dist/recipes/typography.d.ts +52 -0
- package/dist/recipes/typography.d.ts.map +1 -0
- package/dist/recipes/typography.js +88 -0
- package/dist/recipes/typography.js.map +1 -0
- package/dist/recipes/virtualList.d.ts +7 -0
- package/dist/recipes/virtualList.d.ts.map +1 -0
- package/dist/recipes/virtualList.js +39 -0
- package/dist/recipes/virtualList.js.map +1 -0
- package/dist/resizable.d.ts +89 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +153 -0
- package/dist/resizable.js.map +1 -0
- package/dist/resolve.d.ts +15 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +19 -0
- package/dist/resolve.js.map +1 -0
- package/dist/scrollArea.d.ts +38 -0
- package/dist/scrollArea.d.ts.map +1 -0
- package/dist/scrollArea.js +42 -0
- package/dist/scrollArea.js.map +1 -0
- package/dist/segmented.d.ts +75 -0
- package/dist/segmented.d.ts.map +1 -0
- package/dist/segmented.js +120 -0
- package/dist/segmented.js.map +1 -0
- package/dist/select.d.ts +21 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +29 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +36 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +37 -0
- package/dist/separator.js.map +1 -0
- package/dist/sheet.d.ts +190 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +292 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sidebar.d.ts +337 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +480 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/signaturePad.d.ts +272 -0
- package/dist/signaturePad.d.ts.map +1 -0
- package/dist/signaturePad.js +522 -0
- package/dist/signaturePad.js.map +1 -0
- package/dist/skeleton.d.ts +43 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +61 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.d.ts +116 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +219 -0
- package/dist/slider.js.map +1 -0
- package/dist/spinner.d.ts +34 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +30 -0
- package/dist/spinner.js.map +1 -0
- package/dist/steps.d.ts +60 -0
- package/dist/steps.d.ts.map +1 -0
- package/dist/steps.js +67 -0
- package/dist/steps.js.map +1 -0
- package/dist/switch.d.ts +18 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +32 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.d.ts +127 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +165 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +106 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +156 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tagsInput.d.ts +129 -0
- package/dist/tagsInput.d.ts.map +1 -0
- package/dist/tagsInput.js +225 -0
- package/dist/tagsInput.js.map +1 -0
- package/dist/textarea.d.ts +101 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +131 -0
- package/dist/textarea.js.map +1 -0
- package/dist/thinkingIndicator.d.ts +39 -0
- package/dist/thinkingIndicator.d.ts.map +1 -0
- package/dist/thinkingIndicator.js +40 -0
- package/dist/thinkingIndicator.js.map +1 -0
- package/dist/thinkingSteps.d.ts +92 -0
- package/dist/thinkingSteps.d.ts.map +1 -0
- package/dist/thinkingSteps.js +137 -0
- package/dist/thinkingSteps.js.map +1 -0
- package/dist/timer.d.ts +154 -0
- package/dist/timer.d.ts.map +1 -0
- package/dist/timer.js +305 -0
- package/dist/timer.js.map +1 -0
- package/dist/toast.d.ts +301 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +763 -0
- package/dist/toast.js.map +1 -0
- package/dist/toastUtils.d.ts +5 -0
- package/dist/toastUtils.d.ts.map +1 -0
- package/dist/toastUtils.js +32 -0
- package/dist/toastUtils.js.map +1 -0
- package/dist/toastView.d.ts +1431 -0
- package/dist/toastView.d.ts.map +1 -0
- package/dist/toastView.js +169 -0
- package/dist/toastView.js.map +1 -0
- package/dist/tooltip.d.ts +41 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +62 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/touch.d.ts +13 -0
- package/dist/touch.d.ts.map +1 -0
- package/dist/touch.js +23 -0
- package/dist/touch.js.map +1 -0
- package/dist/tour.d.ts +186 -0
- package/dist/tour.d.ts.map +1 -0
- package/dist/tour.js +344 -0
- package/dist/tour.js.map +1 -0
- package/dist/treeView.d.ts +138 -0
- package/dist/treeView.d.ts.map +1 -0
- package/dist/treeView.js +328 -0
- package/dist/treeView.js.map +1 -0
- package/dist/typography.d.ts +34 -0
- package/dist/typography.d.ts.map +1 -0
- package/dist/typography.js +29 -0
- package/dist/typography.js.map +1 -0
- package/dist/virtualList.d.ts +48 -0
- package/dist/virtualList.d.ts.map +1 -0
- package/dist/virtualList.js +65 -0
- package/dist/virtualList.js.map +1 -0
- package/package.json +16 -16
- package/dist/index.d.mts +0 -14341
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -28685
- package/dist/index.mjs.map +0 -1
- package/dist/rolldown-runtime-D8jQpDG7.mjs +0 -12
package/README.md
CHANGED
|
@@ -510,6 +510,7 @@ glyph with it, so the recipe's size is the drawing's.
|
|
|
510
510
|
| `Accordion` | `{ id, items: { id, title, content, disabled? }[], open, onToggle, headingLevel? }`; `Accordion.toggled(open, id, { multiple?, collapsible? })` is the transition `update` applies, the open ids being the application's. Each trigger is a button in a heading naming its panel; a shut panel stays drawn and `inert`. The panel opens on a `0fr`-`1fr` grid row, the chevron turns, and the open title turns semibold in its own width. The view takes an `icon` in place of the recipe's. | `variant`: `plain` (default), `bordered`, `separated`, `filled`, `ghost`; `separators`: `on` (default, between sections only), `off`; `indicator`: `chevron` (default), `plus`; `indicatorPosition`: `end` (default), `start`; `active`: `none` (default), `trigger`, `item` (the open section tinted). Slots `root`, `item`, `heading`, `trigger`, `label`, `chevron`, `icon`, `panel`, `body`, `content`. |
|
|
511
511
|
| `Alert` | `{ layout, title, description?, icon?, actions?, onDismiss?, dismissLabel? }`, and by `layout`: `'inline'` takes `assertive?` and is a live region inside the content, of something that just happened (`role="alert"` when assertive, `role="status"` otherwise); `'banner'` takes `label` and is a full-width strip across a page or a section, there on load, so a `section` landmark named by `label` rather than a live region, which would say nothing on load. Each action is `{ label, href }` (a link) or `{ label, onClick }` (a button); `onDismiss` draws a close button named `Dismiss <title>` inline, `Dismiss <label>` as a banner. The icon is `aria-hidden`. Whether it shows is the application's. The root writes `data-layout` and `data-dismissible`. | `tone`: `info` (default), `success`, `warning`, `error`; `emphasis`: `subtle` (default, the family's tint) or `bold` (its fill). Slots `root`, `icon`, `title`, `description`, `actions`, `action`, `dismiss`. |
|
|
512
512
|
| `AngleSlider` | After Zag's: a dial in degrees, 0 at the top and clockwise. `AngleSlider.init({ id, value? })` is the angle and the drag, folded with `AngleSlider.update(layout)`, where `layout` (`step`, `largeStep`, `marks`, `restrictToMarks`) is the object the view spreads in too: `AngleSlider.view({ ...layout, model, onMessage, label, name?, format?, valueText?, showValue?, disabled?, readOnly?, invalid?, style? }, h)`. A press or drag on the dial sends `Pointed` and `Released`; the APG's slider keys reach `update` as what was pressed, and go round past 0. A `name` draws a hidden input for a form. | `tone`, `track` (`ring`, `plain`, `disc`), `value` (`inside`, `below`), `size`. Slots `root`, `label`, `control`, `needle`, `thumb`, `markers`, `marker`, `markerLabel`, `value`, `input`. |
|
|
513
|
+
| `AppShell` | An application's page frame: `AppShell.view({ title, brand?, status?, actions?, side?, footer?, mainId?, words? }, main, h)`. A skip link to the main region, a header bar (the banner) with the title and, at its end, `status` and `actions` (components: `Segmented`, `Badge`, `Avatar`), an optional side column for a `Sidebar`'s view, the main region (`id` `main` by default, focusable by script so the skip link moves focus there), and a footer. It holds no state and sends no Message; a `Sidebar` in `side` brings its own navigation landmark, collapse and phone Sheet. The header and the side column stay in view while the page scrolls; below `md` the side column, by then a Sidebar's opener, sits at the start of the header's row. `Patterns.AppShell` is its contract. | `width`: `full` (default) or `contained` (the main region's content kept to the theme's `width.page`, centred). Slots `root`, `skip`, `header`, `brand`, `mark`, `title`, `status`, `actions`, `side`, `main`, `footer`. |
|
|
513
514
|
| `AspectRatio` | `{ content? }`. Slot `frame`. | `ratio`: `square` (default), `video` (16/9), `portrait` (3/4). The corner reads `radius`. |
|
|
514
515
|
| `Avatar` | `{ name, src?, initials?, status?, statusLabel? }`. The root is one `role="img"` named by the person (and the status, "Ada Lovelace, Online"); initials show until the picture covers them, the picture's alt empty. `status` (`online`, `away`, `busy`, `offline`) is a dot on the lower end corner. `src` may be an `AvatarPicture` (`{ asset, provider, width }` from `foldkit-media`): the picture is drawn with its 1x and 2x candidates at `width` CSS pixels, and a provider with no URL for it leaves the initials. `Avatar.widthOf(size)` is a size's width in CSS pixels, for that `width`. `Avatar.group({ people, max?, label?, moreLabel?, style?, avatarStyle? })` overlaps them, each ringed in the page, and counts the rest as one more avatar. An avatar beside a name and a line is an `Item` with the avatar as its media. | `size`: `xs`, `sm`, `md` (default), `lg`, `xl`; `shape`: `circle` (default), `rounded`, `square`; `color`: `neutral` (default) or `name` (initials in a hue from the name); `ring`: `none`, `page`, `accent`. Slots `root`, `fallback`, `image`, `status`. `Recipes.AvatarGroup({ overlap: 'tight' \| 'loose' \| 'none' })` over `AvatarGroupSlots` (`root`). |
|
|
515
516
|
| `Figure` | `{ content, caption? }`: a `figure` holding its content (an `Image.view`, a chart, a code block), then its caption in a `figcaption`, which names the figure for assistive technology by itself; no caption, no `figcaption`. | `align`: `start` (default) or `center`. The caption is the `caption` role, muted. Slots `root`, `caption`. |
|
|
@@ -520,7 +521,7 @@ glyph with it, so the recipe's size is the drawing's.
|
|
|
520
521
|
| `Calendar` | One date system, inline: `Calendar.Selection` is `Single`, `Range` or `Multiple`, owned by the application (`Calendar.empty(mode)`, fold each `SelectedDate` through `Calendar.picked`, `Calendar.isComplete` says when a picker may close). Spread `Calendar.inputs(selection, mixins, { h })` into upstream `Calendar.view`'s inputs: its `toView` (`Calendar.toView(selection, mixins, { h })`) marks each chosen day `aria-selected`, a range's ends `data-selected` with `data-range-start`/`data-range-end` and every day between `data-in-range`, and its `maybeSelectedDate` (`Calendar.selectedDate(selection)`, a Single selection's day) agrees with it. The grid of a Range or Multiple selection is `aria-multiselectable`. A selection in a popover is the DatePicker's. Options, the fourth argument of `toView`, `inputs` and `resolve` (`CalendarOptions`): `weekNumbers`, `caption: 'label'` or `dropdowns: { model, onShow }` (month and year selects; answer `onShow` with `Calendar.show`), `paging` with `Calendar.alongside(model, other, offset)` for two months side by side, `preview: { date, onPreview }` for a range under the pointer, and `detail: date => Option<string>` for a line under a day's number (a price, "2 events") that describes its button; `ResolvedDayCell.detail` holds it. `ResolvedDays`' paging buttons are `Option`s and its heading is a `caption` (`Grid`, `Label`, `Dropdowns`). Presets: `Calendar.lastDays`, `nextDays`, `monthOf`, `day`, drawn by `Calendar.presetsView`. `Calendar.localeOf('de-DE')` reads upstream's `locale` from Intl. | `size` (the Calendar's); `outside`: `shown` (default), `hidden`; `detail`: `text` (a taller rounded day holding the line), `dot` (the line as a dot, its words left to a screen reader), unset by default. Slots `CalendarSlots`. |
|
|
521
522
|
| `Card` | `{ title?, description?, content?, image?, media?, action?, footer?, press?, label?, selected?, disabled?, dismiss? }`. `press` is `{ onClick }` or `{ href, external? }`: one button or link stretched over the card, named by `label` or the title (a pressable card with neither throws); `action`, `footer` and the dismiss button stay pressable above it. `selected` is `aria-pressed` on the button, `aria-current` on the link. `dismiss: { onDismiss, label?, always? }` is revealed on hover and focus unless `always`, and always on a touch screen. The root carries `data-selected`, `data-disabled`, `data-pressable`, `data-dismissible` (the header then keeps clear of the button). | `orientation`: `stacked` (default), `inline` (image or media leading, footer trailing). An `image` bleeds to the card's edges (16:9 when stacked); `media` puts a bare icon (`svg`, `img`) in a tile and lets anything else, an Avatar say, lead at its own size. `surface`: `outlined` (default), `elevated`, `filled`, `plain`. `padding`: `compact`, `comfortable` (default), `roomy`, `flush`. `elevation`: `0` to `3`, a step of the surface ladder (lighter in a dark scheme; a contact and an ambient shadow in a light one). `lift`: `none` (default) or `hover`, a lift under the pointer that `travel` stills (not in a `Card.group` with a highlight, which is the hover there). `Card.overlay` is the stretched press control, shared with Item. Slots `root`, `image`, `media`, `header`, `title`, `description`, `action`, `content`, `footer`, `overlay`, `dismiss`. |
|
|
522
523
|
| `Card.group` | `{ cards: (CardView & { key })[], columns?, fluidHover?, label?, cardStyle? }`. A keyed list of cards in up to `columns` (default 1), which wraps to fewer where a column would be narrower than the recipe's `minColumn`; the root carries `--fk-card-columns` and `data-card-fluid`. With `fluidHover` (default) one highlight follows the pointer to the nearest card through `FluidHover` from `foldkit-primitives/dom`, reading both directions when there is more than one column, and a press in a gap presses the highlighted card. `cardStyle` styles every card that names no style of its own. | `Recipes.CardGroup`: `layout`: `divided` (default, hairlines between cards, wherever the row wraps), `separated` (apart, for cards with a surface). `minColumn`: `none`, `sm`, `md` (default), `lg`, the narrowest a column may be (10, 14, 18rem); `none` keeps every column at any width. `border`: `none` (default), `outlined`. The highlight is a film over the card the pointer is on, and is that card's hover: a card in a group with one draws no hover of its own, whatever its `surface`. Divided cards are usually `surface: 'plain'`. Slots `root`, `list`, `item`, `highlight`. |
|
|
523
|
-
| `Carousel` | The APG carousel: `Carousel.init({ id,
|
|
524
|
+
| `Carousel` | The APG carousel: `Carousel.init({ id, index?, autoplay?, delay? })`, folded with `Carousel.update({ count, perView?, loop? })`, drawn with `Carousel.view({ label, model, slides, onMessage, loop?, perView?, picker?, thumbnails?, slideLabel?, previousLabel?, nextLabel?, pickerLabel?, rotationLabels?, style? }, h)`. A group with `aria-roledescription="carousel"`, each slide a group named "2 of 5"; previous and next (`aria-disabled` at the ends unless `loop`), a dot per place the track can rest (or `thumbnails` in their place), and a polite status naming the slide shown. The track is a CSS scroll-snap scroller, so swipes move it natively, and `ScrollSettle` reports where a swipe rests, so the dots follow the finger. Every press, swipe and timer reaches `update`, which returns the `Carousel.ShowSlide` Command that scrolls the track: do not keep the slide yourself. With `autoplay` it moves on every `delay` (4s), the current dot filling as it waits; it pauses under the pointer, stops when focus arrives by the keys, quiets its status while it rotates, and draws the APG's rotation button first. | `peek`: `none` (default) or `edge`. Slots `root`, `track`, `slide`, `controls`, `rotation`, `previous`, `next`, `picker`, `dot`, `thumbnail`, `status`. |
|
|
524
525
|
| `CascadeSelect` | After Zag's: one value chosen as a path of ids through nested options. `CascadeSelect.init({ id })` holds the chosen path and the one the keys are on while open, folded with `CascadeSelect.update(config)` (`config` is `{ nodes, parents?, closeOnSelect?, loop? }`, the same object the view takes): `CascadeSelect.view({ model, config, onMessage, label, placeholder?, levels?, layout?, expandOn?, clearable?, separator?, name?, disabled?, invalid?, direction?, style? }, h)`. The trigger is a combobox opening a top-layer APG tree, a column per level or one level at a time (`layout: 'drill'`; the columns also drill in on their own when they would not fit the window, measured as the popup opens); the arrows move within and between levels (swapped right to left), Home, End and a letter jump, Enter and Space choose, and only an option without children is chosen unless `parents` allows any. | `size`, `trigger` (`outline`, `filled`, `ghost`), `width` (`trigger`, `auto`). Slots `root`, `trigger`, `valueText`, `chevron`, `clear`, `input`, `layer`, `backdrop`, `panel`, `column`, `heading`, `back`, `item`, `itemText`, `branch`. |
|
|
525
526
|
| `Chart` | After shadcn's Chart: `Chart.view({ id, label, kind: 'bar' \| 'line' \| 'area', categories, series: [{ name, values, color? }], model, onMessage, description?, format?, legend?, table?, categoryLabel?, style? }, h)`, or `kind: 'donut'` with `slices: [{ name, value, color? }]` and `totalLabel?`. The value axis's ticks are round and reach both ends, zero included; the plot is drawn in percentages, so it fills its container's width with nothing measured and renders the same on a server. `Chart.Model` (`Chart.init()`, folded with `Chart.update`) holds the lit point: the pointer lights a category's band and its tooltip, and the plot is a tab stop whose arrows, Home and End step through the points while a polite status says each. The drawing is hidden from assistive technology, which reads a data table, visually hidden unless `table: 'shown'`. Series take `chart-1` to `chart-5` in order, or the `color` they name; a sixth series throws. | `height` (`sm`, `md`, `lg`), `grid` (`lines`, `zero`), `indicator` (`dot`, `line`). Slots `root`, `title`, `description`, `legend`, `legendItem`, `swatch`, `body`, `yAxis`, `xAxis`, `yTick`, `xTick`, `plot`, `canvas`, `paths`, `grid`, `cursor`, `bar`, `line`, `area`, `dot`, `slice`, `band`, `center`, `centerValue`, `centerLabel`, `tooltip` and its parts, `status`, `table` and its parts. |
|
|
526
527
|
| `ChatMessage` | One message of a chat: `ChatMessage.view({ from, content, author?, avatar?, time?, status?, onRetry?, actions?, pinActions?, streaming?, style? }, h)`, `from` being `user`, `assistant` or `system`. The user's sits at the end in a bubble, an answer as text at the start. `status` is `sending`, `sent` or `failed`, which draws a retry; `actions` are named buttons (`{ key, label, onClick, icon?, pressed?, disabled? }`) shown on hover and focus unless pinned. A streamed answer is the same message drawn again with more `content` and `streaming: true` (`aria-busy`); its body wraps with `text-wrap: wrap`, so no earlier word moves line. `ChatMessage.group({ items, continues?, style?, messageStyle? }, h)` draws a run, a sender's following messages continued. Markdown is the application's to render (`foldkit-richtext-markdown`'s `parse`, `foldkit-richtext-dom/view`'s `renderDocument`). | `layout` (`chat`, `thread`), `bubble` (`muted`, `accent`), `content` (`text`, `markdown`). `Recipes.ChatMessageGroup` for the group. Slots `root`, `avatar`, `main`, `header`, `author`, `time`, `bubble`, `body`, `footer`, `status`, `retry`, `actions`, `action`. |
|
|
@@ -983,8 +984,9 @@ const TileStyle = Style.forSlots(TileSlots)(
|
|
|
983
984
|
```
|
|
984
985
|
|
|
985
986
|
The icons the components draw themselves (a search field's magnifier, a
|
|
986
|
-
toast's mark, a locked cell's padlock) are the theme's `icon` tokens
|
|
987
|
-
by default. An application's
|
|
987
|
+
toast's mark, a locked cell's padlock) are the theme's `icon` tokens:
|
|
988
|
+
Heroicons' outline set (MIT), restroked to 2px, by default. An application's
|
|
989
|
+
own pack replaces them as its own tokens:
|
|
988
990
|
`AppStyle.make({ theme, tokens: Icons.tokens(pack, { width?, corners? }) })`,
|
|
989
991
|
where `pack` holds an `IconData` for each name the components draw
|
|
990
992
|
(`ChromeIcon` from `foldkit-mixins/theme`; one missing is a type error), and
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Attr, Capability, Event, NamedStyle, Slot, Slots } from "foldkit-mixins";
|
|
2
|
+
import { MixinList } from "./resolve.js";
|
|
3
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
4
|
+
/**
|
|
5
|
+
* An accordion: sections whose headings each show and hide their panel, as
|
|
6
|
+
* the APG accordion pattern has it. Each trigger is a button in a heading,
|
|
7
|
+
* with `aria-expanded` and `aria-controls`; each panel is a region named by
|
|
8
|
+
* its trigger. Which sections are open is the application's, in its Model:
|
|
9
|
+
* the view draws `open` and sends `onToggle`, and `toggled` is the
|
|
10
|
+
* transition `update` applies. A shut panel stays drawn and is `inert`, out
|
|
11
|
+
* of the accessibility tree and the tab order, so its close can animate and
|
|
12
|
+
* `aria-controls` always names a node.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AccordionSlots: Slots.Contract<{
|
|
15
|
+
readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
16
|
+
readonly item: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
17
|
+
readonly heading: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
18
|
+
readonly trigger: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly [Event.EventToken<"click">], readonly [Attr.AttrToken<"aria-expanded">, Attr.AttrToken<"disabled">], readonly Slot.RequirementName[], boolean>;
|
|
19
|
+
readonly label: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
20
|
+
readonly chevron: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
21
|
+
/** The view's own `icon`, drawn in place of the chevron. */
|
|
22
|
+
readonly icon: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
23
|
+
readonly panel: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly [Attr.AttrToken<"role">], readonly Slot.RequirementName[], boolean>;
|
|
24
|
+
/** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */
|
|
25
|
+
readonly body: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
26
|
+
readonly content: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
27
|
+
}>;
|
|
28
|
+
export interface AccordionItem {
|
|
29
|
+
/** Unique within the accordion, and part of its elements' ids. */
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly content: Html | string;
|
|
33
|
+
readonly disabled?: boolean | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface AccordionView<Message> {
|
|
36
|
+
readonly items: ReadonlyArray<AccordionItem>;
|
|
37
|
+
/** The ids of the open sections, as the application keeps them. */
|
|
38
|
+
readonly open: ReadonlyArray<string>;
|
|
39
|
+
/** The Message a press on a section sends; its type comes from `h`. */
|
|
40
|
+
readonly onToggle: (id: string) => NoInfer<Message>;
|
|
41
|
+
/** Prefixes every id the accordion draws, unique on the page. */
|
|
42
|
+
readonly id: string;
|
|
43
|
+
/**
|
|
44
|
+
* Drawn in each row in place of the recipe's chevron or plus, carrying the
|
|
45
|
+
* section's `data-state`; the recipe leaves it still.
|
|
46
|
+
*/
|
|
47
|
+
readonly icon?: Html | undefined;
|
|
48
|
+
/** The level of the headings that hold the triggers, for the page's outline. Default 3. */
|
|
49
|
+
readonly headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
50
|
+
/** A style of `AccordionSlots`, for the accordion's look. */
|
|
51
|
+
readonly style?: NamedStyle<typeof AccordionSlots> | undefined;
|
|
52
|
+
/** Mixins beside the style. */
|
|
53
|
+
readonly mixins?: MixinList<Message> | undefined;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The open sections after `id` is pressed. With `multiple`, any number stay
|
|
57
|
+
* open; otherwise opening one shuts the others. A pressed open section shuts
|
|
58
|
+
* unless it is the only one open and `collapsible` is false (shadcn's and
|
|
59
|
+
* Zag's default for a single accordion is collapsible, and so is this).
|
|
60
|
+
*/
|
|
61
|
+
export declare const toggled: (open: ReadonlyArray<string>, id: string, options?: {
|
|
62
|
+
readonly multiple?: boolean;
|
|
63
|
+
readonly collapsible?: boolean;
|
|
64
|
+
}) => ReadonlyArray<string>;
|
|
65
|
+
export declare const view: <Message>(options: AccordionView<Message>, h: HtmlBuilder<Message>) => Html;
|
|
66
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","names":[],"sources":["../src/accordion.ts"],"mappings":";;;;;;;;;;;;;qBAea,gBAAc,MAAA;;;;;;;;;;;;;;iBAmBV;;WAEN;WACA;WACA,SAAS;WACT;;iBAGM,cAAc;WACpB,OAAO,cAAc;;WAErB,MAAM;;WAEN,WAAW,eAAe,QAAQ;;WAElC;;;;;WAKA,OAAO;;WAEP;;WAEA,QAAQ,kBAAkB;;WAE1B,SAAS,UAAU;;;;;;;;qBASjB,UAAO,MACZ,uBAAqB,YACjB;WACU;WAA6B;MAChD;qBAOU,OAAQ,SAAO,SAAW,cAAc,UAAQ,GAAK,YAAY,aAAW"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Attr, Capability, Event, Slot, SlotView, Slots } from "foldkit-mixins";
|
|
2
|
+
import { flipped } from "./choices.js";
|
|
3
|
+
// src/accordion.ts
|
|
4
|
+
/**
|
|
5
|
+
* An accordion: sections whose headings each show and hide their panel, as
|
|
6
|
+
* the APG accordion pattern has it. Each trigger is a button in a heading,
|
|
7
|
+
* with `aria-expanded` and `aria-controls`; each panel is a region named by
|
|
8
|
+
* its trigger. Which sections are open is the application's, in its Model:
|
|
9
|
+
* the view draws `open` and sends `onToggle`, and `toggled` is the
|
|
10
|
+
* transition `update` applies. A shut panel stays drawn and is `inert`, out
|
|
11
|
+
* of the accessibility tree and the tab order, so its close can animate and
|
|
12
|
+
* `aria-controls` always names a node.
|
|
13
|
+
*/
|
|
14
|
+
const AccordionSlots = Slots.define({
|
|
15
|
+
root: Slot.make({ capability: Capability.Container }),
|
|
16
|
+
item: Slot.make({ capability: Capability.Container }),
|
|
17
|
+
heading: Slot.make({ capability: Capability.Container }),
|
|
18
|
+
trigger: Slot.make({
|
|
19
|
+
capability: Capability.Interactive,
|
|
20
|
+
events: [Event.Click],
|
|
21
|
+
attributes: [Attr.AriaExpanded, Attr.Disabled]
|
|
22
|
+
}),
|
|
23
|
+
label: Slot.make({ capability: Capability.Container }),
|
|
24
|
+
chevron: Slot.make({ capability: Capability.Container }),
|
|
25
|
+
/** The view's own `icon`, drawn in place of the chevron. */
|
|
26
|
+
icon: Slot.make({ capability: Capability.Container }),
|
|
27
|
+
panel: Slot.make({
|
|
28
|
+
capability: Capability.Container,
|
|
29
|
+
attributes: [Attr.Role]
|
|
30
|
+
}),
|
|
31
|
+
/** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */
|
|
32
|
+
body: Slot.make({ capability: Capability.Container }),
|
|
33
|
+
content: Slot.make({ capability: Capability.Container })
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* The open sections after `id` is pressed. With `multiple`, any number stay
|
|
37
|
+
* open; otherwise opening one shuts the others. A pressed open section shuts
|
|
38
|
+
* unless it is the only one open and `collapsible` is false (shadcn's and
|
|
39
|
+
* Zag's default for a single accordion is collapsible, and so is this).
|
|
40
|
+
*/
|
|
41
|
+
const toggled = (open, id, options = {}) => {
|
|
42
|
+
const isOpen = open.includes(id);
|
|
43
|
+
if (options.multiple === true) return flipped(open, id);
|
|
44
|
+
if (!isOpen) return [id];
|
|
45
|
+
return options.collapsible === false ? open : [];
|
|
46
|
+
};
|
|
47
|
+
const view = (options, h) => {
|
|
48
|
+
const builders = SlotView.buildersFor(AccordionSlots, [...options.style === void 0 ? [] : [options.style.mixin], ...options.mixins ?? []], {
|
|
49
|
+
input: void 0,
|
|
50
|
+
h
|
|
51
|
+
});
|
|
52
|
+
const open = new Set(options.open);
|
|
53
|
+
const heading = (children) => {
|
|
54
|
+
const attrs = builders.heading.attrs();
|
|
55
|
+
switch (options.headingLevel ?? 3) {
|
|
56
|
+
case 2: return h.h2(attrs, children);
|
|
57
|
+
case 4: return h.h4(attrs, children);
|
|
58
|
+
case 5: return h.h5(attrs, children);
|
|
59
|
+
case 6: return h.h6(attrs, children);
|
|
60
|
+
default: return h.h3(attrs, children);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return h.div(builders.root.attrs(), options.items.map((item) => {
|
|
64
|
+
const shown = open.has(item.id);
|
|
65
|
+
const state = h.DataAttribute("state", shown ? "open" : "closed");
|
|
66
|
+
const triggerId = `${options.id}-${item.id}-trigger`;
|
|
67
|
+
const panelId = `${options.id}-${item.id}-panel`;
|
|
68
|
+
const disabled = item.disabled === true;
|
|
69
|
+
return h.keyed("div")(item.id, builders.item.attrs([state]), [heading([h.button(builders.trigger.attrs([
|
|
70
|
+
h.Type("button"),
|
|
71
|
+
h.Id(triggerId),
|
|
72
|
+
h.AriaExpanded(shown),
|
|
73
|
+
h.AriaControls(panelId),
|
|
74
|
+
state,
|
|
75
|
+
...disabled ? [h.Disabled(true)] : [h.OnClick(options.onToggle(item.id))]
|
|
76
|
+
]), [h.span(builders.label.attrs([h.DataAttribute("label", item.title)]), [item.title]), options.icon === void 0 ? h.span(builders.chevron.attrs([h.AriaHidden(true)]), []) : h.span(builders.icon.attrs([h.AriaHidden(true), state]), [options.icon])])]), h.div(builders.panel.attrs([
|
|
77
|
+
h.Id(panelId),
|
|
78
|
+
h.Role("region"),
|
|
79
|
+
h.AriaLabelledBy(triggerId),
|
|
80
|
+
state,
|
|
81
|
+
...shown ? [] : [h.Attribute("inert", "")]
|
|
82
|
+
]), [h.div(builders.body.attrs(), [h.div(builders.content.attrs(), [item.content])])])]);
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
export { AccordionSlots, toggled, view };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","names":[],"sources":["../src/accordion.ts"],"sourcesContent":["import { Attr, Capability, Event, Slot, Slots, SlotView, type NamedStyle } from 'foldkit-mixins'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport { flipped } from './choices.js'\nimport type { MixinList } from './resolve.js'\n\n/**\n * An accordion: sections whose headings each show and hide their panel, as\n * the APG accordion pattern has it. Each trigger is a button in a heading,\n * with `aria-expanded` and `aria-controls`; each panel is a region named by\n * its trigger. Which sections are open is the application's, in its Model:\n * the view draws `open` and sends `onToggle`, and `toggled` is the\n * transition `update` applies. A shut panel stays drawn and is `inert`, out\n * of the accessibility tree and the tab order, so its close can animate and\n * `aria-controls` always names a node.\n */\nexport const AccordionSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container }),\n item: Slot.make({ capability: Capability.Container }),\n heading: Slot.make({ capability: Capability.Container }),\n trigger: Slot.make({\n capability: Capability.Interactive,\n events: [Event.Click],\n attributes: [Attr.AriaExpanded, Attr.Disabled],\n }),\n label: Slot.make({ capability: Capability.Container }),\n chevron: Slot.make({ capability: Capability.Container }),\n /** The view's own `icon`, drawn in place of the chevron. */\n icon: Slot.make({ capability: Capability.Container }),\n panel: Slot.make({ capability: Capability.Container, attributes: [Attr.Role] }),\n /** The panel's one grid row, with no padding of its own, so it can shrink to nothing. */\n body: Slot.make({ capability: Capability.Container }),\n content: Slot.make({ capability: Capability.Container }),\n})\n\nexport interface AccordionItem {\n /** Unique within the accordion, and part of its elements' ids. */\n readonly id: string\n readonly title: string\n readonly content: Html | string\n readonly disabled?: boolean | undefined\n}\n\nexport interface AccordionView<Message> {\n readonly items: ReadonlyArray<AccordionItem>\n /** The ids of the open sections, as the application keeps them. */\n readonly open: ReadonlyArray<string>\n /** The Message a press on a section sends; its type comes from `h`. */\n readonly onToggle: (id: string) => NoInfer<Message>\n /** Prefixes every id the accordion draws, unique on the page. */\n readonly id: string\n /**\n * Drawn in each row in place of the recipe's chevron or plus, carrying the\n * section's `data-state`; the recipe leaves it still.\n */\n readonly icon?: Html | undefined\n /** The level of the headings that hold the triggers, for the page's outline. Default 3. */\n readonly headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined\n /** A style of `AccordionSlots`, for the accordion's look. */\n readonly style?: NamedStyle<typeof AccordionSlots> | undefined\n /** Mixins beside the style. */\n readonly mixins?: MixinList<Message> | undefined\n}\n\n/**\n * The open sections after `id` is pressed. With `multiple`, any number stay\n * open; otherwise opening one shuts the others. A pressed open section shuts\n * unless it is the only one open and `collapsible` is false (shadcn's and\n * Zag's default for a single accordion is collapsible, and so is this).\n */\nexport const toggled = (\n open: ReadonlyArray<string>,\n id: string,\n options: { readonly multiple?: boolean; readonly collapsible?: boolean } = {},\n): ReadonlyArray<string> => {\n const isOpen = open.includes(id)\n if (options.multiple === true) return flipped(open, id)\n if (!isOpen) return [id]\n return options.collapsible === false ? open : []\n}\n\nexport const view = <Message>(options: AccordionView<Message>, h: HtmlBuilder<Message>): Html => {\n const builders = SlotView.buildersFor(\n AccordionSlots,\n [...(options.style === undefined ? [] : [options.style.mixin]), ...(options.mixins ?? [])],\n { input: undefined, h },\n )\n const open = new Set(options.open)\n const heading = (children: ReadonlyArray<Html>) => {\n const attrs = builders.heading.attrs()\n switch (options.headingLevel ?? 3) {\n case 2:\n return h.h2(attrs, children)\n case 4:\n return h.h4(attrs, children)\n case 5:\n return h.h5(attrs, children)\n case 6:\n return h.h6(attrs, children)\n default:\n return h.h3(attrs, children)\n }\n }\n return h.div(\n builders.root.attrs(),\n options.items.map(item => {\n const shown = open.has(item.id)\n const state = h.DataAttribute('state', shown ? 'open' : 'closed')\n const triggerId = `${options.id}-${item.id}-trigger`\n const panelId = `${options.id}-${item.id}-panel`\n const disabled = item.disabled === true\n return h.keyed('div')(item.id, builders.item.attrs([state]), [\n heading([\n h.button(\n builders.trigger.attrs([\n h.Type('button'),\n h.Id(triggerId),\n h.AriaExpanded(shown),\n h.AriaControls(panelId),\n state,\n ...(disabled ? [h.Disabled(true)] : [h.OnClick(options.onToggle(item.id))]),\n ]),\n [\n // Its text in `data-label` too, so turning semibold when open moves nothing.\n h.span(builders.label.attrs([h.DataAttribute('label', item.title)]), [item.title]),\n options.icon === undefined\n ? h.span(builders.chevron.attrs([h.AriaHidden(true)]), [])\n : h.span(builders.icon.attrs([h.AriaHidden(true), state]), [options.icon]),\n ],\n ),\n ]),\n h.div(\n builders.panel.attrs([\n h.Id(panelId),\n h.Role('region'),\n h.AriaLabelledBy(triggerId),\n state,\n ...(shown ? [] : [h.Attribute('inert', '')]),\n ]),\n [h.div(builders.body.attrs(), [h.div(builders.content.attrs(), [item.content])])],\n ),\n ])\n }),\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,iBAAiB,MAAM,OAAO;CACzC,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACvD,SAAS,KAAK,KAAK;EACjB,YAAY,WAAW;EACvB,QAAQ,CAAC,MAAM,KAAK;EACpB,YAAY,CAAC,KAAK,cAAc,KAAK,QAAQ;CAC/C,CAAC;CACD,OAAO,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACrD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;;CAEvD,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,OAAO,KAAK,KAAK;EAAE,YAAY,WAAW;EAAW,YAAY,CAAC,KAAK,IAAI;CAAE,CAAC;;CAE9E,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;AACzD,CAAC;;;;;;;AAqCD,MAAa,WACX,MACA,IACA,UAA2E,CAAC,MAClD;CAC1B,MAAM,SAAS,KAAK,SAAS,EAAE;CAC/B,IAAI,QAAQ,aAAa,MAAM,OAAO,QAAQ,MAAM,EAAE;CACtD,IAAI,CAAC,QAAQ,OAAO,CAAC,EAAE;CACvB,OAAO,QAAQ,gBAAgB,QAAQ,OAAO,CAAC;AACjD;AAEA,MAAa,QAAiB,SAAiC,MAAkC;CAC/F,MAAM,WAAW,SAAS,YACxB,gBACA,CAAC,GAAI,QAAQ,UAAU,KAAA,IAAY,CAAC,IAAI,CAAC,QAAQ,MAAM,KAAK,GAAI,GAAI,QAAQ,UAAU,CAAC,CAAE,GACzF;EAAE,OAAO,KAAA;EAAW;CAAE,CACxB;CACA,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI;CACjC,MAAM,WAAW,aAAkC;EACjD,MAAM,QAAQ,SAAS,QAAQ,MAAM;EACrC,QAAQ,QAAQ,gBAAgB,GAAhC;GACE,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,KAAK,GACH,OAAO,EAAE,GAAG,OAAO,QAAQ;GAC7B,SACE,OAAO,EAAE,GAAG,OAAO,QAAQ;EAC/B;CACF;CACA,OAAO,EAAE,IACP,SAAS,KAAK,MAAM,GACpB,QAAQ,MAAM,KAAI,SAAQ;EACxB,MAAM,QAAQ,KAAK,IAAI,KAAK,EAAE;EAC9B,MAAM,QAAQ,EAAE,cAAc,SAAS,QAAQ,SAAS,QAAQ;EAChE,MAAM,YAAY,GAAG,QAAQ,GAAG,GAAG,KAAK,GAAG;EAC3C,MAAM,UAAU,GAAG,QAAQ,GAAG,GAAG,KAAK,GAAG;EACzC,MAAM,WAAW,KAAK,aAAa;EACnC,OAAO,EAAE,MAAM,KAAK,CAAC,CAAC,KAAK,IAAI,SAAS,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAC3D,QAAQ,CACN,EAAE,OACA,SAAS,QAAQ,MAAM;GACrB,EAAE,KAAK,QAAQ;GACf,EAAE,GAAG,SAAS;GACd,EAAE,aAAa,KAAK;GACpB,EAAE,aAAa,OAAO;GACtB;GACA,GAAI,WAAW,CAAC,EAAE,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,QAAQ,SAAS,KAAK,EAAE,CAAC,CAAC;EAC3E,CAAC,GACD,CAEE,EAAE,KAAK,SAAS,MAAM,MAAM,CAAC,EAAE,cAAc,SAAS,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GACjF,QAAQ,SAAS,KAAA,IACb,EAAE,KAAK,SAAS,QAAQ,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IACvD,EAAE,KAAK,SAAS,KAAK,MAAM,CAAC,EAAE,WAAW,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAC7E,CACF,CACF,CAAC,GACD,EAAE,IACA,SAAS,MAAM,MAAM;GACnB,EAAE,GAAG,OAAO;GACZ,EAAE,KAAK,QAAQ;GACf,EAAE,eAAe,SAAS;GAC1B;GACA,GAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,EAAE,CAAC;EAC5C,CAAC,GACD,CAAC,EAAE,IAAI,SAAS,KAAK,MAAM,GAAG,CAAC,EAAE,IAAI,SAAS,QAAQ,MAAM,GAAG,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAClF,CACF,CAAC;CACH,CAAC,CACH;AACF"}
|
package/dist/alert.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Attr, Capability, Event, NamedStyle, Slot, Slots } from "foldkit-mixins";
|
|
2
|
+
import { MixinList } from "./resolve.js";
|
|
3
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
4
|
+
/**
|
|
5
|
+
* An alert publishes its regions as slots; it owns no state. Shown or
|
|
6
|
+
* dismissed is the application's: `onDismiss` asks, and the next view leaves
|
|
7
|
+
* the alert out. The root carries `data-layout` and `data-dismissible` for a
|
|
8
|
+
* style to read.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AlertSlots: Slots.Contract<{
|
|
11
|
+
readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly [Attr.AttrToken<"role">, Attr.AttrToken<"aria-label">], readonly Slot.RequirementName[], boolean>;
|
|
12
|
+
readonly icon: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
13
|
+
readonly title: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
14
|
+
readonly description: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
15
|
+
readonly actions: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
16
|
+
readonly action: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>;
|
|
17
|
+
readonly dismiss: Slot.UnnamedSlot<Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>, readonly [Event.EventToken<"click">], readonly [Attr.AttrToken<"aria-label">], readonly Slot.RequirementName[], boolean>;
|
|
18
|
+
}>;
|
|
19
|
+
/** A feedback family the alert can take. */
|
|
20
|
+
export type AlertTone = 'info' | 'success' | 'warning' | 'error';
|
|
21
|
+
/** An action: a link to follow, or a button that sends a Message. */
|
|
22
|
+
export type AlertAction<Message> = {
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly href: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly label: string;
|
|
27
|
+
readonly onClick: Message;
|
|
28
|
+
};
|
|
29
|
+
interface AlertContent<Message> {
|
|
30
|
+
readonly title: string;
|
|
31
|
+
readonly description?: string | undefined;
|
|
32
|
+
/** Hidden from screen readers: the title says what the icon shows. */
|
|
33
|
+
readonly icon?: Html | undefined;
|
|
34
|
+
readonly actions?: ReadonlyArray<AlertAction<NoInfer<Message>>> | undefined;
|
|
35
|
+
/** Draws a dismiss button that sends this. */
|
|
36
|
+
readonly onDismiss?: NoInfer<Message> | undefined;
|
|
37
|
+
/** The dismiss button's name; default `Dismiss <title>` inline, `Dismiss <label>` as a banner. */
|
|
38
|
+
readonly dismissLabel?: string | undefined;
|
|
39
|
+
/** A style of `AlertSlots`, for the alert's look. */
|
|
40
|
+
readonly style?: NamedStyle<typeof AlertSlots> | undefined;
|
|
41
|
+
/** Mixins beside the style. */
|
|
42
|
+
readonly mixins?: MixinList<Message> | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A notice inside the content, of something that just happened: a live
|
|
46
|
+
* region. `assertive` interrupts (`role="alert"`); anything else reports
|
|
47
|
+
* (`role="status"`). Screen readers speak what changes in a live region, not
|
|
48
|
+
* what it held when the page loaded, so draw it when the thing happens.
|
|
49
|
+
*/
|
|
50
|
+
export interface InlineAlert<Message> extends AlertContent<Message> {
|
|
51
|
+
readonly layout: 'inline';
|
|
52
|
+
readonly assertive?: boolean | undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A full-width strip across a page or a section, there when it loads: a
|
|
56
|
+
* region landmark (a `section` named by `label`), not a live region, which
|
|
57
|
+
* would say nothing on load. The landmark lets a screen reader find it, and
|
|
58
|
+
* its dismiss button, from anywhere.
|
|
59
|
+
*/
|
|
60
|
+
export interface BannerAlert<Message> extends AlertContent<Message> {
|
|
61
|
+
readonly layout: 'banner';
|
|
62
|
+
/** The region's name, such as "Announcement" or "Maintenance notice". */
|
|
63
|
+
readonly label: string;
|
|
64
|
+
}
|
|
65
|
+
export type AlertView<Message = never> = InlineAlert<Message> | BannerAlert<Message>;
|
|
66
|
+
export declare const view: <Message = never>(options: AlertView<Message>, h: HtmlBuilder<Message>) => Html;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","names":[],"sources":["../src/alert.ts"],"mappings":";;;;;;;;;qBAWa,YAAU,MAAA;;;;;;;;;;YAeX;;YAGA,YAAY;WACT;WAAwB;;WACxB;WAAwB,SAAS;;UAEtC,aAAa;WACZ;WACA;;WAEA,OAAO;WACP,UAAU,cAAc,YAAY,QAAQ;;WAE5C,YAAY,QAAQ;;WAEpB;;WAEA,QAAQ,kBAAkB;;WAE1B,SAAS,UAAU;;;;;;;;iBASb,YAAY,iBAAiB,aAAa;WAChD;WACA;;;;;;;;iBASM,YAAY,iBAAiB,aAAa;WAChD;;WAEA;;YAGC,UAAU,mBAAmB,YAAY,WAAW,YAAY;qBAE/D,OAAQ,iBAAe,SACzB,UAAU,UAAQ,GACxB,YAAY,aACd"}
|
package/dist/alert.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Attr, Capability, Event, Slot, SlotView, Slots } from "foldkit-mixins";
|
|
2
|
+
import { Match } from "effect";
|
|
3
|
+
// src/alert.ts
|
|
4
|
+
/**
|
|
5
|
+
* An alert publishes its regions as slots; it owns no state. Shown or
|
|
6
|
+
* dismissed is the application's: `onDismiss` asks, and the next view leaves
|
|
7
|
+
* the alert out. The root carries `data-layout` and `data-dismissible` for a
|
|
8
|
+
* style to read.
|
|
9
|
+
*/
|
|
10
|
+
const AlertSlots = Slots.define({
|
|
11
|
+
root: Slot.make({
|
|
12
|
+
capability: Capability.Container,
|
|
13
|
+
attributes: [Attr.Role, Attr.AriaLabel]
|
|
14
|
+
}),
|
|
15
|
+
icon: Slot.make({ capability: Capability.Container }),
|
|
16
|
+
title: Slot.make({ capability: Capability.Container }),
|
|
17
|
+
description: Slot.make({ capability: Capability.Container }),
|
|
18
|
+
actions: Slot.make({ capability: Capability.Container }),
|
|
19
|
+
action: Slot.make({ capability: Capability.Interactive }),
|
|
20
|
+
dismiss: Slot.make({
|
|
21
|
+
capability: Capability.Interactive,
|
|
22
|
+
events: [Event.Click],
|
|
23
|
+
attributes: [Attr.AriaLabel]
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
const view = (options, h) => {
|
|
27
|
+
const builders = SlotView.buildersFor(AlertSlots, [...options.style === void 0 ? [] : [options.style.mixin], ...options.mixins ?? []], {
|
|
28
|
+
input: void 0,
|
|
29
|
+
h
|
|
30
|
+
});
|
|
31
|
+
const onDismiss = options.onDismiss;
|
|
32
|
+
const marks = [h.DataAttribute("layout", options.layout), h.DataAttribute("dismissible", String(onDismiss !== void 0))];
|
|
33
|
+
const region = Match.value(options).pipe(Match.discriminatorsExhaustive("layout")({
|
|
34
|
+
inline: ({ title, assertive }) => ({
|
|
35
|
+
name: title,
|
|
36
|
+
draw: (children) => h.div(builders.root.attrs([h.Role(assertive === true ? "alert" : "status"), ...marks]), children)
|
|
37
|
+
}),
|
|
38
|
+
banner: ({ label }) => ({
|
|
39
|
+
name: label,
|
|
40
|
+
draw: (children) => h.section(builders.root.attrs([h.AriaLabel(label), ...marks]), children)
|
|
41
|
+
})
|
|
42
|
+
}));
|
|
43
|
+
const drawAction = (action) => "href" in action ? h.a(builders.action.attrs([h.Href(action.href)]), [action.label]) : h.button(builders.action.attrs([h.Type("button"), h.OnClick(action.onClick)]), [action.label]);
|
|
44
|
+
const actions = options.actions ?? [];
|
|
45
|
+
return region.draw([
|
|
46
|
+
...options.icon === void 0 ? [] : [h.span(builders.icon.attrs([h.AriaHidden(true)]), [options.icon])],
|
|
47
|
+
h.p(builders.title.attrs(), [options.title]),
|
|
48
|
+
...options.description === void 0 ? [] : [h.p(builders.description.attrs(), [options.description])],
|
|
49
|
+
...actions.length === 0 ? [] : [h.div(builders.actions.attrs(), actions.map(drawAction))],
|
|
50
|
+
...onDismiss === void 0 ? [] : [h.button(builders.dismiss.attrs([
|
|
51
|
+
h.Type("button"),
|
|
52
|
+
h.AriaLabel(options.dismissLabel ?? `Dismiss ${region.name}`),
|
|
53
|
+
h.OnClick(onDismiss)
|
|
54
|
+
]), ["✕"])]
|
|
55
|
+
]);
|
|
56
|
+
};
|
|
57
|
+
export { AlertSlots, view };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../src/alert.ts"],"sourcesContent":["import { Match } from 'effect'\nimport { Attr, Capability, Event, Slot, Slots, SlotView, type NamedStyle } from 'foldkit-mixins'\nimport type { Html, HtmlBuilder } from 'foldkit/html'\nimport type { MixinList } from './resolve.js'\n\n/**\n * An alert publishes its regions as slots; it owns no state. Shown or\n * dismissed is the application's: `onDismiss` asks, and the next view leaves\n * the alert out. The root carries `data-layout` and `data-dismissible` for a\n * style to read.\n */\nexport const AlertSlots = Slots.define({\n root: Slot.make({ capability: Capability.Container, attributes: [Attr.Role, Attr.AriaLabel] }),\n icon: Slot.make({ capability: Capability.Container }),\n title: Slot.make({ capability: Capability.Container }),\n description: Slot.make({ capability: Capability.Container }),\n actions: Slot.make({ capability: Capability.Container }),\n action: Slot.make({ capability: Capability.Interactive }),\n dismiss: Slot.make({\n capability: Capability.Interactive,\n events: [Event.Click],\n attributes: [Attr.AriaLabel],\n }),\n})\n\n/** A feedback family the alert can take. */\nexport type AlertTone = 'info' | 'success' | 'warning' | 'error'\n\n/** An action: a link to follow, or a button that sends a Message. */\nexport type AlertAction<Message> =\n | { readonly label: string; readonly href: string }\n | { readonly label: string; readonly onClick: Message }\n\ninterface AlertContent<Message> {\n readonly title: string\n readonly description?: string | undefined\n /** Hidden from screen readers: the title says what the icon shows. */\n readonly icon?: Html | undefined\n readonly actions?: ReadonlyArray<AlertAction<NoInfer<Message>>> | undefined\n /** Draws a dismiss button that sends this. */\n readonly onDismiss?: NoInfer<Message> | undefined\n /** The dismiss button's name; default `Dismiss <title>` inline, `Dismiss <label>` as a banner. */\n readonly dismissLabel?: string | undefined\n /** A style of `AlertSlots`, for the alert's look. */\n readonly style?: NamedStyle<typeof AlertSlots> | undefined\n /** Mixins beside the style. */\n readonly mixins?: MixinList<Message> | undefined\n}\n\n/**\n * A notice inside the content, of something that just happened: a live\n * region. `assertive` interrupts (`role=\"alert\"`); anything else reports\n * (`role=\"status\"`). Screen readers speak what changes in a live region, not\n * what it held when the page loaded, so draw it when the thing happens.\n */\nexport interface InlineAlert<Message> extends AlertContent<Message> {\n readonly layout: 'inline'\n readonly assertive?: boolean | undefined\n}\n\n/**\n * A full-width strip across a page or a section, there when it loads: a\n * region landmark (a `section` named by `label`), not a live region, which\n * would say nothing on load. The landmark lets a screen reader find it, and\n * its dismiss button, from anywhere.\n */\nexport interface BannerAlert<Message> extends AlertContent<Message> {\n readonly layout: 'banner'\n /** The region's name, such as \"Announcement\" or \"Maintenance notice\". */\n readonly label: string\n}\n\nexport type AlertView<Message = never> = InlineAlert<Message> | BannerAlert<Message>\n\nexport const view = <Message = never>(\n options: AlertView<Message>,\n h: HtmlBuilder<Message>,\n): Html => {\n const builders = SlotView.buildersFor(\n AlertSlots,\n [...(options.style === undefined ? [] : [options.style.mixin]), ...(options.mixins ?? [])],\n { input: undefined, h },\n )\n const onDismiss = options.onDismiss\n const marks = [\n h.DataAttribute('layout', options.layout),\n // Whether the root holds a dismiss button, for a recipe that keeps room for it.\n h.DataAttribute('dismissible', String(onDismiss !== undefined)),\n ]\n const region = Match.value(options).pipe(\n Match.discriminatorsExhaustive('layout')({\n inline: ({ title, assertive }) => ({\n name: title,\n draw: (children: ReadonlyArray<Html>) =>\n h.div(\n builders.root.attrs([h.Role(assertive === true ? 'alert' : 'status'), ...marks]),\n children,\n ),\n }),\n banner: ({ label }) => ({\n name: label,\n draw: (children: ReadonlyArray<Html>) =>\n h.section(builders.root.attrs([h.AriaLabel(label), ...marks]), children),\n }),\n }),\n )\n const drawAction = (action: AlertAction<Message>): Html =>\n 'href' in action\n ? h.a(builders.action.attrs([h.Href(action.href)]), [action.label])\n : h.button(builders.action.attrs([h.Type('button'), h.OnClick(action.onClick)]), [\n action.label,\n ])\n const actions = options.actions ?? []\n return region.draw([\n ...(options.icon === undefined\n ? []\n : [h.span(builders.icon.attrs([h.AriaHidden(true)]), [options.icon])]),\n h.p(builders.title.attrs(), [options.title]),\n ...(options.description === undefined\n ? []\n : [h.p(builders.description.attrs(), [options.description])]),\n ...(actions.length === 0 ? [] : [h.div(builders.actions.attrs(), actions.map(drawAction))]),\n ...(onDismiss === undefined\n ? []\n : [\n h.button(\n builders.dismiss.attrs([\n h.Type('button'),\n h.AriaLabel(options.dismissLabel ?? `Dismiss ${region.name}`),\n h.OnClick(onDismiss),\n ]),\n // Named by its label, so the glyph is never read.\n ['✕'],\n ),\n ]),\n ])\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,aAAa,MAAM,OAAO;CACrC,MAAM,KAAK,KAAK;EAAE,YAAY,WAAW;EAAW,YAAY,CAAC,KAAK,MAAM,KAAK,SAAS;CAAE,CAAC;CAC7F,MAAM,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACpD,OAAO,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACrD,aAAa,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CAC3D,SAAS,KAAK,KAAK,EAAE,YAAY,WAAW,UAAU,CAAC;CACvD,QAAQ,KAAK,KAAK,EAAE,YAAY,WAAW,YAAY,CAAC;CACxD,SAAS,KAAK,KAAK;EACjB,YAAY,WAAW;EACvB,QAAQ,CAAC,MAAM,KAAK;EACpB,YAAY,CAAC,KAAK,SAAS;CAC7B,CAAC;AACH,CAAC;AAmDD,MAAa,QACX,SACA,MACS;CACT,MAAM,WAAW,SAAS,YACxB,YACA,CAAC,GAAI,QAAQ,UAAU,KAAA,IAAY,CAAC,IAAI,CAAC,QAAQ,MAAM,KAAK,GAAI,GAAI,QAAQ,UAAU,CAAC,CAAE,GACzF;EAAE,OAAO,KAAA;EAAW;CAAE,CACxB;CACA,MAAM,YAAY,QAAQ;CAC1B,MAAM,QAAQ,CACZ,EAAE,cAAc,UAAU,QAAQ,MAAM,GAExC,EAAE,cAAc,eAAe,OAAO,cAAc,KAAA,CAAS,CAAC,CAChE;CACA,MAAM,SAAS,MAAM,MAAM,OAAO,CAAC,CAAC,KAClC,MAAM,yBAAyB,QAAQ,CAAC,CAAC;EACvC,SAAS,EAAE,OAAO,iBAAiB;GACjC,MAAM;GACN,OAAO,aACL,EAAE,IACA,SAAS,KAAK,MAAM,CAAC,EAAE,KAAK,cAAc,OAAO,UAAU,QAAQ,GAAG,GAAG,KAAK,CAAC,GAC/E,QACF;EACJ;EACA,SAAS,EAAE,aAAa;GACtB,MAAM;GACN,OAAO,aACL,EAAE,QAAQ,SAAS,KAAK,MAAM,CAAC,EAAE,UAAU,KAAK,GAAG,GAAG,KAAK,CAAC,GAAG,QAAQ;EAC3E;CACF,CAAC,CACH;CACA,MAAM,cAAc,WAClB,UAAU,SACN,EAAE,EAAE,SAAS,OAAO,MAAM,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAChE,EAAE,OAAO,SAAS,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,GAAG,EAAE,QAAQ,OAAO,OAAO,CAAC,CAAC,GAAG,CAC7E,OAAO,KACT,CAAC;CACP,MAAM,UAAU,QAAQ,WAAW,CAAC;CACpC,OAAO,OAAO,KAAK;EACjB,GAAI,QAAQ,SAAS,KAAA,IACjB,CAAC,IACD,CAAC,EAAE,KAAK,SAAS,KAAK,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC;EACtE,EAAE,EAAE,SAAS,MAAM,MAAM,GAAG,CAAC,QAAQ,KAAK,CAAC;EAC3C,GAAI,QAAQ,gBAAgB,KAAA,IACxB,CAAC,IACD,CAAC,EAAE,EAAE,SAAS,YAAY,MAAM,GAAG,CAAC,QAAQ,WAAW,CAAC,CAAC;EAC7D,GAAI,QAAQ,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,SAAS,QAAQ,MAAM,GAAG,QAAQ,IAAI,UAAU,CAAC,CAAC;EACzF,GAAI,cAAc,KAAA,IACd,CAAC,IACD,CACE,EAAE,OACA,SAAS,QAAQ,MAAM;GACrB,EAAE,KAAK,QAAQ;GACf,EAAE,UAAU,QAAQ,gBAAgB,WAAW,OAAO,MAAM;GAC5D,EAAE,QAAQ,SAAS;EACrB,CAAC,GAED,CAAC,GAAG,CACN,CACF;CACN,CAAC;AACH"}
|
package/dist/anchor.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Behavior } from "foldkit-mixins";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import * as Mount from "foldkit/mount";
|
|
4
|
+
import { Attribute, HtmlBuilder } from "foldkit/html";
|
|
5
|
+
export declare const Anchor: Mount.MountDefinitionWithArgs<"Anchor", {
|
|
6
|
+
/** The id of the element the floating one is placed against. */
|
|
7
|
+
buttonId: Schema.String;
|
|
8
|
+
anchor: Schema.Struct<{
|
|
9
|
+
readonly placement: Schema.optional<Schema.Literals<readonly ["top", "right", "bottom", "left", "top-start", "top-end", "right-start", "right-end", "bottom-start", "bottom-end", "left-start", "left-end"]>>;
|
|
10
|
+
readonly gap: Schema.optional<Schema.Number>;
|
|
11
|
+
readonly offset: Schema.optional<Schema.Number>;
|
|
12
|
+
readonly padding: Schema.optional<Schema.Union<readonly [Schema.Number, Schema.Struct<{
|
|
13
|
+
readonly top: Schema.optionalKey<Schema.Number>;
|
|
14
|
+
readonly right: Schema.optionalKey<Schema.Number>;
|
|
15
|
+
readonly bottom: Schema.optionalKey<Schema.Number>;
|
|
16
|
+
readonly left: Schema.optionalKey<Schema.Number>;
|
|
17
|
+
}>]>>;
|
|
18
|
+
readonly portal: Schema.optional<Schema.Boolean>;
|
|
19
|
+
readonly isPlacementLocked: Schema.optional<Schema.Boolean>;
|
|
20
|
+
}>;
|
|
21
|
+
interceptTab: Schema.optional<Schema.Boolean>;
|
|
22
|
+
focusAfterPosition: Schema.optional<Schema.Boolean>;
|
|
23
|
+
focusSelector: Schema.optional<Schema.String>;
|
|
24
|
+
arrowId: Schema.optional<Schema.String>;
|
|
25
|
+
arrowPadding: Schema.optional<Schema.Number>;
|
|
26
|
+
}, never>;
|
|
27
|
+
export type AnchorArgs = Parameters<typeof Anchor>[0];
|
|
28
|
+
/**
|
|
29
|
+
* Draw an upstream-anchored, in-place panel in the browser's top layer: show
|
|
30
|
+
* it as a manual popover, run the wrapped Mount's own acquire (which
|
|
31
|
+
* positions it), and hide it once that Mount releases. Use it only when the
|
|
32
|
+
* anchor keeps the panel in place (`portal: false`): upstream portal
|
|
33
|
+
* relocation moves the element after the Mount acquires, and moving a shown
|
|
34
|
+
* popover hides it again. The panel carries `popover="manual"` in its view.
|
|
35
|
+
* Where the popover API or the attribute is missing the wrapper is a no-op
|
|
36
|
+
* and the anchor positions in place.
|
|
37
|
+
*
|
|
38
|
+
* The view sets `inset: auto` on the panel, since the anchor writes only
|
|
39
|
+
* `left` and `top` over the browser's `inset: 0`. The browser's popover
|
|
40
|
+
* border, padding and `Canvas` fill stay on an unstyled panel: any author
|
|
41
|
+
* rule replaces them, as every recipe's panel does, where an inline reset
|
|
42
|
+
* would beat the recipes.
|
|
43
|
+
*/
|
|
44
|
+
export declare const topLayer: <Message, E>(action: Mount.MountAction<Message, E>) => Mount.MountAction<Message, E>;
|
|
45
|
+
/** Shows its element in the top layer while it is drawn: the `layer` bundle's Mount. */
|
|
46
|
+
export declare const TopLayer: Mount.MountDefinitionNoArgs<"TopLayer", never>;
|
|
47
|
+
/**
|
|
48
|
+
* A box in the top layer, the viewport's width and no height, for a panel
|
|
49
|
+
* whose anchor Mount is `@foldkit/ui`'s: an element holds one Mount, so the
|
|
50
|
+
* panel cannot also carry the one that shows it. Drawn around the panel, the
|
|
51
|
+
* layer takes the panel out of every stacking context and ancestor
|
|
52
|
+
* `overflow`, and the anchor places the panel inside it as on the page: the
|
|
53
|
+
* layer is fixed at the viewport's corner, so its coordinates are the
|
|
54
|
+
* viewport's, and as wide, so the panel's widths and `100%` read as they
|
|
55
|
+
* would. With no height it covers nothing a press could land on. Its look
|
|
56
|
+
* is inline: the browser's popover border, padding and fill must not show
|
|
57
|
+
* around a panel, whatever a theme does.
|
|
58
|
+
*/
|
|
59
|
+
export declare const layer: <Message>(h: HtmlBuilder<Message>) => ReadonlyArray<Attribute<Message>>;
|
|
60
|
+
/**
|
|
61
|
+
* The `layer` box without its Mount, for a box whose own Mount shows it
|
|
62
|
+
* (`topLayer` around one that sends Messages, which a Scene can resolve
|
|
63
|
+
* where `TopLayer` sends none). `style` joins the box's inline style, since
|
|
64
|
+
* a second `h.Style` on the element would replace it.
|
|
65
|
+
*/
|
|
66
|
+
export declare const layerBox: <Message>(h: HtmlBuilder<Message>, style?: Readonly<Record<string, string>>) => ReadonlyArray<Attribute<Message>>;
|
|
67
|
+
/**
|
|
68
|
+
* Places an arrow drawn as a panel's child against the middle of the
|
|
69
|
+
* element whose id is given, for a panel whose anchor computes no arrow
|
|
70
|
+
* (`@foldkit/ui`'s Tooltip). It writes `--arrow-x` (above or below) or
|
|
71
|
+
* `--arrow-y` (beside) on the arrow, the properties upstream's anchor writes
|
|
72
|
+
* on a panel, and the other `initial`, so one rule styles both. It follows
|
|
73
|
+
* the panel: the anchor writes the panel's `style` and `data-placement` on
|
|
74
|
+
* every move, its first showing included, and each write places the arrow.
|
|
75
|
+
*/
|
|
76
|
+
export declare const PlaceArrow: Mount.MountDefinitionWithArgs<"PlaceArrow", {
|
|
77
|
+
buttonId: Schema.String;
|
|
78
|
+
}, never>;
|
|
79
|
+
export interface BehaviorOptions<Input, Slots> {
|
|
80
|
+
/** The slot to position. */
|
|
81
|
+
readonly floating: keyof Slots & string;
|
|
82
|
+
readonly config: (input: Input) => AnchorArgs;
|
|
83
|
+
}
|
|
84
|
+
/** Mounts the anchor on the floating slot with the config the input gives. */
|
|
85
|
+
export declare const behavior: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
86
|
+
//# sourceMappingURL=anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","names":[],"sources":["../src/anchor.ts"],"mappings":";;;;qBAqCa,QAAM,MAAA;;;;;;;;;;;;;;;;;;;;;;YAgCP,aAAa,kBAAkB;;;;;;;;;;;;;;;;;qBA0D9B,WAAY,SAAS,GAAC,QACzB,MAAM,YAAY,SAAS,OAClC,MAAM,YAAY,SAAS;;qBAOjB,UAAQ,MAAA;;;;;;;;;;;;;qBAiBR,QAAS,SAAO,GAAK,YAAY,aAAW,cAAc,UAAU;;;;;;;qBAWpE,WAAY,SAAO,GAC3B,YAAY,UAAQ,QAChB,SAAS,4BACf,cAAc,UAAU;;;;;;;;;;qBA0Bd,YAAU,MAAA;;;iBA+CN,gBAAgB,OAAO;;WAE7B,gBAAgB;WAChB,SAAS,OAAO,UAAU;;;qBAIxB,WACV,OAAK,OAAS,WACd,OAAO,eAAa,SACV,gBAAgB,OAAO,WAC/B,SAAS,cAAc,OAAO,OAAO"}
|