@groupteknology/vuno 1.0.1 → 2.0.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 +53 -27
- package/dist/module.d.mts +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +33 -12
- package/dist/runtime/app/assets/css/dialog.css +1 -1
- package/dist/runtime/app/assets/css/stylesheet.css +1 -0
- package/dist/runtime/app/assets/css/theme.css +1 -1
- package/dist/runtime/app/assets/css/tokens.css +1 -1
- package/dist/runtime/app/components/Alert/Alert.d.vue.ts +20 -0
- package/dist/runtime/app/components/Alert/Alert.theme.d.ts +13 -0
- package/dist/runtime/app/components/Alert/Alert.theme.js +13 -0
- package/dist/runtime/app/components/Alert/Alert.vue +59 -0
- package/dist/runtime/app/components/Alert/Alert.vue.d.ts +20 -0
- package/dist/runtime/app/components/{overlays → App}/App.d.vue.ts +4 -5
- package/dist/runtime/app/components/{overlays → App}/App.vue +8 -12
- package/dist/runtime/app/components/{overlays → App}/App.vue.d.ts +4 -5
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.d.vue.ts +7 -0
- package/dist/runtime/app/components/{overlays → App/internal/Overlay}/Overlay.vue +5 -6
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue.d.ts +7 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.d.vue.ts +8 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +19 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue.d.ts +8 -0
- package/dist/runtime/app/components/{overlays → App/internal/Toast}/Toast.d.vue.ts +3 -3
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +13 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +18 -0
- package/dist/runtime/app/components/{overlays → App/internal/Toast}/Toast.vue +3 -2
- package/dist/runtime/app/components/{overlays → App/internal/Toast}/Toast.vue.d.ts +3 -3
- package/dist/runtime/app/components/{overlays → App/internal/Toaster}/Toaster.d.vue.ts +3 -3
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +15 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +16 -0
- package/dist/runtime/app/components/{overlays → App/internal/Toaster}/Toaster.vue +3 -2
- package/dist/runtime/app/components/{overlays → App/internal/Toaster}/Toaster.vue.d.ts +3 -3
- package/dist/runtime/app/components/{actions → Avatar}/Avatar.d.vue.ts +9 -5
- package/dist/runtime/app/components/Avatar/Avatar.theme.d.ts +30 -0
- package/dist/runtime/app/components/Avatar/Avatar.theme.js +22 -0
- package/dist/runtime/app/components/{actions → Avatar}/Avatar.vue +7 -5
- package/dist/runtime/app/components/{actions → Avatar}/Avatar.vue.d.ts +9 -5
- package/dist/runtime/app/components/{actions → Badge}/Badge.d.vue.ts +9 -5
- package/dist/runtime/app/components/Badge/Badge.theme.d.ts +40 -0
- package/dist/runtime/app/components/Badge/Badge.theme.js +22 -0
- package/dist/runtime/app/components/{actions → Badge}/Badge.vue +3 -0
- package/dist/runtime/app/components/{actions → Badge}/Badge.vue.d.ts +9 -5
- package/dist/runtime/app/components/{actions → Button}/Button.d.vue.ts +10 -6
- package/dist/runtime/app/components/Button/Button.theme.d.ts +88 -0
- package/dist/runtime/app/components/Button/Button.theme.js +59 -0
- package/dist/runtime/app/components/{actions → Button}/Button.vue +10 -3
- package/dist/runtime/app/components/{actions → Button}/Button.vue.d.ts +10 -6
- package/dist/runtime/app/components/{structure → Card}/Card.d.vue.ts +9 -5
- package/dist/runtime/app/components/Card/Card.theme.d.ts +57 -0
- package/dist/runtime/app/components/Card/Card.theme.js +62 -0
- package/dist/runtime/app/components/{structure → Card}/Card.vue +3 -1
- package/dist/runtime/app/components/{structure → Card}/Card.vue.d.ts +9 -5
- package/dist/runtime/app/components/Code/Code.d.vue.ts +19 -0
- package/dist/runtime/app/components/Code/Code.theme.d.ts +11 -0
- package/dist/runtime/app/components/Code/Code.theme.js +12 -0
- package/dist/runtime/app/components/Code/Code.vue +109 -0
- package/dist/runtime/app/components/Code/Code.vue.d.ts +19 -0
- package/dist/runtime/app/components/{overlays → Confirm}/Confirm.d.vue.ts +2 -2
- package/dist/runtime/app/components/Confirm/Confirm.theme.d.ts +12 -0
- package/dist/runtime/app/components/Confirm/Confirm.theme.js +13 -0
- package/dist/runtime/app/components/{overlays → Confirm}/Confirm.vue +10 -5
- package/dist/runtime/app/components/{overlays → Confirm}/Confirm.vue.d.ts +2 -2
- package/dist/runtime/app/components/{structure → Container}/Container.d.vue.ts +5 -5
- package/dist/runtime/app/components/Container/Container.theme.d.ts +53 -0
- package/dist/runtime/app/components/Container/Container.theme.js +31 -0
- package/dist/runtime/app/components/{structure → Container}/Container.vue +2 -1
- package/dist/runtime/app/components/{structure → Container}/Container.vue.d.ts +5 -5
- package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.d.ts +16 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.js +13 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.d.ts +12 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.js +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue +173 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.js +2 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +39 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +13 -0
- package/dist/runtime/app/components/{forms → FieldCheckbox/internal/Checkbox}/Checkbox.d.vue.ts +9 -4
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.d.ts +30 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.js +10 -0
- package/dist/runtime/app/components/{forms → FieldCheckbox/internal/Checkbox}/Checkbox.vue +7 -4
- package/dist/runtime/app/components/{forms → FieldCheckbox/internal/Checkbox}/Checkbox.vue.d.ts +9 -4
- package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.d.ts +27 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.js +18 -0
- package/dist/runtime/app/components/{forms/fields → FieldColor}/FieldColor.vue +39 -32
- package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.js +2 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +51 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +13 -0
- package/dist/runtime/app/components/{forms/fields → FieldFile}/FieldFile.d.vue.ts +10 -2
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.js +2 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue +99 -0
- package/dist/runtime/app/components/{forms/fields → FieldFile}/FieldFile.vue.d.ts +10 -2
- package/dist/runtime/app/components/{forms → FieldFile/internal/FileUpload}/FileUpload.d.vue.ts +25 -20
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +88 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +55 -0
- package/dist/runtime/app/components/{forms → FieldFile/internal/FileUpload}/FileUpload.vue +21 -20
- package/dist/runtime/app/components/{forms → FieldFile/internal/FileUpload}/FileUpload.vue.d.ts +25 -20
- package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +24 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.js +2 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue +61 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +24 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.js +2 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +47 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.js +2 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +62 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.js +2 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +41 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +13 -0
- package/dist/runtime/app/components/{forms → FieldRadio/internal/RadioGroup}/RadioGroup.d.vue.ts +10 -8
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.d.ts +54 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.js +31 -0
- package/dist/runtime/app/components/{forms → FieldRadio/internal/RadioGroup}/RadioGroup.vue +7 -4
- package/dist/runtime/app/components/{forms → FieldRadio/internal/RadioGroup}/RadioGroup.vue.d.ts +10 -8
- package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +17 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.d.ts +6 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.js +7 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +74 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +17 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.js +2 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +45 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +97 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.js +49 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +196 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +97 -0
- package/dist/runtime/app/{utils → components/FieldSelect/internal/Select}/option.d.ts +3 -4
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.d.ts +30 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.js +142 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.js +2 -0
- package/dist/runtime/app/components/{forms/fields → FieldSlug}/FieldSlug.vue +58 -47
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.js +2 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +37 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +13 -0
- package/dist/runtime/app/components/{forms → FieldSwitch/internal/Switch}/Switch.d.vue.ts +9 -4
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.d.ts +39 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.js +20 -0
- package/dist/runtime/app/components/{forms → FieldSwitch/internal/Switch}/Switch.vue +4 -2
- package/dist/runtime/app/components/{forms → FieldSwitch/internal/Switch}/Switch.vue.d.ts +9 -4
- package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.js +2 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue +41 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.d.ts +34 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.js +20 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +97 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +26 -0
- package/dist/runtime/app/components/{forms/fields → FieldTextarea}/FieldTextarea.d.vue.ts +10 -2
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.js +2 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +45 -0
- package/dist/runtime/app/components/{forms/fields → FieldTextarea}/FieldTextarea.vue.d.ts +10 -2
- package/dist/runtime/app/components/{forms → FieldTextarea/internal/Textarea}/Textarea.d.vue.ts +9 -4
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.js +37 -0
- package/dist/runtime/app/components/{forms → FieldTextarea/internal/Textarea}/Textarea.vue +6 -4
- package/dist/runtime/app/components/{forms → FieldTextarea/internal/Textarea}/Textarea.vue.d.ts +9 -4
- package/dist/runtime/app/components/{forms → Form}/Form.d.vue.ts +3 -4
- package/dist/runtime/app/components/Form/Form.theme.d.ts +9 -0
- package/dist/runtime/app/components/Form/Form.theme.js +10 -0
- package/dist/runtime/app/components/{forms → Form}/Form.vue +7 -6
- package/dist/runtime/app/components/{forms → Form}/Form.vue.d.ts +3 -4
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.d.vue.ts +7 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue +67 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue.d.ts +7 -0
- package/dist/runtime/app/components/Form/internal/standard-schema.d.ts +29 -0
- package/dist/runtime/app/{internal → components/Form/internal}/useVunoFormState.d.ts +5 -3
- package/dist/runtime/app/{internal → components/Form/internal}/useVunoFormState.js +4 -3
- package/dist/runtime/app/components/{forms → FormField}/FormField.d.vue.ts +7 -4
- package/dist/runtime/app/components/FormField/FormField.theme.d.ts +62 -0
- package/dist/runtime/app/components/FormField/FormField.theme.js +28 -0
- package/dist/runtime/app/components/{forms → FormField}/FormField.vue +61 -42
- package/dist/runtime/app/components/{forms → FormField}/FormField.vue.d.ts +7 -4
- package/dist/runtime/app/components/{forms → FormModal}/FormModal.d.vue.ts +9 -7
- package/dist/runtime/app/components/FormModal/FormModal.theme.d.ts +8 -0
- package/dist/runtime/app/components/FormModal/FormModal.theme.js +9 -0
- package/dist/runtime/app/components/{forms → FormModal}/FormModal.vue +15 -12
- package/dist/runtime/app/components/{forms → FormModal}/FormModal.vue.d.ts +9 -7
- package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +15 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.d.ts +12 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.js +14 -0
- package/dist/runtime/app/components/{forms → FormSection}/FormSection.vue +5 -3
- package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +15 -0
- package/dist/runtime/app/components/Icon/Icon.d.vue.ts +6 -0
- package/dist/runtime/app/components/Icon/Icon.vue +32 -0
- package/dist/runtime/app/components/Icon/Icon.vue.d.ts +6 -0
- package/dist/runtime/app/components/{actions → Menu}/Menu.d.vue.ts +6 -4
- package/dist/runtime/app/components/Menu/Menu.theme.d.ts +17 -0
- package/dist/runtime/app/components/Menu/Menu.theme.js +20 -0
- package/dist/runtime/app/components/{actions → Menu}/Menu.vue +20 -27
- package/dist/runtime/app/components/{actions → Menu}/Menu.vue.d.ts +6 -4
- package/dist/runtime/app/components/Modal/Modal.d.vue.ts +43 -0
- package/dist/runtime/app/components/Modal/Modal.theme.d.ts +59 -0
- package/dist/runtime/app/components/Modal/Modal.theme.js +47 -0
- package/dist/runtime/app/components/{overlays → Modal}/Modal.vue +89 -32
- package/dist/runtime/app/components/Modal/Modal.vue.d.ts +43 -0
- package/dist/runtime/app/components/{structure → Navbar}/Navbar.d.vue.ts +14 -18
- package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +31 -0
- package/dist/runtime/app/components/Navbar/Navbar.theme.js +32 -0
- package/dist/runtime/app/components/{structure → Navbar}/Navbar.vue +1 -0
- package/dist/runtime/app/components/{structure → Navbar}/Navbar.vue.d.ts +14 -18
- package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +38 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.d.ts +32 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.js +35 -0
- package/dist/runtime/app/components/{structure/Navigation.vue → NavigationList/NavigationList.vue} +74 -34
- package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +38 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +31 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.d.ts +26 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.js +27 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +236 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +31 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +14 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.d.ts +9 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.js +10 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +81 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +14 -0
- package/dist/runtime/app/components/{structure → Page}/Page.d.vue.ts +6 -5
- package/dist/runtime/app/components/Page/Page.theme.d.ts +32 -0
- package/dist/runtime/app/components/Page/Page.theme.js +31 -0
- package/dist/runtime/app/components/{structure → Page}/Page.vue +11 -3
- package/dist/runtime/app/components/{structure → Page}/Page.vue.d.ts +6 -5
- package/dist/runtime/app/components/{structure → Pagination}/Pagination.d.vue.ts +8 -7
- package/dist/runtime/app/components/Pagination/Pagination.theme.d.ts +13 -0
- package/dist/runtime/app/components/Pagination/Pagination.theme.js +14 -0
- package/dist/runtime/app/components/{structure → Pagination}/Pagination.vue +4 -2
- package/dist/runtime/app/components/{structure → Pagination}/Pagination.vue.d.ts +8 -7
- package/dist/runtime/app/components/{overlays/Modal.d.vue.ts → Slideover/Slideover.d.vue.ts} +10 -18
- package/dist/runtime/app/components/Slideover/Slideover.theme.d.ts +35 -0
- package/dist/runtime/app/components/Slideover/Slideover.theme.js +24 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue +58 -0
- package/dist/runtime/app/components/{overlays/Modal.vue.d.ts → Slideover/Slideover.vue.d.ts} +10 -18
- package/dist/runtime/app/components/State/State.theme.d.ts +19 -0
- package/dist/runtime/app/components/State/State.theme.js +26 -0
- package/dist/runtime/app/components/{structure → State}/State.vue +8 -3
- package/dist/runtime/app/components/{structure → Table}/Table.d.vue.ts +5 -2
- package/dist/runtime/app/components/Table/Table.theme.d.ts +50 -0
- package/dist/runtime/app/components/Table/Table.theme.js +64 -0
- package/dist/runtime/app/components/{structure → Table}/Table.vue +62 -72
- package/dist/runtime/app/components/{structure → Table}/Table.vue.d.ts +5 -2
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellBadge}/CellBadge.vue +2 -1
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.js +11 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +32 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.js +4 -0
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellCurrency}/CellCurrency.vue +1 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.js +4 -0
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellDate}/CellDate.vue +1 -0
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellImage}/CellImage.vue +2 -1
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.js +4 -0
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellNumber}/CellNumber.vue +1 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.d.ts +13 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.js +11 -0
- package/dist/runtime/app/components/{structure/cells → Table/internal/CellText}/CellText.vue +1 -0
- package/dist/runtime/app/components/{structure → Table/internal/TableCell}/TableCell.vue +9 -8
- package/dist/runtime/app/{utils → components/Table/internal}/column.js +1 -1
- package/dist/runtime/app/{internal → components/Table/internal}/useVunoTable.d.ts +23 -22
- package/dist/runtime/app/{internal → components/Table/internal}/useVunoTable.js +1 -1
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.js +29 -0
- package/dist/runtime/app/components/{structure → Tabs}/Tabs.d.vue.ts +8 -7
- package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +32 -0
- package/dist/runtime/app/components/Tabs/Tabs.theme.js +23 -0
- package/dist/runtime/app/components/{structure → Tabs}/Tabs.vue +13 -8
- package/dist/runtime/app/components/{structure → Tabs}/Tabs.vue.d.ts +8 -7
- package/dist/runtime/app/components/{actions → Tooltip}/Tooltip.d.vue.ts +6 -6
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.d.ts +12 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.js +13 -0
- package/dist/runtime/app/components/{actions → Tooltip}/Tooltip.vue +10 -23
- package/dist/runtime/app/components/{actions → Tooltip}/Tooltip.vue.d.ts +6 -6
- package/dist/runtime/app/components/{forms → internal/ControlShell}/ControlShell.d.vue.ts +9 -5
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.d.ts +50 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.js +38 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue +33 -0
- package/dist/runtime/app/components/{forms → internal/ControlShell}/ControlShell.vue.d.ts +9 -5
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.d.vue.ts +23 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue +63 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue.d.ts +23 -0
- package/dist/runtime/app/components/{forms → internal/Input}/Input.d.vue.ts +15 -10
- package/dist/runtime/app/components/internal/Input/Input.theme.d.ts +30 -0
- package/dist/runtime/app/components/internal/Input/Input.theme.js +21 -0
- package/dist/runtime/app/components/{forms → internal/Input}/Input.vue +8 -6
- package/dist/runtime/app/components/{forms → internal/Input}/Input.vue.d.ts +15 -10
- package/dist/runtime/app/components/{forms → internal/NumberInput}/NumberInput.d.vue.ts +14 -8
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.d.ts +31 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.js +26 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue +221 -0
- package/dist/runtime/app/components/{forms → internal/NumberInput}/NumberInput.vue.d.ts +14 -8
- package/dist/runtime/app/{utils → components/internal/NumberInput}/number.d.ts +7 -0
- package/dist/runtime/app/components/internal/NumberInput/number.js +64 -0
- package/dist/runtime/app/composables/defineShortcuts.d.ts +19 -0
- package/dist/runtime/app/composables/defineShortcuts.js +68 -0
- package/dist/runtime/app/{internal → composables/internal}/useVunoAnchor.d.ts +6 -4
- package/dist/runtime/app/{internal → composables/internal}/useVunoAnchor.js +3 -2
- package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +17 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.js +18 -0
- package/dist/runtime/app/{internal → composables/internal}/useVunoPortal.d.ts +3 -8
- package/dist/runtime/app/composables/internal/useVunoPortal.js +12 -0
- package/dist/runtime/app/composables/useCrud.js +5 -4
- package/dist/runtime/app/composables/useField.d.ts +3 -3
- package/dist/runtime/app/composables/useField.js +16 -8
- package/dist/runtime/app/composables/useForm.d.ts +3 -0
- package/dist/runtime/app/composables/useForm.js +2 -2
- package/dist/runtime/app/composables/useModal.js +1 -3
- package/dist/runtime/app/composables/useTableQuery.js +29 -13
- package/dist/runtime/app/composables/useTheme.d.ts +3 -2
- package/dist/runtime/app/composables/useTheme.js +4 -2
- package/dist/runtime/app/internal/keys.d.ts +11 -5
- package/dist/runtime/app/internal/keys.js +5 -2
- package/dist/runtime/app/internal/slots.d.ts +3 -0
- package/dist/runtime/app/internal/slots.js +13 -1
- package/dist/runtime/app/plugins/vue-query.d.ts +8 -0
- package/dist/runtime/app/plugins/vue-query.js +13 -0
- package/dist/runtime/app/theme/icons.js +4 -1
- package/dist/runtime/app/theme/index.d.ts +1158 -4
- package/dist/runtime/app/theme/index.js +116 -10
- package/dist/runtime/app/theme/messages.js +10 -3
- package/dist/runtime/app/theme/shared.d.ts +19 -3
- package/dist/runtime/app/theme/shared.js +15 -1
- package/dist/runtime/app/types/alert.d.ts +13 -0
- package/dist/runtime/app/types/base.d.ts +19 -1
- package/dist/runtime/app/types/field-type.d.ts +4 -0
- package/dist/runtime/app/types/field-type.js +0 -0
- package/dist/runtime/app/types/field.d.ts +132 -26
- package/dist/runtime/app/types/form.d.ts +27 -1
- package/dist/runtime/app/types/index.d.ts +15 -12
- package/dist/runtime/app/types/page.d.ts +9 -1
- package/dist/runtime/app/types/shortcuts.d.ts +44 -0
- package/dist/runtime/app/types/shortcuts.js +0 -0
- package/dist/runtime/app/types/slots.d.ts +30 -0
- package/dist/runtime/app/types/slots.js +0 -0
- package/dist/runtime/app/types/state.d.ts +3 -3
- package/dist/runtime/app/types/table.d.ts +3 -2
- package/dist/runtime/app/types/theme.d.ts +51 -13
- package/dist/runtime/app/utils/format.js +2 -2
- package/dist/runtime/app/utils/path.js +4 -2
- package/dist/runtime/app/utils/theme.d.ts +19 -1
- package/dist/runtime/app/utils/theme.js +21 -3
- package/package.json +18 -3
- package/dist/runtime/app/components/actions/Icon.d.vue.ts +0 -6
- package/dist/runtime/app/components/actions/Icon.vue +0 -32
- package/dist/runtime/app/components/actions/Icon.vue.d.ts +0 -6
- package/dist/runtime/app/components/forms/ControlShell.vue +0 -19
- package/dist/runtime/app/components/forms/FormFieldRenderer.d.vue.ts +0 -7
- package/dist/runtime/app/components/forms/FormFieldRenderer.vue +0 -88
- package/dist/runtime/app/components/forms/FormFieldRenderer.vue.d.ts +0 -7
- package/dist/runtime/app/components/forms/FormSection.d.vue.ts +0 -12
- package/dist/runtime/app/components/forms/FormSection.vue.d.ts +0 -12
- package/dist/runtime/app/components/forms/NumberInput.vue +0 -160
- package/dist/runtime/app/components/forms/Select.d.vue.ts +0 -61
- package/dist/runtime/app/components/forms/Select.vue +0 -336
- package/dist/runtime/app/components/forms/Select.vue.d.ts +0 -61
- package/dist/runtime/app/components/forms/fields/FieldArray.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldArray.vue +0 -129
- package/dist/runtime/app/components/forms/fields/FieldArray.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldCheckbox.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldCheckbox.vue +0 -31
- package/dist/runtime/app/components/forms/fields/FieldCheckbox.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldColor.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldColor.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldEmail.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldEmail.vue +0 -38
- package/dist/runtime/app/components/forms/fields/FieldEmail.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldFile.vue +0 -91
- package/dist/runtime/app/components/forms/fields/FieldNumber.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldNumber.vue +0 -39
- package/dist/runtime/app/components/forms/fields/FieldNumber.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldPassword.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldPassword.vue +0 -36
- package/dist/runtime/app/components/forms/fields/FieldPassword.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldRadio.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldRadio.vue +0 -33
- package/dist/runtime/app/components/forms/fields/FieldRadio.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSelect.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSelect.vue +0 -37
- package/dist/runtime/app/components/forms/fields/FieldSelect.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSlug.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSlug.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSwitch.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldSwitch.vue +0 -29
- package/dist/runtime/app/components/forms/fields/FieldSwitch.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldText.d.vue.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldText.vue +0 -39
- package/dist/runtime/app/components/forms/fields/FieldText.vue.d.ts +0 -5
- package/dist/runtime/app/components/forms/fields/FieldTextarea.vue +0 -37
- package/dist/runtime/app/components/layouts/dashboard/DashboardAside.d.vue.ts +0 -56
- package/dist/runtime/app/components/layouts/dashboard/DashboardAside.vue +0 -96
- package/dist/runtime/app/components/layouts/dashboard/DashboardAside.vue.d.ts +0 -56
- package/dist/runtime/app/components/layouts/dashboard/DashboardLayout.d.vue.ts +0 -57
- package/dist/runtime/app/components/layouts/dashboard/DashboardLayout.vue +0 -164
- package/dist/runtime/app/components/layouts/dashboard/DashboardLayout.vue.d.ts +0 -57
- package/dist/runtime/app/components/layouts/dashboard/DashboardPage.d.vue.ts +0 -49
- package/dist/runtime/app/components/layouts/dashboard/DashboardPage.vue +0 -45
- package/dist/runtime/app/components/layouts/dashboard/DashboardPage.vue.d.ts +0 -49
- package/dist/runtime/app/components/layouts/public/PublicLayout.d.vue.ts +0 -50
- package/dist/runtime/app/components/layouts/public/PublicLayout.vue +0 -56
- package/dist/runtime/app/components/layouts/public/PublicLayout.vue.d.ts +0 -50
- package/dist/runtime/app/components/overlays/Context.d.vue.ts +0 -3
- package/dist/runtime/app/components/overlays/Context.vue +0 -7
- package/dist/runtime/app/components/overlays/Context.vue.d.ts +0 -3
- package/dist/runtime/app/components/overlays/Overlay.d.vue.ts +0 -7
- package/dist/runtime/app/components/overlays/Overlay.vue.d.ts +0 -7
- package/dist/runtime/app/components/structure/Navigation.d.vue.ts +0 -14
- package/dist/runtime/app/components/structure/Navigation.vue.d.ts +0 -14
- package/dist/runtime/app/components/structure/cells/CellBoolean.vue +0 -26
- package/dist/runtime/app/composables/useDashboard.d.ts +0 -14
- package/dist/runtime/app/composables/useDashboard.js +0 -9
- package/dist/runtime/app/internal/useVunoDashboard.d.ts +0 -15
- package/dist/runtime/app/internal/useVunoDashboard.js +0 -5
- package/dist/runtime/app/internal/useVunoPortal.js +0 -8
- package/dist/runtime/app/theme/actions.d.ts +0 -2
- package/dist/runtime/app/theme/actions.js +0 -123
- package/dist/runtime/app/theme/forms.d.ts +0 -2
- package/dist/runtime/app/theme/forms.js +0 -442
- package/dist/runtime/app/theme/layouts.d.ts +0 -2
- package/dist/runtime/app/theme/layouts.js +0 -76
- package/dist/runtime/app/theme/overlays.d.ts +0 -2
- package/dist/runtime/app/theme/overlays.js +0 -90
- package/dist/runtime/app/theme/structure.d.ts +0 -2
- package/dist/runtime/app/theme/structure.js +0 -351
- package/dist/runtime/app/types/dashboard.d.ts +0 -7
- package/dist/runtime/app/utils/number.js +0 -30
- package/dist/runtime/app/utils/standard-schema.d.ts +0 -62
- /package/dist/runtime/app/{utils → components/FieldSelect/internal/Select}/option.js +0 -0
- /package/dist/runtime/app/{utils → components/Form/internal}/grid.d.ts +0 -0
- /package/dist/runtime/app/{utils → components/Form/internal}/grid.js +0 -0
- /package/dist/runtime/app/{utils → components/Form/internal}/standard-schema.js +0 -0
- /package/dist/runtime/app/components/{structure → State}/State.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure → State}/State.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellBadge}/CellBadge.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellBadge}/CellBadge.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellBoolean}/CellBoolean.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellBoolean}/CellBoolean.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellCurrency}/CellCurrency.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellCurrency}/CellCurrency.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellDate}/CellDate.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellDate}/CellDate.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellImage}/CellImage.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellImage}/CellImage.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellNumber}/CellNumber.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellNumber}/CellNumber.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellText}/CellText.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure/cells → Table/internal/CellText}/CellText.vue.d.ts +0 -0
- /package/dist/runtime/app/components/{structure → Table/internal/TableCell}/TableCell.d.vue.ts +0 -0
- /package/dist/runtime/app/components/{structure → Table/internal/TableCell}/TableCell.vue.d.ts +0 -0
- /package/dist/runtime/app/{utils → components/Table/internal}/column.d.ts +0 -0
- /package/dist/runtime/app/{utils → components/Table/internal}/query.d.ts +0 -0
- /package/dist/runtime/app/{utils → components/Table/internal}/query.js +0 -0
- /package/dist/runtime/app/{utils → components/Table/internal}/selection.d.ts +0 -0
- /package/dist/runtime/app/{utils → components/Table/internal}/selection.js +0 -0
- /package/dist/runtime/app/types/{dashboard.js → alert.js} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { accentByColor, radiusByStep } from "#vuno/theme/shared";
|
|
2
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
3
|
+
export const buttonTheme = defineTheme("button", {
|
|
4
|
+
/**
|
|
5
|
+
* El botón, y el primer componente propio del que todo lo demás cuelga.
|
|
6
|
+
*
|
|
7
|
+
* Las combinaciones no se escriben: la dimensión `color` solo asigna las
|
|
8
|
+
* variables de acento y la dimensión `variant` las consume, así que siete
|
|
9
|
+
* colores y cinco variantes son doce entradas en vez de treinta y cinco.
|
|
10
|
+
* `shape` no depende del tamaño porque un `aspect-square` ya cuadra la
|
|
11
|
+
* altura que haya puesto `size`.
|
|
12
|
+
*/
|
|
13
|
+
slots: {
|
|
14
|
+
base: "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent) disabled:pointer-events-none disabled:opacity-50",
|
|
15
|
+
icon: "shrink-0",
|
|
16
|
+
/**
|
|
17
|
+
* Caja y no texto suelto: el contenido del slot puede ser cualquier
|
|
18
|
+
* cosa —la muestra de color del campo es un `span` con `size-4`— y
|
|
19
|
+
* dentro de un envoltorio en línea el ancho y el alto no se aplican.
|
|
20
|
+
* Con una muestra de 16 px dio 2, que era solo su borde.
|
|
21
|
+
*/
|
|
22
|
+
label: "inline-flex items-center",
|
|
23
|
+
/** El giro se dibuja con un borde: un icono más sería otra descarga. */
|
|
24
|
+
spinner: "shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
25
|
+
},
|
|
26
|
+
variants: {
|
|
27
|
+
color: accentByColor("base"),
|
|
28
|
+
groupOrientation: {
|
|
29
|
+
horizontal: { base: "not-last:not-first:rounded-none not-only:first:rounded-e-none not-only:last:rounded-s-none focus-visible:z-1" },
|
|
30
|
+
vertical: { base: "not-last:not-first:rounded-none not-only:first:rounded-b-none not-only:last:rounded-t-none focus-visible:z-1" }
|
|
31
|
+
},
|
|
32
|
+
radius: radiusByStep("base"),
|
|
33
|
+
/**
|
|
34
|
+
* Sin etiqueta el botón es cuadrado, y eso sí combina con el
|
|
35
|
+
* tamaño: por eso `size` publica su altura en una variable y aquí
|
|
36
|
+
* se consume como ancho. Escribirlo con `aspect-square` parecía
|
|
37
|
+
* bastar y no basta —un `inline-flex` de ancho automático lo
|
|
38
|
+
* ensancha el relleno lateral—, y fijar el ancho por valor
|
|
39
|
+
* devolvería las cinco combinaciones.
|
|
40
|
+
*/
|
|
41
|
+
shape: {
|
|
42
|
+
square: { base: "w-(--vuno-button-size) px-0" }
|
|
43
|
+
},
|
|
44
|
+
size: {
|
|
45
|
+
xs: { base: "h-(--vuno-button-size) gap-1 px-2 text-xs [--vuno-button-size:1.5rem]", icon: "size-3.5" },
|
|
46
|
+
sm: { base: "h-(--vuno-button-size) gap-1.5 px-2.5 text-sm [--vuno-button-size:1.75rem]", icon: "size-4" },
|
|
47
|
+
md: { base: "h-(--vuno-button-size) gap-1.5 px-3 text-sm [--vuno-button-size:2rem]", icon: "size-4" },
|
|
48
|
+
lg: { base: "h-(--vuno-button-size) gap-2 px-3.5 text-base [--vuno-button-size:2.25rem]", icon: "size-5" },
|
|
49
|
+
xl: { base: "h-(--vuno-button-size) gap-2 px-4 text-base [--vuno-button-size:2.5rem]", icon: "size-5" }
|
|
50
|
+
},
|
|
51
|
+
variant: {
|
|
52
|
+
ghost: { base: "text-(--vuno-accent) hover:bg-(--vuno-accent)/10" },
|
|
53
|
+
link: { base: "text-(--vuno-accent) hover:underline" },
|
|
54
|
+
outline: { base: "border border-(--vuno-accent) text-(--vuno-accent) hover:bg-(--vuno-accent)/10" },
|
|
55
|
+
soft: { base: "bg-(--vuno-accent)/10 text-(--vuno-accent) hover:bg-(--vuno-accent)/20" },
|
|
56
|
+
solid: { base: "bg-(--vuno-accent) text-(--vuno-accent-contrast) hover:bg-(--vuno-accent)/90" }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
+
import { useVunoControlGroup } from "#vuno/composables/internal/useVunoControlGroup";
|
|
3
4
|
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
|
-
import Icon from "#vuno/components/
|
|
5
|
+
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
6
|
+
defineOptions({ name: "VunoButton" });
|
|
5
7
|
const props = defineProps({
|
|
6
8
|
color: { type: String, required: false, default: "primary" },
|
|
7
9
|
disabled: { type: Boolean, required: false },
|
|
8
10
|
icon: { type: String, required: false, default: void 0 },
|
|
9
11
|
label: { type: String, required: false, default: void 0 },
|
|
10
12
|
loading: { type: Boolean, required: false },
|
|
11
|
-
|
|
13
|
+
radius: { type: String, required: false, default: void 0 },
|
|
14
|
+
size: { type: String, required: false, default: void 0 },
|
|
12
15
|
trailing: { type: Boolean, required: false },
|
|
13
16
|
type: { type: String, required: false, default: "button" },
|
|
14
17
|
ui: { type: Object, required: false, default: void 0 },
|
|
@@ -16,14 +19,18 @@ const props = defineProps({
|
|
|
16
19
|
});
|
|
17
20
|
const slots = defineSlots();
|
|
18
21
|
const hasContent = computed(() => Boolean(props.label) || Boolean(slots.default));
|
|
22
|
+
const controlGroup = useVunoControlGroup();
|
|
23
|
+
const size = computed(() => props.size ?? controlGroup.size.value ?? "md");
|
|
19
24
|
const isDisabled = computed(() => Boolean(props.disabled) || Boolean(props.loading));
|
|
20
25
|
const ui = useTheme(
|
|
21
26
|
"button",
|
|
22
27
|
() => props.ui,
|
|
23
28
|
() => ({
|
|
24
29
|
color: props.color,
|
|
30
|
+
groupOrientation: controlGroup.orientation.value,
|
|
31
|
+
radius: props.radius,
|
|
25
32
|
shape: hasContent.value ? void 0 : "square",
|
|
26
|
-
size:
|
|
33
|
+
size: size.value,
|
|
27
34
|
variant: props.variant
|
|
28
35
|
})
|
|
29
36
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { VunoColor,
|
|
1
|
+
import type { VunoColor, VunoRadius, VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
2
3
|
type VunoButtonVariant = 'ghost' | 'link' | 'outline' | 'soft' | 'solid';
|
|
3
|
-
type
|
|
4
|
+
type Props = {
|
|
4
5
|
color?: VunoColor;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
/** Nombre Iconify, como los de `useIcons`. */
|
|
@@ -8,6 +9,8 @@ type __VLS_Props = {
|
|
|
8
9
|
label?: string;
|
|
9
10
|
/** Bloquea el botón y sustituye el icono por un giro. */
|
|
10
11
|
loading?: boolean;
|
|
12
|
+
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
13
|
+
radius?: VunoRadius;
|
|
11
14
|
size?: VunoSize;
|
|
12
15
|
/** El icono va detrás de la etiqueta en vez de delante. */
|
|
13
16
|
trailing?: boolean;
|
|
@@ -17,7 +20,7 @@ type __VLS_Props = {
|
|
|
17
20
|
* convierte cualquier acción secundaria en un envío accidental.
|
|
18
21
|
*/
|
|
19
22
|
type?: 'button' | 'reset' | 'submit';
|
|
20
|
-
ui?:
|
|
23
|
+
ui?: VunoUi<'button'>;
|
|
21
24
|
variant?: VunoButtonVariant;
|
|
22
25
|
};
|
|
23
26
|
type __VLS_Slots = {
|
|
@@ -26,14 +29,15 @@ type __VLS_Slots = {
|
|
|
26
29
|
/** Va después de todo lo demás; la tabla mete ahí su contador. */
|
|
27
30
|
trailing?: () => unknown;
|
|
28
31
|
};
|
|
29
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
30
33
|
color: VunoColor;
|
|
31
34
|
icon: string;
|
|
32
|
-
|
|
35
|
+
radius: VunoRadius;
|
|
33
36
|
size: VunoSize;
|
|
34
37
|
variant: VunoButtonVariant;
|
|
35
38
|
label: string;
|
|
36
|
-
|
|
39
|
+
type: "button" | "reset" | "submit";
|
|
40
|
+
ui: VunoUi<"button">;
|
|
37
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
42
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
43
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VunoRadius } from '#vuno/types/base';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
4
|
/**
|
|
4
5
|
* Una caja que agrupa contenido, con cabecera y pie opcionales.
|
|
5
6
|
*
|
|
@@ -14,7 +15,9 @@ import type { VunoSlots } from '#vuno/types/base';
|
|
|
14
15
|
* lector de pantalla. Si hace falta navegar, se envuelve en un `NuxtLink` o
|
|
15
16
|
* se pone un botón dentro, que es lo que hace el playground.
|
|
16
17
|
*/
|
|
17
|
-
type
|
|
18
|
+
type Props = {
|
|
19
|
+
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
20
|
+
radius?: VunoRadius;
|
|
18
21
|
/**
|
|
19
22
|
* El elemento que pinta. `div` de serie; `form` para una tarjeta que
|
|
20
23
|
* se envía, `NuxtLink` para una que navega, `article` o `section`
|
|
@@ -45,7 +48,7 @@ type __VLS_Props = {
|
|
|
45
48
|
* tarjeta enlazada.
|
|
46
49
|
*/
|
|
47
50
|
tag?: Component | string;
|
|
48
|
-
ui?:
|
|
51
|
+
ui?: VunoUi<'card'>;
|
|
49
52
|
/**
|
|
50
53
|
* `outline` para una tarjeta sobre la página: borde y un escalón de
|
|
51
54
|
* elevación. `soft` para una que ya está dentro de algo levantado —un
|
|
@@ -75,10 +78,11 @@ type __VLS_Slots = {
|
|
|
75
78
|
footer?: () => unknown;
|
|
76
79
|
header?: () => unknown;
|
|
77
80
|
};
|
|
78
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
81
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
82
|
+
radius: VunoRadius;
|
|
79
83
|
variant: "outline" | "plain" | "soft";
|
|
80
|
-
ui: VunoSlots;
|
|
81
84
|
tag: Component | string;
|
|
85
|
+
ui: VunoUi<"card">;
|
|
82
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
83
87
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
84
88
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const cardTheme: Record<"card", {
|
|
2
|
+
/**
|
|
3
|
+
* La tarjeta. Tres regiones apiladas y separadas por una línea, que es la
|
|
4
|
+
* forma que tenía el caso real escrito a mano antes de que existiera.
|
|
5
|
+
*
|
|
6
|
+
* El relleno va en cada región y no en la raíz: con él en la raíz, la línea
|
|
7
|
+
* divisoria no llegaría a los bordes y quedaría flotando en medio.
|
|
8
|
+
*
|
|
9
|
+
* **La raíz lleva anillo de foco desde que existe `tag`.** Con `tag` la
|
|
10
|
+
* tarjeta puede **ser** un enlace o un botón, y entonces recibe el foco.
|
|
11
|
+
*
|
|
12
|
+
* Y aquí hay que decir qué pasaba de verdad, porque lo primero que se
|
|
13
|
+
* escribió en este mismo comentario era falso y lo desmintió la medición.
|
|
14
|
+
* **No se quedaba sin contorno**: quitando las tres clases con el elemento
|
|
15
|
+
* enfocado, el contorno calculado sigue siendo `1px auto` —el del navegador,
|
|
16
|
+
* que el preflight de Tailwind no neutraliza— y con las clases pasa a `2px
|
|
17
|
+
* solid` del acento, con 2px de separación. O sea que el defecto no era una
|
|
18
|
+
* tarjeta invisible al tabular, sino **la única superficie enfocable de vuno
|
|
19
|
+
* que no llevaba el anillo del sistema**: grosor, color y separación
|
|
20
|
+
* distintos de los del botón, el campo y el enlace de la miga, y a merced de
|
|
21
|
+
* lo que pinte cada navegador. Que ya lo era se ve en que el ejemplo de la
|
|
22
|
+
* ficha llevaba el anillo escrito a mano sobre el enlace que la envolvía.
|
|
23
|
+
*
|
|
24
|
+
* Va **siempre puesto y sin variante que lo encienda**, que es lo contrario
|
|
25
|
+
* de lo que pide el reflejo. El motivo es que la condición ya la impone
|
|
26
|
+
* `:focus-visible`: un elemento que no puede recibir el foco no la cumple
|
|
27
|
+
* nunca, así que sobre un `div` las tres clases no pintan nada —medido: con
|
|
28
|
+
* `tag` por defecto la tarjeta ni siquiera es parada del tabulador—. Una
|
|
29
|
+
* variante sería una segunda copia, más débil, de una condición que el CSS
|
|
30
|
+
* ya garantiza, y además tendría que **adivinar** si un `tag` cualquiera es
|
|
31
|
+
* enfocable; se equivocaría justo en el caso peligroso, el de un `div` con
|
|
32
|
+
* un `tabindex` llegado por atributos, dejando sin anillo algo que sí toma
|
|
33
|
+
* el foco.
|
|
34
|
+
*
|
|
35
|
+
* El acento se declara aquí, como en `breadcrumbLink` y en la pestaña: la
|
|
36
|
+
* tarjeta no tiene variantes de color de las que sacarlo, y sin declararlo
|
|
37
|
+
* `outline-(--vuno-accent)` se quedaría con lo que hubiera heredado.
|
|
38
|
+
*/
|
|
39
|
+
readonly slots: {
|
|
40
|
+
readonly body: "p-4 text-vuno-body";
|
|
41
|
+
readonly footer: "p-4";
|
|
42
|
+
readonly header: "p-4 font-semibold text-vuno-strong";
|
|
43
|
+
readonly root: "flex w-full flex-col divide-y divide-vuno-border rounded-sm [--vuno-accent:var(--color-vuno-primary)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent)";
|
|
44
|
+
};
|
|
45
|
+
readonly variants: {
|
|
46
|
+
readonly radius: Record<import("../../types/base.js").VunoRadius, Record<"root", string>>;
|
|
47
|
+
readonly variant: {
|
|
48
|
+
readonly outline: {
|
|
49
|
+
readonly root: "border border-vuno-border bg-vuno-surface-1";
|
|
50
|
+
};
|
|
51
|
+
readonly plain: {};
|
|
52
|
+
readonly soft: {
|
|
53
|
+
readonly root: "bg-vuno-surface-2";
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { radiusByStep } from "#vuno/theme/shared";
|
|
2
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
3
|
+
export const cardTheme = defineTheme("card", {
|
|
4
|
+
/**
|
|
5
|
+
* La tarjeta. Tres regiones apiladas y separadas por una línea, que es la
|
|
6
|
+
* forma que tenía el caso real escrito a mano antes de que existiera.
|
|
7
|
+
*
|
|
8
|
+
* El relleno va en cada región y no en la raíz: con él en la raíz, la línea
|
|
9
|
+
* divisoria no llegaría a los bordes y quedaría flotando en medio.
|
|
10
|
+
*
|
|
11
|
+
* **La raíz lleva anillo de foco desde que existe `tag`.** Con `tag` la
|
|
12
|
+
* tarjeta puede **ser** un enlace o un botón, y entonces recibe el foco.
|
|
13
|
+
*
|
|
14
|
+
* Y aquí hay que decir qué pasaba de verdad, porque lo primero que se
|
|
15
|
+
* escribió en este mismo comentario era falso y lo desmintió la medición.
|
|
16
|
+
* **No se quedaba sin contorno**: quitando las tres clases con el elemento
|
|
17
|
+
* enfocado, el contorno calculado sigue siendo `1px auto` —el del navegador,
|
|
18
|
+
* que el preflight de Tailwind no neutraliza— y con las clases pasa a `2px
|
|
19
|
+
* solid` del acento, con 2px de separación. O sea que el defecto no era una
|
|
20
|
+
* tarjeta invisible al tabular, sino **la única superficie enfocable de vuno
|
|
21
|
+
* que no llevaba el anillo del sistema**: grosor, color y separación
|
|
22
|
+
* distintos de los del botón, el campo y el enlace de la miga, y a merced de
|
|
23
|
+
* lo que pinte cada navegador. Que ya lo era se ve en que el ejemplo de la
|
|
24
|
+
* ficha llevaba el anillo escrito a mano sobre el enlace que la envolvía.
|
|
25
|
+
*
|
|
26
|
+
* Va **siempre puesto y sin variante que lo encienda**, que es lo contrario
|
|
27
|
+
* de lo que pide el reflejo. El motivo es que la condición ya la impone
|
|
28
|
+
* `:focus-visible`: un elemento que no puede recibir el foco no la cumple
|
|
29
|
+
* nunca, así que sobre un `div` las tres clases no pintan nada —medido: con
|
|
30
|
+
* `tag` por defecto la tarjeta ni siquiera es parada del tabulador—. Una
|
|
31
|
+
* variante sería una segunda copia, más débil, de una condición que el CSS
|
|
32
|
+
* ya garantiza, y además tendría que **adivinar** si un `tag` cualquiera es
|
|
33
|
+
* enfocable; se equivocaría justo en el caso peligroso, el de un `div` con
|
|
34
|
+
* un `tabindex` llegado por atributos, dejando sin anillo algo que sí toma
|
|
35
|
+
* el foco.
|
|
36
|
+
*
|
|
37
|
+
* El acento se declara aquí, como en `breadcrumbLink` y en la pestaña: la
|
|
38
|
+
* tarjeta no tiene variantes de color de las que sacarlo, y sin declararlo
|
|
39
|
+
* `outline-(--vuno-accent)` se quedaría con lo que hubiera heredado.
|
|
40
|
+
*/
|
|
41
|
+
slots: {
|
|
42
|
+
body: "p-4 text-vuno-body",
|
|
43
|
+
footer: "p-4",
|
|
44
|
+
header: "p-4 font-semibold text-vuno-strong",
|
|
45
|
+
root: "flex w-full flex-col divide-y divide-vuno-border rounded-sm [--vuno-accent:var(--color-vuno-primary)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent)"
|
|
46
|
+
},
|
|
47
|
+
variants: {
|
|
48
|
+
radius: radiusByStep("root"),
|
|
49
|
+
/*
|
|
50
|
+
* `outline` sube un escalón sobre la página y se cierra con un borde.
|
|
51
|
+
* `soft` sube dos y no lleva borde, porque va dentro de algo que ya
|
|
52
|
+
* está levantado y ahí otro borde no separa nada: lo que distingue es
|
|
53
|
+
* la elevación.
|
|
54
|
+
*/
|
|
55
|
+
variant: {
|
|
56
|
+
outline: { root: "border border-vuno-border bg-vuno-surface-1" },
|
|
57
|
+
/* Sin contenedor: el marco lo pone quien la envuelve. */
|
|
58
|
+
plain: {},
|
|
59
|
+
soft: { root: "bg-vuno-surface-2" }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useTheme } from "#vuno/composables/useTheme";
|
|
3
3
|
import { filled } from "#vuno/internal/slots";
|
|
4
|
+
defineOptions({ name: "VunoCard" });
|
|
4
5
|
const props = defineProps({
|
|
6
|
+
radius: { type: String, required: false, default: void 0 },
|
|
5
7
|
tag: { type: null, required: false, default: "div" },
|
|
6
8
|
ui: { type: Object, required: false, default: void 0 },
|
|
7
9
|
variant: { type: String, required: false, default: "outline" }
|
|
@@ -10,7 +12,7 @@ const slots = defineSlots();
|
|
|
10
12
|
const ui = useTheme(
|
|
11
13
|
"card",
|
|
12
14
|
() => props.ui,
|
|
13
|
-
() => ({ variant: props.variant })
|
|
15
|
+
() => ({ radius: props.radius, variant: props.variant })
|
|
14
16
|
);
|
|
15
17
|
</script>
|
|
16
18
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VunoRadius } from '#vuno/types/base';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
4
|
/**
|
|
4
5
|
* Una caja que agrupa contenido, con cabecera y pie opcionales.
|
|
5
6
|
*
|
|
@@ -14,7 +15,9 @@ import type { VunoSlots } from '#vuno/types/base';
|
|
|
14
15
|
* lector de pantalla. Si hace falta navegar, se envuelve en un `NuxtLink` o
|
|
15
16
|
* se pone un botón dentro, que es lo que hace el playground.
|
|
16
17
|
*/
|
|
17
|
-
type
|
|
18
|
+
type Props = {
|
|
19
|
+
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
20
|
+
radius?: VunoRadius;
|
|
18
21
|
/**
|
|
19
22
|
* El elemento que pinta. `div` de serie; `form` para una tarjeta que
|
|
20
23
|
* se envía, `NuxtLink` para una que navega, `article` o `section`
|
|
@@ -45,7 +48,7 @@ type __VLS_Props = {
|
|
|
45
48
|
* tarjeta enlazada.
|
|
46
49
|
*/
|
|
47
50
|
tag?: Component | string;
|
|
48
|
-
ui?:
|
|
51
|
+
ui?: VunoUi<'card'>;
|
|
49
52
|
/**
|
|
50
53
|
* `outline` para una tarjeta sobre la página: borde y un escalón de
|
|
51
54
|
* elevación. `soft` para una que ya está dentro de algo levantado —un
|
|
@@ -75,10 +78,11 @@ type __VLS_Slots = {
|
|
|
75
78
|
footer?: () => unknown;
|
|
76
79
|
header?: () => unknown;
|
|
77
80
|
};
|
|
78
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
81
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
82
|
+
radius: VunoRadius;
|
|
79
83
|
variant: "outline" | "plain" | "soft";
|
|
80
|
-
ui: VunoSlots;
|
|
81
84
|
tag: Component | string;
|
|
85
|
+
ui: VunoUi<"card">;
|
|
82
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
83
87
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
84
88
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Código sin transformar. También es lo que se copia al portapapeles. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** HTML completo producido por un resaltador de confianza, como Shiki. */
|
|
6
|
+
highlighted?: string;
|
|
7
|
+
/** Nombre accesible cuando el bloque necesita desplazamiento horizontal. */
|
|
8
|
+
label?: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
ui?: VunoUi<'code'>;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
|
+
label: string;
|
|
14
|
+
ui: VunoUi<"code">;
|
|
15
|
+
highlighted: string;
|
|
16
|
+
language: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const codeTheme: Record<"code", {
|
|
2
|
+
readonly slots: {
|
|
3
|
+
readonly copy: "absolute inset-e-2 top-1 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 max-sm:top-0 max-sm:size-11 max-sm:opacity-100 pointer-coarse:top-0 pointer-coarse:size-11 pointer-coarse:opacity-100";
|
|
4
|
+
readonly copyError: "border-t border-vuno-error/25 bg-vuno-error/10 px-4 py-2 text-xs text-vuno-error";
|
|
5
|
+
readonly fallback: "text-vuno-body";
|
|
6
|
+
readonly header: "flex items-center gap-2 border-b border-vuno-border/70 px-4 py-2 font-mono text-xs text-vuno-muted";
|
|
7
|
+
readonly live: "sr-only";
|
|
8
|
+
readonly root: "group relative border-t border-vuno-border";
|
|
9
|
+
readonly scroller: "overflow-x-auto text-sm/relaxed [&_pre]:px-4 [&_pre]:py-3.5";
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const codeTheme = defineTheme("code", {
|
|
3
|
+
slots: {
|
|
4
|
+
copy: "absolute inset-e-2 top-1 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 max-sm:top-0 max-sm:size-11 max-sm:opacity-100 pointer-coarse:top-0 pointer-coarse:size-11 pointer-coarse:opacity-100",
|
|
5
|
+
copyError: "border-t border-vuno-error/25 bg-vuno-error/10 px-4 py-2 text-xs text-vuno-error",
|
|
6
|
+
fallback: "text-vuno-body",
|
|
7
|
+
header: "flex items-center gap-2 border-b border-vuno-border/70 px-4 py-2 font-mono text-xs text-vuno-muted",
|
|
8
|
+
live: "sr-only",
|
|
9
|
+
root: "group relative border-t border-vuno-border",
|
|
10
|
+
scroller: "overflow-x-auto text-sm/relaxed [&_pre]:px-4 [&_pre]:py-3.5"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from "vue";
|
|
3
|
+
import { useIcons, useMessages, useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
import Button from "#vuno/components/Button/Button.vue";
|
|
5
|
+
defineOptions({ name: "VunoCode" });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
code: { type: String, required: true },
|
|
8
|
+
highlighted: { type: String, required: false, default: void 0 },
|
|
9
|
+
label: { type: String, required: false, default: void 0 },
|
|
10
|
+
language: { type: String, required: false, default: "text" },
|
|
11
|
+
ui: { type: Object, required: false, default: void 0 }
|
|
12
|
+
});
|
|
13
|
+
const icons = useIcons();
|
|
14
|
+
const messages = useMessages();
|
|
15
|
+
const ui = useTheme("code", () => props.ui);
|
|
16
|
+
const copied = ref(false);
|
|
17
|
+
const copyFailed = ref(false);
|
|
18
|
+
const overflows = ref(false);
|
|
19
|
+
const scroller = useTemplateRef("scroller");
|
|
20
|
+
const copyLabel = computed(() => {
|
|
21
|
+
const action = copied.value ? messages.value.codeCopied : messages.value.codeCopy;
|
|
22
|
+
return props.label ? `${action}: ${props.label}` : action;
|
|
23
|
+
});
|
|
24
|
+
let observer;
|
|
25
|
+
let timer;
|
|
26
|
+
function syncOverflow() {
|
|
27
|
+
const element = scroller.value;
|
|
28
|
+
overflows.value = !!element && element.scrollWidth > element.clientWidth + 1;
|
|
29
|
+
}
|
|
30
|
+
async function copy() {
|
|
31
|
+
copyFailed.value = false;
|
|
32
|
+
try {
|
|
33
|
+
await navigator.clipboard.writeText(props.code);
|
|
34
|
+
} catch {
|
|
35
|
+
copied.value = false;
|
|
36
|
+
copyFailed.value = true;
|
|
37
|
+
clearTimeout(timer);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
copied.value = true;
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
timer = setTimeout(() => copied.value = false, 2e3);
|
|
43
|
+
}
|
|
44
|
+
watch(
|
|
45
|
+
() => [props.code, props.highlighted],
|
|
46
|
+
() => void nextTick(syncOverflow)
|
|
47
|
+
);
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
syncOverflow();
|
|
50
|
+
observer = new ResizeObserver(syncOverflow);
|
|
51
|
+
if (scroller.value) observer.observe(scroller.value);
|
|
52
|
+
});
|
|
53
|
+
onBeforeUnmount(() => {
|
|
54
|
+
observer?.disconnect();
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<div :class="ui.root">
|
|
61
|
+
<div :class="ui.header">{{ props.language }}</div>
|
|
62
|
+
|
|
63
|
+
<Button
|
|
64
|
+
:aria-label="copyLabel"
|
|
65
|
+
:class="ui.copy"
|
|
66
|
+
color="neutral"
|
|
67
|
+
:icon="copied ? icons.codeCopied : icons.codeCopy"
|
|
68
|
+
size="xs"
|
|
69
|
+
variant="soft"
|
|
70
|
+
@click="copy"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<div
|
|
74
|
+
ref="scroller"
|
|
75
|
+
:aria-label="overflows ? props.label ?? messages.codeRegion : void 0"
|
|
76
|
+
:class="ui.scroller"
|
|
77
|
+
:role="overflows ? 'region' : void 0"
|
|
78
|
+
:tabindex="overflows ? 0 : void 0"
|
|
79
|
+
>
|
|
80
|
+
<!-- El HTML viene de un resaltador elegido por quien consume el componente. -->
|
|
81
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
82
|
+
<!-- nosemgrep: javascript.vue.security.audit.xss.templates.avoid-v-html.avoid-v-html -->
|
|
83
|
+
<div
|
|
84
|
+
v-if="props.highlighted"
|
|
85
|
+
v-html="props.highlighted"
|
|
86
|
+
/>
|
|
87
|
+
<!-- eslint-enable vue/no-v-html -->
|
|
88
|
+
|
|
89
|
+
<pre
|
|
90
|
+
v-else
|
|
91
|
+
:class="ui.fallback"
|
|
92
|
+
><code>{{ props.code }}</code></pre>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<p
|
|
96
|
+
v-if="copyFailed"
|
|
97
|
+
:class="ui.copyError"
|
|
98
|
+
role="alert"
|
|
99
|
+
>
|
|
100
|
+
{{ messages.codeCopyFailed }}
|
|
101
|
+
</p>
|
|
102
|
+
|
|
103
|
+
<span
|
|
104
|
+
aria-live="polite"
|
|
105
|
+
:class="ui.live"
|
|
106
|
+
>{{ copied ? messages.codeCopiedAnnouncement : "" }}</span
|
|
107
|
+
>
|
|
108
|
+
</div>
|
|
109
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Código sin transformar. También es lo que se copia al portapapeles. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** HTML completo producido por un resaltador de confianza, como Shiki. */
|
|
6
|
+
highlighted?: string;
|
|
7
|
+
/** Nombre accesible cuando el bloque necesita desplazamiento horizontal. */
|
|
8
|
+
label?: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
ui?: VunoUi<'code'>;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
|
+
label: string;
|
|
14
|
+
ui: VunoUi<"code">;
|
|
15
|
+
highlighted: string;
|
|
16
|
+
language: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { VunoConfirmOptions } from '#vuno/types/confirm';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
3
|
type __VLS_Props = VunoConfirmOptions & {
|
|
4
4
|
loading?: boolean;
|
|
5
|
-
ui?:
|
|
5
|
+
ui?: VunoUi<'confirm'>;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_Slots = {
|
|
8
8
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const confirmTheme: Record<"confirm", {
|
|
2
|
+
readonly slots: {
|
|
3
|
+
readonly body: "flex items-start gap-3";
|
|
4
|
+
readonly content: "";
|
|
5
|
+
readonly description: "min-w-0 space-y-1";
|
|
6
|
+
readonly footer: "justify-end";
|
|
7
|
+
readonly icon: "size-5 shrink-0 text-(--vuno-accent)";
|
|
8
|
+
};
|
|
9
|
+
readonly variants: {
|
|
10
|
+
readonly color: Record<import("../../types/base.js").VunoColor, Record<"icon", string>>;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { accentByColor } from "#vuno/theme/shared";
|
|
2
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
3
|
+
export const confirmTheme = defineTheme("confirm", {
|
|
4
|
+
slots: {
|
|
5
|
+
body: "flex items-start gap-3",
|
|
6
|
+
content: "",
|
|
7
|
+
description: "min-w-0 space-y-1",
|
|
8
|
+
footer: "justify-end",
|
|
9
|
+
// Mismo caso que el aviso: el color por variable, no por nombre.
|
|
10
|
+
icon: "size-5 shrink-0 text-(--vuno-accent)"
|
|
11
|
+
},
|
|
12
|
+
variants: { color: accentByColor("icon") }
|
|
13
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, nextTick } from "vue";
|
|
3
|
-
import Modal from "#vuno/components/overlays/Modal.vue";
|
|
4
|
-
import Button from "#vuno/components/actions/Button.vue";
|
|
5
|
-
import Icon from "#vuno/components/actions/Icon.vue";
|
|
6
3
|
import { useIcons, useMessages, useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
import Button from "#vuno/components/Button/Button.vue";
|
|
5
|
+
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
6
|
+
import Modal from "#vuno/components/Modal/Modal.vue";
|
|
7
|
+
defineOptions({ name: "VunoConfirm" });
|
|
8
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
7
9
|
const props = defineProps({
|
|
8
10
|
alert: { type: Boolean, required: false },
|
|
9
11
|
cancelLabel: { type: String, required: false },
|
|
@@ -17,11 +19,14 @@ const props = defineProps({
|
|
|
17
19
|
});
|
|
18
20
|
const emit = defineEmits(["cancel", "confirm"]);
|
|
19
21
|
defineSlots();
|
|
20
|
-
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
21
22
|
const icons = useIcons();
|
|
22
23
|
const messages = useMessages();
|
|
23
24
|
const color = computed(() => props.color ?? "error");
|
|
24
|
-
const ui = useTheme(
|
|
25
|
+
const ui = useTheme(
|
|
26
|
+
"confirm",
|
|
27
|
+
() => props.ui,
|
|
28
|
+
() => ({ color: color.value })
|
|
29
|
+
);
|
|
25
30
|
const modalUi = computed(() => ({ content: ui.value.content, footer: ui.value.footer }));
|
|
26
31
|
function onCancel() {
|
|
27
32
|
open.value = false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { VunoConfirmOptions } from '#vuno/types/confirm';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
3
|
type __VLS_Props = VunoConfirmOptions & {
|
|
4
4
|
loading?: boolean;
|
|
5
|
-
ui?:
|
|
5
|
+
ui?: VunoUi<'confirm'>;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_Slots = {
|
|
8
8
|
/**
|