@groupteknology/vuno 2.0.0 → 3.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 +193 -175
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -1
- package/dist/runtime/app/assets/css/dialog.css +1 -1
- package/dist/runtime/app/assets/css/main.css +1 -1
- 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 +2 -2
- package/dist/runtime/app/components/Alert/Alert.theme.d.ts +7 -6
- package/dist/runtime/app/components/Alert/Alert.theme.js +7 -6
- package/dist/runtime/app/components/Alert/Alert.types.d.ts +10 -0
- package/dist/runtime/app/components/Alert/Alert.vue +17 -8
- package/dist/runtime/app/components/Alert/Alert.vue.d.ts +2 -2
- package/dist/runtime/app/components/App/App.d.vue.ts +3 -19
- package/dist/runtime/app/components/App/App.types.d.ts +4 -0
- package/dist/runtime/app/components/App/App.vue +48 -29
- package/dist/runtime/app/components/App/App.vue.d.ts +3 -19
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +2 -3
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +5 -5
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +7 -9
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue +27 -36
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +3 -3
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +3 -3
- package/dist/runtime/app/components/Avatar/Avatar.d.vue.ts +5 -22
- package/dist/runtime/app/components/Avatar/Avatar.types.d.ts +10 -0
- package/dist/runtime/app/components/Avatar/Avatar.types.js +0 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue.d.ts +5 -22
- package/dist/runtime/app/components/Badge/Badge.d.vue.ts +7 -26
- package/dist/runtime/app/components/Badge/Badge.types.d.ts +12 -0
- package/dist/runtime/app/components/Badge/Badge.types.js +0 -0
- package/dist/runtime/app/components/Badge/Badge.vue.d.ts +7 -26
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.d.vue.ts +7 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.theme.d.ts +15 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.theme.js +16 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.types.d.ts +7 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.types.js +0 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.vue +109 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.vue.d.ts +7 -0
- package/dist/runtime/app/components/Button/Button.d.vue.ts +11 -31
- package/dist/runtime/app/components/Button/Button.theme.d.ts +36 -22
- package/dist/runtime/app/components/Button/Button.theme.js +28 -20
- package/dist/runtime/app/components/Button/Button.types.d.ts +24 -0
- package/dist/runtime/app/components/Button/Button.types.js +0 -0
- package/dist/runtime/app/components/Button/Button.vue +84 -33
- package/dist/runtime/app/components/Button/Button.vue.d.ts +11 -31
- package/dist/runtime/app/components/Card/Card.d.vue.ts +7 -69
- package/dist/runtime/app/components/Card/Card.theme.d.ts +56 -13
- package/dist/runtime/app/components/Card/Card.theme.js +39 -19
- package/dist/runtime/app/components/Card/Card.types.d.ts +12 -0
- package/dist/runtime/app/components/Card/Card.types.js +0 -0
- package/dist/runtime/app/components/Card/Card.vue +17 -11
- package/dist/runtime/app/components/Card/Card.vue.d.ts +7 -69
- package/dist/runtime/app/components/Code/Code.d.vue.ts +3 -13
- package/dist/runtime/app/components/Code/Code.theme.d.ts +1 -1
- package/dist/runtime/app/components/Code/Code.theme.js +1 -1
- package/dist/runtime/app/components/Code/Code.types.d.ts +8 -0
- package/dist/runtime/app/components/Code/Code.types.js +0 -0
- package/dist/runtime/app/components/Code/Code.vue +12 -5
- package/dist/runtime/app/components/Code/Code.vue.d.ts +3 -13
- package/dist/runtime/app/components/Collapsible/Collapsible.d.vue.ts +31 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.theme.d.ts +6 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.theme.js +7 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.types.d.ts +4 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.types.js +0 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.vue +72 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.vue.d.ts +31 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.d.vue.ts +12 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.types.d.ts +13 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.types.js +0 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.vue +55 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.vue.d.ts +12 -0
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +2 -6
- package/dist/runtime/app/components/Confirm/Confirm.types.d.ts +6 -0
- package/dist/runtime/app/components/Confirm/Confirm.types.js +0 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +2 -6
- package/dist/runtime/app/components/Container/Container.d.vue.ts +4 -28
- package/dist/runtime/app/components/Container/Container.types.d.ts +9 -0
- package/dist/runtime/app/components/Container/Container.types.js +0 -0
- package/dist/runtime/app/components/Container/Container.vue +1 -1
- package/dist/runtime/app/components/Container/Container.vue.d.ts +4 -28
- package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +5 -14
- package/dist/runtime/app/components/ControlGroup/ControlGroup.types.d.ts +9 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.types.js +0 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +5 -14
- package/dist/runtime/app/components/DataTable/DataTable.d.vue.ts +64 -0
- package/dist/runtime/app/components/DataTable/DataTable.theme.d.ts +17 -0
- package/dist/runtime/app/components/DataTable/DataTable.theme.js +19 -0
- package/dist/runtime/app/components/DataTable/DataTable.types.d.ts +13 -0
- package/dist/runtime/app/components/DataTable/DataTable.types.js +0 -0
- package/dist/runtime/app/components/DataTable/DataTable.vue +356 -0
- package/dist/runtime/app/components/DataTable/DataTable.vue.d.ts +64 -0
- package/dist/runtime/app/components/{Table/internal/useVunoTable.d.ts → DataTable/internal/useVunoDataTable.d.ts} +6 -29
- package/dist/runtime/app/components/{Table/internal/useVunoTable.js → DataTable/internal/useVunoDataTable.js} +2 -29
- package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldArray/FieldArray.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.types.js +0 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue +12 -5
- package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.types.js +0 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +1 -1
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldColor/FieldColor.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.types.js +0 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue +3 -3
- package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.types.js +0 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +3 -3
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldFile/FieldFile.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldFile/FieldFile.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.types.js +0 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue +1 -1
- package/dist/runtime/app/components/FieldFile/FieldFile.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +1 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +1 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue +26 -5
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldInput/FieldInput.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.types.js +0 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue +3 -3
- package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldNumber/FieldNumber.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.types.js +0 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +3 -3
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldPassword/FieldPassword.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.types.js +0 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +4 -4
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +3 -2
- package/dist/runtime/app/components/FieldRadio/FieldRadio.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.types.js +0 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +1 -1
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +3 -2
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue +6 -2
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +3 -3
- package/dist/runtime/app/components/FieldSearch/FieldSearch.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.types.js +0 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +4 -4
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +3 -3
- package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +3 -2
- package/dist/runtime/app/components/FieldSelect/FieldSelect.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.types.js +0 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +1 -1
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +3 -2
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +7 -7
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +16 -6
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +7 -7
- package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldSlug/FieldSlug.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.types.js +0 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue +4 -4
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.types.js +0 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +1 -1
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldTags/FieldTags.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.types.js +0 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue +1 -1
- package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +16 -6
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.types.js +0 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +1 -1
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue +4 -4
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue.d.ts +4 -3
- package/dist/runtime/app/components/Form/Form.d.vue.ts +3 -19
- package/dist/runtime/app/components/Form/Form.types.d.ts +8 -0
- package/dist/runtime/app/components/Form/Form.types.js +0 -0
- package/dist/runtime/app/components/Form/Form.vue +3 -3
- package/dist/runtime/app/components/Form/Form.vue.d.ts +3 -19
- package/dist/runtime/app/components/FormField/FormField.d.vue.ts +4 -18
- package/dist/runtime/app/components/FormField/FormField.types.d.ts +14 -0
- package/dist/runtime/app/components/FormField/FormField.types.js +0 -0
- package/dist/runtime/app/components/FormField/FormField.vue +26 -10
- package/dist/runtime/app/components/FormField/FormField.vue.d.ts +4 -18
- package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.d.vue.ts +2 -3
- package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.vue.d.ts +2 -3
- package/dist/runtime/app/components/FormModal/FormModal.d.vue.ts +6 -25
- package/dist/runtime/app/components/FormModal/FormModal.types.d.ts +14 -0
- package/dist/runtime/app/components/FormModal/FormModal.types.js +0 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue +12 -2
- package/dist/runtime/app/components/FormModal/FormModal.vue.d.ts +6 -25
- package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +2 -13
- package/dist/runtime/app/components/FormSection/FormSection.types.d.ts +7 -0
- package/dist/runtime/app/components/FormSection/FormSection.types.js +0 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue +11 -4
- package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +2 -13
- package/dist/runtime/app/components/Icon/Icon.d.vue.ts +2 -4
- package/dist/runtime/app/components/Icon/Icon.types.d.ts +3 -0
- package/dist/runtime/app/components/Icon/Icon.types.js +0 -0
- package/dist/runtime/app/components/Icon/Icon.vue.d.ts +2 -4
- package/dist/runtime/app/components/Menu/Menu.d.vue.ts +4 -21
- package/dist/runtime/app/components/Menu/Menu.types.d.ts +7 -0
- package/dist/runtime/app/components/Menu/Menu.types.js +0 -0
- package/dist/runtime/app/components/Menu/Menu.vue +18 -110
- package/dist/runtime/app/components/Menu/Menu.vue.d.ts +4 -21
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.d.vue.ts +26 -0
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.vue +167 -0
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.vue.d.ts +26 -0
- package/dist/runtime/app/components/Modal/Modal.d.vue.ts +6 -18
- package/dist/runtime/app/components/Modal/Modal.theme.d.ts +18 -14
- package/dist/runtime/app/components/Modal/Modal.theme.js +17 -21
- package/dist/runtime/app/components/Modal/Modal.types.d.ts +12 -0
- package/dist/runtime/app/components/Modal/Modal.types.js +0 -0
- package/dist/runtime/app/components/Modal/Modal.vue +99 -65
- package/dist/runtime/app/components/Modal/Modal.vue.d.ts +6 -18
- package/dist/runtime/app/components/Navbar/Navbar.d.vue.ts +3 -28
- package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +2 -3
- package/dist/runtime/app/components/Navbar/Navbar.theme.js +2 -3
- package/dist/runtime/app/components/Navbar/Navbar.types.d.ts +4 -0
- package/dist/runtime/app/components/Navbar/Navbar.types.js +0 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue.d.ts +3 -28
- package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +4 -33
- package/dist/runtime/app/components/NavigationList/NavigationList.keys.d.ts +3 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.keys.js +1 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.types.d.ts +9 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.types.js +0 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue +65 -19
- package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +4 -33
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +3 -24
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.keys.d.ts +7 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.keys.js +3 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.types.d.ts +10 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.types.js +0 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +45 -13
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +3 -24
- package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +3 -10
- package/dist/runtime/app/components/NavigationToc/NavigationToc.types.d.ts +7 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.types.js +0 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +8 -1
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +3 -10
- package/dist/runtime/app/components/Pagination/Pagination.d.vue.ts +5 -23
- package/dist/runtime/app/components/Pagination/Pagination.types.d.ts +11 -0
- package/dist/runtime/app/components/Pagination/Pagination.types.js +0 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue +6 -2
- package/dist/runtime/app/components/Pagination/Pagination.vue.d.ts +5 -23
- package/dist/runtime/app/components/Slideover/Slideover.d.vue.ts +4 -13
- package/dist/runtime/app/components/Slideover/Slideover.types.d.ts +12 -0
- package/dist/runtime/app/components/Slideover/Slideover.types.js +0 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue.d.ts +4 -13
- package/dist/runtime/app/components/State/State.d.vue.ts +2 -2
- package/dist/runtime/app/components/State/State.types.d.ts +15 -0
- package/dist/runtime/app/components/State/State.types.js +0 -0
- package/dist/runtime/app/components/State/State.vue +13 -3
- package/dist/runtime/app/components/State/State.vue.d.ts +2 -2
- package/dist/runtime/app/components/Table/Table.d.vue.ts +8 -55
- package/dist/runtime/app/components/Table/Table.theme.d.ts +17 -35
- package/dist/runtime/app/components/Table/Table.theme.js +15 -48
- package/dist/runtime/app/components/Table/Table.types.d.ts +9 -0
- package/dist/runtime/app/components/Table/Table.types.js +0 -0
- package/dist/runtime/app/components/Table/Table.vue +143 -415
- package/dist/runtime/app/components/Table/Table.vue.d.ts +8 -55
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +13 -3
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue +8 -1
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.d.vue.ts +2 -2
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue.d.ts +2 -2
- package/dist/runtime/app/components/Table/internal/column.d.ts +9 -0
- package/dist/runtime/app/components/Table/internal/column.js +15 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +1 -1
- package/dist/runtime/app/components/Tabs/Tabs.d.vue.ts +5 -24
- package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +15 -6
- package/dist/runtime/app/components/Tabs/Tabs.theme.js +15 -6
- package/dist/runtime/app/components/Tabs/Tabs.types.d.ts +10 -0
- package/dist/runtime/app/components/Tabs/Tabs.types.js +0 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue +91 -17
- package/dist/runtime/app/components/Tabs/Tabs.vue.d.ts +5 -24
- package/dist/runtime/app/components/Text/Text.d.vue.ts +19 -0
- package/dist/runtime/app/components/Text/Text.theme.d.ts +55 -0
- package/dist/runtime/app/components/Text/Text.theme.js +28 -0
- package/dist/runtime/app/components/Text/Text.types.d.ts +9 -0
- package/dist/runtime/app/components/Text/Text.types.js +0 -0
- package/dist/runtime/app/components/Text/Text.vue +37 -0
- package/dist/runtime/app/components/Text/Text.vue.d.ts +19 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.d.vue.ts +17 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.theme.d.ts +5 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.theme.js +6 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.types.d.ts +9 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.types.js +0 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.vue +76 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.vue.d.ts +17 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.d.vue.ts +5 -26
- package/dist/runtime/app/components/Tooltip/Tooltip.types.d.ts +11 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.types.js +0 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue +1 -1
- package/dist/runtime/app/components/Tooltip/Tooltip.vue.d.ts +5 -26
- package/dist/runtime/app/composables/internal/useVunoContext.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoContext.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +3 -4
- package/dist/runtime/app/composables/internal/useVunoDirection.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoDirection.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoFormContext.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoFormContext.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoOverlayBehind.d.ts +6 -0
- package/dist/runtime/app/composables/internal/useVunoOverlayBehind.js +8 -0
- package/dist/runtime/app/composables/useContext.js +2 -3
- package/dist/runtime/app/composables/useForm.js +2 -3
- package/dist/runtime/app/composables/useTableQuery.d.ts +1 -1
- package/dist/runtime/app/composables/useTheme.js +6 -3
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.vue.d.ts → primitives/PrimitiveControl/PrimitiveControl.d.vue.ts} +4 -3
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.theme.d.ts → primitives/PrimitiveControl/PrimitiveControl.theme.d.ts} +1 -1
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.vue → primitives/PrimitiveControl/PrimitiveControl.vue} +1 -1
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.d.vue.ts → primitives/PrimitiveControl/PrimitiveControl.vue.d.ts} +4 -3
- package/dist/runtime/app/{components/internal/Input/Input.d.vue.ts → primitives/PrimitiveInput/PrimitiveInput.d.vue.ts} +4 -3
- package/dist/runtime/app/{components/internal/Input/Input.vue → primitives/PrimitiveInput/PrimitiveInput.vue} +4 -4
- package/dist/runtime/app/{components/internal/Input/Input.vue.d.ts → primitives/PrimitiveInput/PrimitiveInput.vue.d.ts} +4 -3
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.d.vue.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.d.vue.ts} +3 -4
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.theme.d.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.theme.d.ts} +3 -0
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.theme.js → primitives/PrimitiveNumberInput/PrimitiveNumberInput.theme.js} +4 -1
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.vue → primitives/PrimitiveNumberInput/PrimitiveNumberInput.vue} +7 -5
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.vue.d.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.vue.d.ts} +3 -4
- package/dist/runtime/app/theme/index.d.ts +254 -96
- package/dist/runtime/app/theme/index.js +13 -5
- package/dist/runtime/app/theme/messages.js +1 -0
- package/dist/runtime/app/theme/shared.d.ts +3 -2
- package/dist/runtime/app/theme/shared.js +2 -1
- package/dist/runtime/app/types/app.d.ts +4 -2
- package/dist/runtime/app/types/base.d.ts +5 -23
- package/dist/runtime/app/types/field.d.ts +3 -1
- package/dist/runtime/app/types/form.d.ts +3 -4
- package/dist/runtime/app/types/index.d.ts +55 -7
- package/dist/runtime/app/types/menu.d.ts +22 -0
- package/dist/runtime/app/types/menu.js +0 -0
- package/dist/runtime/app/types/page.d.ts +6 -10
- package/dist/runtime/app/types/slots.d.ts +8 -4
- package/dist/runtime/app/types/table.d.ts +28 -28
- package/dist/runtime/app/types/text.d.ts +6 -0
- package/dist/runtime/app/types/text.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +15 -6
- package/dist/runtime/app/utils/format.js +3 -2
- package/dist/runtime/app/utils/path.js +1 -1
- package/dist/runtime/app/{internal → utils}/slots.d.ts +2 -2
- package/dist/runtime/app/utils/theme.d.ts +8 -41
- package/dist/runtime/app/utils/theme.js +31 -29
- package/package.json +9 -9
- package/dist/runtime/app/components/Page/Page.d.vue.ts +0 -40
- package/dist/runtime/app/components/Page/Page.theme.d.ts +0 -32
- package/dist/runtime/app/components/Page/Page.theme.js +0 -31
- package/dist/runtime/app/components/Page/Page.vue +0 -132
- package/dist/runtime/app/components/Page/Page.vue.d.ts +0 -40
- package/dist/runtime/app/internal/keys.d.ts +0 -43
- package/dist/runtime/app/internal/keys.js +0 -8
- package/dist/runtime/app/types/alert.d.ts +0 -13
- package/dist/runtime/app/types/state.d.ts +0 -35
- /package/dist/runtime/app/{types/alert.js → components/Alert/Alert.types.js} +0 -0
- /package/dist/runtime/app/{types/state.js → components/App/App.types.js} +0 -0
- /package/dist/runtime/app/components/{Table → DataTable}/internal/query.d.ts +0 -0
- /package/dist/runtime/app/components/{Table → DataTable}/internal/query.js +0 -0
- /package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.vue +0 -0
- /package/dist/runtime/app/{components/internal/ControlShell/ControlShell.theme.js → primitives/PrimitiveControl/PrimitiveControl.theme.js} +0 -0
- /package/dist/runtime/app/{components/internal/Input/Input.theme.d.ts → primitives/PrimitiveInput/PrimitiveInput.theme.d.ts} +0 -0
- /package/dist/runtime/app/{components/internal/Input/Input.theme.js → primitives/PrimitiveInput/PrimitiveInput.theme.js} +0 -0
- /package/dist/runtime/app/{components/internal/NumberInput → primitives/PrimitiveNumberInput}/number.d.ts +0 -0
- /package/dist/runtime/app/{components/internal/NumberInput → primitives/PrimitiveNumberInput}/number.js +0 -0
- /package/dist/runtime/app/{internal → utils}/slots.js +0 -0
|
@@ -18,7 +18,8 @@ export const radiusByStep = (...slots) => {
|
|
|
18
18
|
"2xl": step("rounded-2xl"),
|
|
19
19
|
"3xl": step("rounded-3xl"),
|
|
20
20
|
"4xl": step("rounded-4xl"),
|
|
21
|
-
full: step("rounded-full")
|
|
21
|
+
full: step("rounded-full"),
|
|
22
|
+
none: step("rounded-none")
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
export const skipLink = "sr-only rounded-sm bg-vuno-surface text-vuno-body focus:not-sr-only focus:outline-vuno-primary focus:z-10 focus:inline-block focus:px-3 focus:py-1.5 focus:text-sm focus:outline-2 focus:outline-offset-2";
|
|
@@ -47,8 +47,10 @@ export type VunoNotifyRequest = {
|
|
|
47
47
|
title: string;
|
|
48
48
|
};
|
|
49
49
|
export interface VunoContext {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
/** Estado observable de los avisos; solo `notify` y `dismiss` lo modifican. */
|
|
51
|
+
readonly notifications: readonly Readonly<VunoNotification>[];
|
|
52
|
+
/** Estado observable de las capas; solo las operaciones del contexto lo modifican. */
|
|
53
|
+
readonly overlays: readonly Readonly<VunoOverlayEntry>[];
|
|
52
54
|
/**
|
|
53
55
|
* Informa de algo y espera a que se den por enterados.
|
|
54
56
|
*
|
|
@@ -32,39 +32,21 @@ export type VunoColor = 'error' | 'info' | 'neutral' | 'primary' | 'secondary' |
|
|
|
32
32
|
* Los ocho escalones son los que Tailwind publica de `rounded-xs` a
|
|
33
33
|
* `rounded-4xl`; Vuno no mantiene una escala paralela ni tokens propios.
|
|
34
34
|
*
|
|
35
|
-
* `full` no es un escalón sino una forma: no se
|
|
36
|
-
*
|
|
35
|
+
* `none` elimina la curvatura. `full` no es un escalón sino una forma: no se
|
|
36
|
+
* deriva de nada y sirve para el círculo y la píldora.
|
|
37
37
|
*/
|
|
38
|
-
export type VunoRadius = '2xl' | '3xl' | '4xl' | 'full' | 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
|
39
|
-
/**
|
|
40
|
-
* El nivel de un encabezado, del 1 al 6.
|
|
41
|
-
*
|
|
42
|
-
* Existe porque **un componente que pinta un título no siempre es la página**.
|
|
43
|
-
* `VPage` pinta un `<h1>`, que es lo correcto cuando ocupa la pantalla y lo
|
|
44
|
-
* incorrecto en cuanto va embebido dentro de otra cosa: ahí aparecen dos `h1`
|
|
45
|
-
* y, peor, un salto de nivel en lo que venga debajo. Se vio en el catálogo, que
|
|
46
|
-
* monta varias instancias dentro de una página que ya tiene el suyo, y el
|
|
47
|
-
* recorrido por encabezados salía `h1 → h2 → h1 → h3`.
|
|
48
|
-
*
|
|
49
|
-
* No se deriva del sitio ni se adivina: lo dice quien monta el componente,
|
|
50
|
-
* porque es el único que sabe qué hay por encima.
|
|
51
|
-
*/
|
|
52
|
-
export type VunoHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
53
|
-
/** Ancho del diálogo; `full` ocupa todo el viewport en ambas dimensiones. */
|
|
54
|
-
export type VunoModalSize = '2xl' | '3xl' | '4xl' | 'full' | 'lg' | 'md' | 'sm' | 'xl';
|
|
38
|
+
export type VunoRadius = '2xl' | '3xl' | '4xl' | 'full' | 'lg' | 'md' | 'none' | 'sm' | 'xl' | 'xs';
|
|
55
39
|
/** Ubicación preferida de algo flotante respecto a su disparador. */
|
|
56
40
|
export type VunoPlacement = 'bottom' | 'bottom-end' | 'bottom-start' | 'left' | 'left-end' | 'left-start' | 'right' | 'right-end' | 'right-start' | 'top' | 'top-end' | 'top-start';
|
|
57
41
|
/** Selector donde montar una capa flotante, o `true` para usar `body`. */
|
|
58
42
|
export type VunoPortalTarget = string | true;
|
|
59
43
|
/**
|
|
60
|
-
* La escala de tamaño
|
|
44
|
+
* La escala completa de tamaño que los componentes pueden seleccionar.
|
|
61
45
|
*
|
|
62
46
|
* Se llamaba `VunoFieldSize` y de los diecisiete ficheros que la usaban, cinco
|
|
63
47
|
* no tenían nada que ver con un formulario.
|
|
64
48
|
*/
|
|
65
|
-
export type VunoSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
|
66
|
-
/** Ancho de un panel lateral. La posición se declara por separado. */
|
|
67
|
-
export type VunoSlideoverSize = 'lg' | 'md' | 'sm' | 'xl';
|
|
49
|
+
export type VunoSize = '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | 'full' | 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
|
68
50
|
/**
|
|
69
51
|
* El mapa de clases por slot: lo que acepta la prop `ui` de cualquier
|
|
70
52
|
* componente y lo que guarda cada clave del tema.
|
|
@@ -31,6 +31,8 @@ type VunoFieldControlThemeKey = {
|
|
|
31
31
|
type VunoFieldThemeKey<TType extends VunoFieldType> = TType extends VunoFieldInputType ? 'fieldInput' : `field${Capitalize<TType>}`;
|
|
32
32
|
type VunoFieldUiKey<TType extends VunoFieldType> = VunoFieldControlThemeKey[TType] | VunoFieldThemeKey<TType>;
|
|
33
33
|
export type VunoFieldColumns = VunoResponsiveColumns | VunoResponsiveColumnSpan;
|
|
34
|
+
/** Escala de los controles de formulario, derivada de la escala global. */
|
|
35
|
+
export type VunoFieldSize = Extract<VunoSize, 'lg' | 'md' | 'sm' | 'xl' | 'xs'>;
|
|
34
36
|
/** Posición de la etiqueta respecto al control. */
|
|
35
37
|
export type VunoFieldOrientation = 'horizontal' | 'vertical';
|
|
36
38
|
/** Dirección interna de controles que también tienen una disposición propia. */
|
|
@@ -63,7 +65,7 @@ export type VunoFieldBase<TType extends VunoFieldType = VunoFieldType> = {
|
|
|
63
65
|
/** Etiqueta arriba por defecto, o al costado del control. */
|
|
64
66
|
orientation?: VunoFieldOrientation;
|
|
65
67
|
required?: boolean;
|
|
66
|
-
size?:
|
|
68
|
+
size?: VunoFieldSize;
|
|
67
69
|
ui?: VunoUi<VunoFieldUiKey<TType>>;
|
|
68
70
|
};
|
|
69
71
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComputedRef } from 'vue';
|
|
2
|
-
import type {
|
|
3
|
-
import type { VunoField, VunoFieldColumns } from './field.js';
|
|
2
|
+
import type { VunoField, VunoFieldColumns, VunoFieldSize } from './field.js';
|
|
4
3
|
/** Cómo se disponen las secciones del formulario. */
|
|
5
4
|
export type VunoFormLayout = 'sections' | 'tabs';
|
|
6
5
|
export type VunoFormSection = {
|
|
@@ -21,7 +20,7 @@ export type VunoFormDefinition = {
|
|
|
21
20
|
layout?: VunoFormLayout;
|
|
22
21
|
sections: VunoFormSection[];
|
|
23
22
|
/** Tamaño aplicado a los campos que no declaran el suyo. */
|
|
24
|
-
size?:
|
|
23
|
+
size?: VunoFieldSize;
|
|
25
24
|
};
|
|
26
25
|
export type VunoFormState = Record<string, unknown>;
|
|
27
26
|
/** Un segmento de ruta admitido por el contrato Standard Schema. */
|
|
@@ -53,7 +52,7 @@ export type VunoSchema<TValue = unknown> = {
|
|
|
53
52
|
export interface VunoFormContext<TState extends VunoFormState = VunoFormState> {
|
|
54
53
|
dirty: ComputedRef<boolean>;
|
|
55
54
|
initialState: TState;
|
|
56
|
-
size: ComputedRef<undefined |
|
|
55
|
+
size: ComputedRef<undefined | VunoFieldSize>;
|
|
57
56
|
touched: Record<string, boolean>;
|
|
58
57
|
/** El error de un campo, solo cuando toca enseñarlo. */
|
|
59
58
|
errorFor(name: string): string | undefined;
|
|
@@ -1,16 +1,64 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type * from '#vuno/components/Alert/Alert.types';
|
|
2
|
+
export type * from '#vuno/components/App/App.types';
|
|
3
|
+
export type * from '#vuno/components/Avatar/Avatar.types';
|
|
4
|
+
export type * from '#vuno/components/Badge/Badge.types';
|
|
5
|
+
export type * from '#vuno/components/Breadcrumb/Breadcrumb.types';
|
|
6
|
+
export type * from '#vuno/components/Button/Button.types';
|
|
7
|
+
export type * from '#vuno/components/Card/Card.types';
|
|
8
|
+
export type * from '#vuno/components/Code/Code.types';
|
|
9
|
+
export type * from '#vuno/components/Collapsible/Collapsible.types';
|
|
10
|
+
export type * from '#vuno/components/ColorModeButton/ColorModeButton.types';
|
|
11
|
+
export type * from '#vuno/components/Confirm/Confirm.types';
|
|
12
|
+
export type * from '#vuno/components/Container/Container.types';
|
|
13
|
+
export type * from '#vuno/components/ControlGroup/ControlGroup.types';
|
|
14
|
+
export type * from '#vuno/components/DataTable/DataTable.types';
|
|
15
|
+
export type * from '#vuno/components/FieldArray/FieldArray.types';
|
|
16
|
+
export type * from '#vuno/components/FieldCheckbox/FieldCheckbox.types';
|
|
17
|
+
export type * from '#vuno/components/FieldColor/FieldColor.types';
|
|
18
|
+
export type * from '#vuno/components/FieldCurrency/FieldCurrency.types';
|
|
19
|
+
export type * from '#vuno/components/FieldFile/FieldFile.types';
|
|
20
|
+
export type * from '#vuno/components/FieldInput/FieldInput.types';
|
|
21
|
+
export type * from '#vuno/components/FieldNumber/FieldNumber.types';
|
|
22
|
+
export type * from '#vuno/components/FieldPassword/FieldPassword.types';
|
|
23
|
+
export type * from '#vuno/components/FieldRadio/FieldRadio.types';
|
|
24
|
+
export type * from '#vuno/components/FieldSearch/FieldSearch.types';
|
|
25
|
+
export type * from '#vuno/components/FieldSelect/FieldSelect.types';
|
|
26
|
+
export type * from '#vuno/components/FieldSlug/FieldSlug.types';
|
|
27
|
+
export type * from '#vuno/components/FieldSwitch/FieldSwitch.types';
|
|
28
|
+
export type * from '#vuno/components/FieldTags/FieldTags.types';
|
|
29
|
+
export type * from '#vuno/components/FieldTextarea/FieldTextarea.types';
|
|
30
|
+
export type * from '#vuno/components/Form/Form.types';
|
|
31
|
+
export type * from '#vuno/components/FormField/FormField.types';
|
|
32
|
+
export type * from '#vuno/components/FormModal/FormModal.types';
|
|
33
|
+
export type * from '#vuno/components/FormSection/FormSection.types';
|
|
34
|
+
export type * from '#vuno/components/Icon/Icon.types';
|
|
35
|
+
export type * from '#vuno/components/Menu/Menu.types';
|
|
36
|
+
export type * from '#vuno/components/Modal/Modal.types';
|
|
37
|
+
export type * from '#vuno/components/Navbar/Navbar.types';
|
|
38
|
+
export type * from '#vuno/components/NavigationList/NavigationList.types';
|
|
39
|
+
export type * from '#vuno/components/NavigationMenu/NavigationMenu.types';
|
|
40
|
+
export type * from '#vuno/components/NavigationToc/NavigationToc.types';
|
|
41
|
+
export type * from '#vuno/components/Pagination/Pagination.types';
|
|
42
|
+
export type * from '#vuno/components/Slideover/Slideover.types';
|
|
43
|
+
export type * from '#vuno/components/State/State.types';
|
|
44
|
+
export type * from '#vuno/components/Table/Table.types';
|
|
45
|
+
export type * from '#vuno/components/Tabs/Tabs.types';
|
|
46
|
+
export type * from '#vuno/components/Text/Text.types';
|
|
47
|
+
export type * from '#vuno/components/Toolbar/Toolbar.types';
|
|
48
|
+
export type * from '#vuno/components/Tooltip/Tooltip.types';
|
|
2
49
|
export type { VunoAlertRequest, VunoConfirmRequest, VunoContext, VunoNotification, VunoNotificationColor, VunoNotifyRequest, VunoOverlayEntry } from './app.js';
|
|
3
50
|
export * from './app-config.js';
|
|
4
|
-
export type { VunoColor,
|
|
51
|
+
export type { VunoColor, VunoPlacement, VunoPortalTarget, VunoRadius, VunoSize, VunoSlots } from './base.js';
|
|
5
52
|
export type { VunoConfirmOptions } from './confirm.js';
|
|
6
53
|
export type { VunoCrud, VunoCrudMessages, VunoCrudOptions, VunoCrudPage } from './crud.js';
|
|
7
|
-
export type { VunoControlOrientation, VunoField, VunoFieldArray, VunoFieldBase, VunoFieldByType, VunoFieldCheckbox, VunoFieldColor, VunoFieldColumns, VunoFieldCurrency, VunoFieldDate, VunoFieldEmail, VunoFieldFile, VunoFieldInput, VunoFieldNumber, VunoFieldOf, VunoFieldOption, VunoFieldOptionValue, VunoFieldOrientation, VunoFieldPassword, VunoFieldPhone, VunoFieldRadio, VunoFieldSearch, VunoFieldSelect, VunoFieldSlug, VunoFieldSwitch, VunoFieldTags, VunoFieldText, VunoFieldTextarea, VunoFieldUrl } from './field.js';
|
|
54
|
+
export type { VunoControlOrientation, VunoField, VunoFieldArray, VunoFieldBase, VunoFieldByType, VunoFieldCheckbox, VunoFieldColor, VunoFieldColumns, VunoFieldCurrency, VunoFieldDate, VunoFieldEmail, VunoFieldFile, VunoFieldInput, VunoFieldNumber, VunoFieldOf, VunoFieldOption, VunoFieldOptionValue, VunoFieldOrientation, VunoFieldPassword, VunoFieldPhone, VunoFieldRadio, VunoFieldSearch, VunoFieldSelect, VunoFieldSize, VunoFieldSlug, VunoFieldSwitch, VunoFieldTags, VunoFieldText, VunoFieldTextarea, VunoFieldUrl } from './field.js';
|
|
8
55
|
export type { VunoFieldInputType, VunoFieldType } from './field-type.js';
|
|
9
56
|
export type { VunoFormContext, VunoFormDefinition, VunoFormLayout, VunoFormSection, VunoFormState, VunoSchema, VunoSchemaIssue, VunoSchemaPathSegment, VunoSchemaResult } from './form.js';
|
|
10
|
-
export type {
|
|
57
|
+
export type { VunoMenuAction, VunoMenuItem, VunoMenuSubmenu } from './menu.js';
|
|
58
|
+
export type { VunoBreadcrumbItem, VunoNavigationItem, VunoNavigationTocItem, VunoTabItem, VunoTabsVariant } from './page.js';
|
|
11
59
|
export type { VunoResponsiveColumns, VunoResponsiveColumnSpan } from './responsive.js';
|
|
12
60
|
export type { VunoShortcut, VunoShortcutHandler, VunoShortcuts, VunoShortcutsOptions } from './shortcuts.js';
|
|
13
61
|
export type { VunoResolvedSlots, VunoSlotOf, VunoUi, VunoVariantOf, VunoVariantsOf } from './slots.js';
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type { VunoAppConfig, VunoIcons, VunoMessages, VunoThemeCompoundVariant, VunoThemeConfig, VunoThemeEntry, VunoThemeKey, VunoThemeVariants } from './theme.js';
|
|
62
|
+
export type { VunoDataTableDefinition, VunoTableAction, VunoTableAlign, VunoTableBadgeMap, VunoTableCellColumn, VunoTableCellProps, VunoTableCellType, VunoTableColumn, VunoTableColumnActions, VunoTableColumnBadge, VunoTableColumnBase, VunoTableColumnBoolean, VunoTableColumnCurrency, VunoTableColumnCustom, VunoTableColumnDate, VunoTableColumnImage, VunoTableColumnNumber, VunoTableColumnOf, VunoTableColumnText, VunoTableColumnType, VunoTableDefinition, VunoTableDensity, VunoTableEmpty, VunoTableFailure, VunoTableFilters, VunoTableQuery, VunoTableQueryOptions, VunoTableRow, VunoTableSort, VunoTableSortDirection, VunoTableSticky } from './table.js';
|
|
63
|
+
export type { VunoTextTag, VunoTextTone, VunoTextVariant } from './text.js';
|
|
64
|
+
export type { VunoAppConfig, VunoComponentsConfig, VunoIcons, VunoMessages, VunoThemeCompoundVariant, VunoThemeConfig, VunoThemeEntry, VunoThemeKey, VunoThemeVariants } from './theme.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VunoColor } from './base.js';
|
|
2
|
+
type VunoMenuItemBase = {
|
|
3
|
+
color?: VunoColor;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
icon?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Dibuja una línea encima, para separar grupos de opciones. */
|
|
8
|
+
separator?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Una acción final: ejecuta su callback y cierra toda la cascada. */
|
|
11
|
+
export type VunoMenuAction = VunoMenuItemBase & {
|
|
12
|
+
onSelect: () => void;
|
|
13
|
+
children?: never;
|
|
14
|
+
};
|
|
15
|
+
/** Una rama: abre otro nivel y no ejecuta una acción propia. */
|
|
16
|
+
export type VunoMenuSubmenu = VunoMenuItemBase & {
|
|
17
|
+
onSelect?: never;
|
|
18
|
+
children: VunoMenuItem[];
|
|
19
|
+
};
|
|
20
|
+
/** Una entrada puede ser una acción final o una rama con más entradas. */
|
|
21
|
+
export type VunoMenuItem = VunoMenuAction | VunoMenuSubmenu;
|
|
22
|
+
export {};
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { VunoColor } from './base.js';
|
|
2
|
-
/**
|
|
2
|
+
/** Segmento que `VBreadcrumb` muestra dentro de una ruta de navegación. */
|
|
3
3
|
export type VunoBreadcrumbItem = {
|
|
4
4
|
icon?: string;
|
|
5
|
-
label
|
|
5
|
+
label: string;
|
|
6
6
|
to?: string;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
@@ -49,13 +49,9 @@ export type VunoTabItem = {
|
|
|
49
49
|
};
|
|
50
50
|
icon?: string;
|
|
51
51
|
label: string;
|
|
52
|
+
/** Destino opcional. Con `to`, la pestaña navega y su estado activo sigue la ruta actual. */
|
|
53
|
+
to?: string;
|
|
52
54
|
value: string;
|
|
53
55
|
};
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
* `full` no es «sin contenedor»: es sin tope de ancho pero con el relleno
|
|
58
|
-
* lateral, que es lo que se quiere en una pantalla que ocupa todo y aun así no
|
|
59
|
-
* debe pegar el texto al borde.
|
|
60
|
-
*/
|
|
61
|
-
export type VunoContainerSize = '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | 'full' | 'lg' | 'md' | 'sm' | 'xl';
|
|
56
|
+
/** Apariencia de la barra de pestañas. */
|
|
57
|
+
export type VunoTabsVariant = 'segmented' | 'underline';
|
|
@@ -20,11 +20,15 @@ export type VunoSlotOf<TKey extends VunoThemeKey> = TKey extends VunoThemeKey ?
|
|
|
20
20
|
/** Override `ui` de una clave concreta, con autocompletado y rechazo de errores tipográficos. */
|
|
21
21
|
export type VunoUi<TKey extends VunoThemeKey> = VunoSlots<[VunoSlotOf<TKey>] extends [never] ? string : VunoSlotOf<TKey>>;
|
|
22
22
|
/** Las dimensiones de variante que una clave admite. */
|
|
23
|
-
export type VunoVariantOf<TKey extends VunoThemeKey> = DefaultTheme[TKey] extends {
|
|
23
|
+
export type VunoVariantOf<TKey extends VunoThemeKey> = TKey extends VunoThemeKey ? (DefaultTheme[TKey] extends {
|
|
24
24
|
variants: infer TVariants;
|
|
25
|
-
} ? Extract<keyof TVariants, string> :
|
|
26
|
-
/** Las variantes activas de una clave, con
|
|
27
|
-
export type VunoVariantsOf<TKey extends VunoThemeKey> =
|
|
25
|
+
} ? Extract<keyof TVariants, string> : never) : never;
|
|
26
|
+
/** Las variantes activas de una clave, con sus valores literales válidos. */
|
|
27
|
+
export type VunoVariantsOf<TKey extends VunoThemeKey> = TKey extends VunoThemeKey ? (DefaultTheme[TKey] extends {
|
|
28
|
+
variants: infer TVariants extends Record<string, Record<string, unknown>>;
|
|
29
|
+
} ? {
|
|
30
|
+
[TDimension in keyof TVariants]?: Extract<keyof TVariants[TDimension], string> | undefined;
|
|
31
|
+
} : Record<never, never>) : never;
|
|
28
32
|
/** Slots resueltos por `useTheme`: todas sus clases ya son una cadena. */
|
|
29
33
|
export type VunoResolvedSlots<TKey extends VunoThemeKey> = Record<[VunoSlotOf<TKey>] extends [never] ? string : VunoSlotOf<TKey>, string>;
|
|
30
34
|
export {};
|
|
@@ -51,6 +51,8 @@ export type VunoTableEmpty = {
|
|
|
51
51
|
title?: string;
|
|
52
52
|
};
|
|
53
53
|
export type VunoTableAlign = 'center' | 'end' | 'start';
|
|
54
|
+
export type VunoTableDensity = 'compact' | 'default';
|
|
55
|
+
export type VunoTableSticky = 'end' | 'start';
|
|
54
56
|
/**
|
|
55
57
|
* Una fila. `object` y no `Record<string, unknown>` a propósito: un `interface`
|
|
56
58
|
* de TypeScript no tiene firma de índice implícita, así que no satisface un
|
|
@@ -80,6 +82,8 @@ export type VunoTableColumnBase<TRow extends VunoTableRow = VunoTableRow> = {
|
|
|
80
82
|
key: string;
|
|
81
83
|
label?: string;
|
|
82
84
|
sortable?: boolean;
|
|
85
|
+
/** Fija la columna al borde lógico del contenedor cuando la tabla se desplaza horizontalmente. */
|
|
86
|
+
sticky?: VunoTableSticky;
|
|
83
87
|
ui?: VunoUi<'avatar' | 'badge' | 'cellBoolean' | 'cellCurrency' | 'cellDate' | 'cellNumber' | 'cellText' | 'menu'>;
|
|
84
88
|
width?: string;
|
|
85
89
|
/**
|
|
@@ -130,7 +134,7 @@ export type VunoTableColumnImage<TRow extends VunoTableRow = VunoTableRow> = Vun
|
|
|
130
134
|
alt?: string;
|
|
131
135
|
/** Clave de la fila de la que sacar el texto alternativo. */
|
|
132
136
|
altKey?: string;
|
|
133
|
-
size?:
|
|
137
|
+
size?: Extract<VunoSize, 'lg' | 'md' | 'sm' | 'xs'>;
|
|
134
138
|
};
|
|
135
139
|
/** Delega el contenido en el slot `cell-<key>`. */
|
|
136
140
|
export type VunoTableColumnCustom<TRow extends VunoTableRow = VunoTableRow> = VunoTableColumnBase<TRow>;
|
|
@@ -180,23 +184,15 @@ export type VunoTableCellProps<TType extends VunoTableCellType = VunoTableCellTy
|
|
|
180
184
|
value: unknown;
|
|
181
185
|
};
|
|
182
186
|
export type VunoTableDefinition<TRow extends VunoTableRow = VunoTableRow> = {
|
|
187
|
+
/** Texto visible que nombra la tabla mediante su `<caption>` nativo. */
|
|
188
|
+
caption?: string;
|
|
183
189
|
columns: VunoTableColumn<TRow>[];
|
|
184
|
-
/**
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
filters?: VunoField[];
|
|
191
|
-
/** Tamaños ofrecidos en el selector de filas por página. */
|
|
192
|
-
pageSizes?: number[];
|
|
193
|
-
/**
|
|
194
|
-
* Si el endpoint pagina. Por defecto `true`.
|
|
195
|
-
*
|
|
196
|
-
* En `false` desaparecen el paginador y el selector de tamaño, y el pie
|
|
197
|
-
* pasa a decir cuántos resultados hay y nada más.
|
|
198
|
-
*/
|
|
199
|
-
paginated?: boolean;
|
|
190
|
+
/** Densidad visual de las cabeceras y celdas. */
|
|
191
|
+
density?: VunoTableDensity;
|
|
192
|
+
/** Hace que cada fila sea enfocable y active `rowClick` con Enter o Espacio. */
|
|
193
|
+
interactive?: boolean;
|
|
194
|
+
/** Identificador del título externo que nombra la tabla. No se combina con `caption`. */
|
|
195
|
+
labelledBy?: string;
|
|
200
196
|
/** Campo que identifica la fila; se usa como clave de selección. */
|
|
201
197
|
rowKey?: string;
|
|
202
198
|
/**
|
|
@@ -229,19 +225,23 @@ export type VunoTableDefinition<TRow extends VunoTableRow = VunoTableRow> = {
|
|
|
229
225
|
* otra, sin que nada lo dijera.
|
|
230
226
|
*/
|
|
231
227
|
rowLabel?: ((row: TRow) => string) | string;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
selectable?: boolean;
|
|
229
|
+
/** Fija la cabecera al borde superior de un contenedor con altura limitada. */
|
|
230
|
+
stickyHeader?: boolean;
|
|
231
|
+
};
|
|
232
|
+
/** Configuración del componente compuesto que consulta y presenta una tabla. */
|
|
233
|
+
export type VunoDataTableDefinition<TRow extends VunoTableRow = VunoTableRow> = VunoTableDefinition<TRow> & {
|
|
234
|
+
/** Texto e icono cuando no hay ninguna fila. */
|
|
235
|
+
empty?: VunoTableEmpty;
|
|
236
|
+
/** Campos del panel lateral de filtros. */
|
|
237
|
+
filters?: VunoField[];
|
|
238
|
+
/** Tamaños ofrecidos en el selector de filas por página. */
|
|
239
|
+
pageSizes?: number[];
|
|
240
|
+
/** Si el endpoint pagina. Por defecto `true`. */
|
|
241
|
+
paginated?: boolean;
|
|
242
|
+
/** Si el endpoint busca. Por defecto `true`. */
|
|
242
243
|
searchable?: boolean;
|
|
243
244
|
searchPlaceholder?: string;
|
|
244
|
-
selectable?: boolean;
|
|
245
245
|
};
|
|
246
246
|
export type VunoTableQueryOptions = {
|
|
247
247
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Elemento semántico que puede pintar `VText`. */
|
|
2
|
+
export type VunoTextTag = 'code' | 'div' | 'em' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'small' | 'span' | 'strong';
|
|
3
|
+
/** Jerarquía cromática del texto, independiente de su tamaño o etiqueta. */
|
|
4
|
+
export type VunoTextTone = 'body' | 'inherit' | 'inverse' | 'muted' | 'strong' | 'subtle';
|
|
5
|
+
/** Rol visual completo: tamaño, peso, interlineado y espaciado. */
|
|
6
|
+
export type VunoTextVariant = 'body' | 'caption' | 'code' | 'display' | 'heading' | 'inherit' | 'label' | 'title';
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { VunoSlots } from './base.js';
|
|
1
|
+
import type { VunoRadius, VunoSlots } from './base.js';
|
|
2
2
|
import type { VunoFieldInputType, VunoFieldType } from './field-type.js';
|
|
3
3
|
/**
|
|
4
4
|
* Claves tematizables, y **cada una se llama como su componente sin la `V`**:
|
|
5
|
-
* `VCard` se personaliza con `card
|
|
5
|
+
* `VCard` se personaliza con `card`; el control numérico interno, con `numberInput`.
|
|
6
6
|
*
|
|
7
7
|
* No siempre fue así y por eso está escrito aquí: llegaron a convivir un
|
|
8
8
|
* prefijo `base` en veinte claves y un `app` en tres, que no describían el
|
|
@@ -28,7 +28,7 @@ import type { VunoFieldInputType, VunoFieldType } from './field-type.js';
|
|
|
28
28
|
* a mirar; queda dicho aquí para que quien añada una excepción sepa que no hay
|
|
29
29
|
* red debajo.
|
|
30
30
|
*/
|
|
31
|
-
export type VunoThemeKey = 'alert' | 'avatar' | 'badge' | 'button' | 'card' | 'cellBoolean' | 'cellCurrency' | 'cellDate' | 'cellNumber' | 'cellText' | 'checkbox' | 'code' | 'confirm' | 'container' | 'control' | 'controlGroup' | 'fieldInput' | 'fileUpload' | 'form' | 'formField' | 'formModal' | 'formSection' | 'input' | 'menu' | 'modal' | 'navbar' | 'navigationList' | 'navigationMenu' | 'navigationToc' | 'numberInput' | '
|
|
31
|
+
export type VunoThemeKey = 'alert' | 'avatar' | 'badge' | 'breadcrumb' | 'button' | 'card' | 'cellBoolean' | 'cellCurrency' | 'cellDate' | 'cellNumber' | 'cellText' | 'checkbox' | 'code' | 'collapsible' | 'confirm' | 'container' | 'control' | 'controlGroup' | 'dataTable' | 'fieldInput' | 'fileUpload' | 'form' | 'formField' | 'formModal' | 'formSection' | 'input' | 'menu' | 'modal' | 'navbar' | 'navigationList' | 'navigationMenu' | 'navigationToc' | 'numberInput' | 'pagination' | 'radioGroup' | 'select' | 'slideover' | 'state' | 'switch' | 'table' | 'tabs' | 'tagsInput' | 'text' | 'textarea' | 'toast' | 'toaster' | 'toolbar' | 'tooltip' | `field${Capitalize<Exclude<VunoFieldType, VunoFieldInputType>>}`;
|
|
32
32
|
/**
|
|
33
33
|
* Slots que se aplican cuando una dimensión toma cierto valor: `color: 'error'`
|
|
34
34
|
* o `variant: 'solid'`. Se funden sobre los slots base en el orden en que el
|
|
@@ -52,7 +52,7 @@ export type VunoThemeVariants = Record<string, Record<string, VunoSlots>>;
|
|
|
52
52
|
*/
|
|
53
53
|
export type VunoThemeCompoundVariant = {
|
|
54
54
|
class: VunoSlots;
|
|
55
|
-
} & Record<string, string | undefined | VunoSlots>;
|
|
55
|
+
} & Record<string, string | string[] | undefined | VunoSlots>;
|
|
56
56
|
export type VunoThemeEntry = {
|
|
57
57
|
/**
|
|
58
58
|
* Las combinaciones, que se aplican **después** de las variantes sueltas de
|
|
@@ -75,9 +75,14 @@ export type VunoThemeEntry = {
|
|
|
75
75
|
*/
|
|
76
76
|
variants?: VunoThemeVariants;
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
/** Configuración tematizable de cada componente, agrupada por su clave pública. */
|
|
79
|
+
export type VunoComponentsConfig = {
|
|
79
80
|
[TKey in VunoThemeKey]?: VunoThemeEntry;
|
|
80
81
|
};
|
|
82
|
+
/** Defaults visuales compartidos por los componentes que exponen esa capacidad. */
|
|
83
|
+
export type VunoThemeConfig = {
|
|
84
|
+
radius?: VunoRadius;
|
|
85
|
+
};
|
|
81
86
|
export type VunoIcons = {
|
|
82
87
|
actions: string;
|
|
83
88
|
addItem: string;
|
|
@@ -186,6 +191,8 @@ export type VunoMessages = {
|
|
|
186
191
|
numberDecrement: string;
|
|
187
192
|
numberIncrement: string;
|
|
188
193
|
of: string;
|
|
194
|
+
/** Acción accesible de una fila interactiva, seguida por el nombre de la fila. */
|
|
195
|
+
openRow: string;
|
|
189
196
|
/** Compone el nombre de cada número: «Página 3». */
|
|
190
197
|
page: string;
|
|
191
198
|
/** Nombre accesible del selector de filas por página. */
|
|
@@ -236,7 +243,8 @@ export type VunoMessages = {
|
|
|
236
243
|
updated: string;
|
|
237
244
|
};
|
|
238
245
|
/** Forma de `app.config.ts` → `vuno`. */
|
|
239
|
-
export type VunoAppConfig =
|
|
246
|
+
export type VunoAppConfig = {
|
|
247
|
+
components?: VunoComponentsConfig;
|
|
240
248
|
icons?: Partial<VunoIcons>;
|
|
241
249
|
/**
|
|
242
250
|
* Con qué idioma se formatean las fechas, los números y las monedas.
|
|
@@ -248,4 +256,5 @@ export type VunoAppConfig = VunoThemeConfig & {
|
|
|
248
256
|
*/
|
|
249
257
|
locale?: string;
|
|
250
258
|
messages?: Partial<VunoMessages>;
|
|
259
|
+
theme?: VunoThemeConfig;
|
|
251
260
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function formatSlug(value) {
|
|
2
2
|
if (!value) return "";
|
|
3
|
-
return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(
|
|
3
|
+
return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-/, "").replace(/-$/, "");
|
|
4
4
|
}
|
|
5
5
|
export function formatNumber(value, locale, decimals) {
|
|
6
6
|
if (value === null || value === void 0 || value === "") return "";
|
|
@@ -24,7 +24,8 @@ export function formatCurrency(value, locale, currency = "EUR", decimals) {
|
|
|
24
24
|
}
|
|
25
25
|
export function formatDate(value, locale, options) {
|
|
26
26
|
if (value === null || value === void 0 || value === "") return "";
|
|
27
|
-
|
|
27
|
+
if (!(value instanceof Date) && typeof value !== "string" && typeof value !== "number") return "";
|
|
28
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
28
29
|
if (Number.isNaN(date.getTime())) return "";
|
|
29
30
|
return new Intl.DateTimeFormat(locale, options ?? { dateStyle: "medium" }).format(date);
|
|
30
31
|
}
|
|
@@ -37,7 +37,7 @@ export function setPath(object, path, value) {
|
|
|
37
37
|
export function cloneValue(value) {
|
|
38
38
|
if (value === null || typeof value !== "object") return value;
|
|
39
39
|
if (isBinary(value)) return value;
|
|
40
|
-
if (value instanceof Date) return new Date(value
|
|
40
|
+
if (value instanceof Date) return new Date(value);
|
|
41
41
|
if (Array.isArray(value)) return value.map((item) => cloneValue(item));
|
|
42
42
|
if (isPlainObject(value)) {
|
|
43
43
|
const result = {};
|
|
@@ -16,7 +16,7 @@ export declare function firstElement(nodes?: unknown): undefined | VNode;
|
|
|
16
16
|
* contiene, así que mirar solo el primer nivel cuenta ese fragmento como
|
|
17
17
|
* contenido. La primera versión de esto se equivocaba justo ahí.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Es una utilidad privada del runtime: se importa explícitamente y no ocupa
|
|
20
|
+
* ningún nombre global en el proyecto que instala el módulo.
|
|
21
21
|
*/
|
|
22
22
|
export declare function filled(slot?: () => unknown): boolean;
|
|
@@ -1,44 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CnOptions } from 'tailwind-variants';
|
|
2
2
|
import type { VunoSlots } from '#vuno/types/base';
|
|
3
|
-
import type {
|
|
4
|
-
/**
|
|
5
|
-
* Los slots de las variantes activas.
|
|
6
|
-
*
|
|
7
|
-
* **El orden en que se devuelven es el de declaración**, y ese orden decide
|
|
8
|
-
* quién gana cuando dos dimensiones escriben el mismo slot. No es de fiar:
|
|
9
|
-
* perfectionist ordena las claves alfabéticamente, así que renombrar una
|
|
10
|
-
* dimensión puede cambiar el resultado sin que nadie lo relacione. Si una
|
|
11
|
-
* dimensión tiene que ganar a otra, que publique una variable y la otra la
|
|
12
|
-
* consuma, en lugar de confiar en quién funde después.
|
|
13
|
-
*/
|
|
14
|
-
export declare function selectVariants(variants: undefined | VunoThemeVariants, active: Record<string, string | undefined> | undefined): (undefined | VunoSlots)[];
|
|
15
|
-
/**
|
|
16
|
-
* Las combinaciones que se cumplen enteras.
|
|
17
|
-
*
|
|
18
|
-
* Todas sus condiciones o ninguna: una entrada con `color` y `variant` solo
|
|
19
|
-
* entra si las dos coinciden con lo activo. Una condición cuya dimensión no
|
|
20
|
-
* esté activa **no** cuenta como cumplida, que es lo que evita que una
|
|
21
|
-
* combinación se cuele en un componente que ni declara esa variante.
|
|
22
|
-
*
|
|
23
|
-
* Se aplican después de `selectVariants` del mismo nivel, y ese orden es lo que
|
|
24
|
-
* las hace útiles: lo específico llega al final y gana el conflicto.
|
|
25
|
-
*/
|
|
26
|
-
export declare function selectCompoundVariants(compounds: undefined | VunoThemeCompoundVariant[], active: Record<string, string | undefined> | undefined): (undefined | VunoSlots)[];
|
|
27
|
-
/** Une un slot escrito como array en una sola cadena, descartando lo vacío. */
|
|
28
|
-
export declare function toClassString(value: string | string[] | undefined): string;
|
|
29
|
-
/**
|
|
30
|
-
* Funde slots en orden de prioridad creciente: tema → app.config → prop.
|
|
31
|
-
*
|
|
32
|
-
* Resuelve los conflictos con `tailwind-merge`, y eso no siempre fue así: antes
|
|
33
|
-
* se concatenaba y se confiaba en que lo hiciera Nuxt UI al recibir el resultado
|
|
34
|
-
* por su prop `ui`. Con componentes propios —que solo escriben las clases en el
|
|
35
|
-
* elemento— esa red desapareció, y un `max-w-lg` del tema convivía con el
|
|
36
|
-
* `max-w-3xl` de quien lo sobreescribía: ganaba el que Tailwind hubiera puesto
|
|
37
|
-
* más tarde en la hoja, no el más específico.
|
|
38
|
-
*/
|
|
39
|
-
export declare function mergeSlots(...sources: (undefined | VunoSlots)[]): Record<string, string | undefined>;
|
|
3
|
+
import type { VunoThemeEntry, VunoThemeKey } from '#vuno/types/theme';
|
|
40
4
|
/** Compone clases condicionales y resuelve conflictos de Tailwind de izquierda a derecha. */
|
|
41
|
-
export declare function cn(...inputs:
|
|
42
|
-
|
|
43
|
-
|
|
5
|
+
export declare function cn(...inputs: CnOptions): string;
|
|
6
|
+
/** Funde slots en orden de prioridad creciente: tema → app.config → prop. */
|
|
7
|
+
export declare function mergeSlots(...sources: (undefined | VunoSlots)[]): Record<string, string | undefined>;
|
|
8
|
+
/** Resuelve una capa de tema con Tailwind Variants y devuelve clases por slot. */
|
|
9
|
+
export declare function resolveTheme(entry: undefined | VunoThemeEntry, active?: Record<string, string | undefined>, inheritedSlots?: readonly string[]): VunoSlots;
|
|
10
|
+
/** Define una sola entrada de tema, conserva sus literales y prepara su receta. */
|
|
44
11
|
export declare function defineTheme<const TKey extends VunoThemeKey, const TEntry extends VunoThemeEntry>(key: TKey, entry: TEntry): Record<TKey, TEntry>;
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export function
|
|
4
|
-
|
|
5
|
-
return Object.entries(variants).map(([dimension, values]) => {
|
|
6
|
-
const chosen = active[dimension];
|
|
7
|
-
return chosen === void 0 ? void 0 : values[chosen];
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
export function selectCompoundVariants(compounds, active) {
|
|
11
|
-
if (!compounds || !active) return [];
|
|
12
|
-
return compounds.filter(
|
|
13
|
-
(compound) => Object.entries(compound).every(([dimension, expected]) => {
|
|
14
|
-
if (dimension === "class") return true;
|
|
15
|
-
return active[dimension] === expected;
|
|
16
|
-
})
|
|
17
|
-
).map((compound) => compound.class);
|
|
18
|
-
}
|
|
19
|
-
export function toClassString(value) {
|
|
20
|
-
if (!value) return "";
|
|
21
|
-
return Array.isArray(value) ? value.filter(Boolean).join(" ") : value;
|
|
1
|
+
import { cn as mergeClasses, tv } from "tailwind-variants";
|
|
2
|
+
const themeRecipes = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
export function cn(...inputs) {
|
|
4
|
+
return mergeClasses(...inputs) ?? "";
|
|
22
5
|
}
|
|
23
6
|
export function mergeSlots(...sources) {
|
|
24
7
|
const merged = {};
|
|
25
8
|
for (const source of sources) {
|
|
26
9
|
if (!source) continue;
|
|
27
10
|
for (const [slot, value] of Object.entries(source)) {
|
|
28
|
-
const className =
|
|
29
|
-
if (
|
|
30
|
-
merged[slot] = merged[slot] ? twMerge(merged[slot], className) : className;
|
|
11
|
+
const className = cn(merged[slot], value);
|
|
12
|
+
if (className) merged[slot] = className;
|
|
31
13
|
}
|
|
32
14
|
}
|
|
33
15
|
return merged;
|
|
34
16
|
}
|
|
35
|
-
export function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
export function resolveTheme(entry, active, inheritedSlots = []) {
|
|
18
|
+
if (!entry) return {};
|
|
19
|
+
const slots = recipeFor(entry, inheritedSlots)(active);
|
|
20
|
+
const resolved = {};
|
|
21
|
+
for (const [slot, resolve] of Object.entries(slots)) {
|
|
22
|
+
const className = resolve();
|
|
23
|
+
if (className) resolved[slot] = className;
|
|
24
|
+
}
|
|
25
|
+
return resolved;
|
|
40
26
|
}
|
|
41
27
|
export function defineTheme(key, entry) {
|
|
28
|
+
themeRecipes.set(entry, createThemeRecipe(entry));
|
|
42
29
|
return { [key]: entry };
|
|
43
30
|
}
|
|
31
|
+
function createThemeRecipe(entry, inheritedSlots = []) {
|
|
32
|
+
const slots = Object.fromEntries(inheritedSlots.map((slot) => [slot, ""]));
|
|
33
|
+
const recipe = tv({
|
|
34
|
+
compoundVariants: entry.compoundVariants,
|
|
35
|
+
slots: { ...slots, ...entry.slots },
|
|
36
|
+
variants: entry.variants
|
|
37
|
+
});
|
|
38
|
+
return (active) => recipe(active);
|
|
39
|
+
}
|
|
40
|
+
function recipeFor(entry, inheritedSlots) {
|
|
41
|
+
if (inheritedSlots.length) return createThemeRecipe(entry, inheritedSlots);
|
|
42
|
+
const cached = themeRecipes.get(entry);
|
|
43
|
+
if (cached) return cached;
|
|
44
|
+
return createThemeRecipe(entry);
|
|
45
|
+
}
|