@material-tailwind/html
Advanced tools
Comparing version 3.0.0-beta.1 to 3.0.0-beta.2
@@ -1,2 +0,73 @@ | ||
export { Color, Colors, Options, default as mtConfig } from './plugins/index.js'; | ||
import 'tailwindcss/types/config'; | ||
import { initAlert } from './alert/ts/alert'; | ||
import { initGallery, cleanupGallery } from './gallery/ts/gallery'; | ||
import { initCollapse } from './collapse/ts/collapse'; | ||
import { Collapse } from './collapse/ts/collapse-programmatic'; | ||
import type { CollapseConfig, ICollapse } from './collapse/ts/collapse.types'; | ||
import { initDropdowns, cleanupDropdowns } from './dropdown/ts/dropdown'; | ||
import { Dropdown } from './dropdown/ts/dropdown-programmatic'; | ||
import type { DropdownConfig, IDropdown } from './dropdown/ts/dropdown.types'; | ||
import { initPopovers, cleanupPopovers } from './popover/ts/popover'; | ||
import { Popover } from './popover/ts/popover-programmatic'; | ||
import type { PopoverConfig, IPopover } from './popover/ts/popover.types'; | ||
import { initTooltips, cleanupTooltips } from './tooltip/ts/tooltip'; | ||
import { Tooltip } from './tooltip/ts/tooltip-programmatic'; | ||
import type { TooltipConfig, ITooltip } from './tooltip/ts/tooltip.types'; | ||
import { initTabs, cleanupTabs } from './tabs/ts/tabs'; | ||
import { Tabs } from './tabs/ts/tabs-programmatic'; | ||
import type { TabsConfig, ITabs } from './tabs/ts/tabs.types'; | ||
import { initModal, cleanupModals } from './modal/ts/modal'; | ||
import { Modal } from './modal/ts/modal-programmatic'; | ||
import type { ModalConfig, IModal } from './modal/ts/modal.types'; | ||
import { initAccordion, cleanupAccordions, toggleAccordionById } from './accordion/ts/accordion'; | ||
import { Accordion } from './accordion/ts/accordion-programmatic'; | ||
import type { AccordionConfig, IAccordion } from './accordion/ts/accordion.types'; | ||
import { initStepper, cleanupSteppers } from './stepper/ts/stepper'; | ||
import { Stepper } from './stepper/ts/stepper-programmatic'; | ||
import type { StepperConfig, IStepper } from './stepper/ts/stepper.types'; | ||
export { initAlert, initCollapse, Collapse, initDropdowns, cleanupDropdowns, Dropdown, initPopovers, cleanupPopovers, Popover, initTooltips, cleanupTooltips, Tooltip, initTabs, cleanupTabs, Tabs, initModal, cleanupModals, Modal, initAccordion, cleanupAccordions, Accordion, toggleAccordionById, initStepper, cleanupSteppers, Stepper, initGallery, cleanupGallery, }; | ||
export type { ModalConfig, IModal, DropdownConfig, IDropdown, CollapseConfig, ICollapse, PopoverConfig, IPopover, TabsConfig, ITabs, TooltipConfig, ITooltip, AccordionConfig, IAccordion, StepperConfig, IStepper }; | ||
export declare const DavidAI: { | ||
initAlert: typeof initAlert; | ||
initCollapse: typeof initCollapse; | ||
initDropdowns: typeof initDropdowns; | ||
cleanupDropdowns: typeof cleanupDropdowns; | ||
initPopovers: typeof initPopovers; | ||
cleanupPopovers: typeof cleanupPopovers; | ||
initTooltips: typeof initTooltips; | ||
cleanupTooltips: typeof cleanupTooltips; | ||
initTabs: typeof initTabs; | ||
cleanupTabs: typeof cleanupTabs; | ||
initModal: typeof initModal; | ||
cleanupModals: typeof cleanupModals; | ||
initAccordion: typeof initAccordion; | ||
cleanupAccordions: typeof cleanupAccordions; | ||
toggleAccordionById: typeof toggleAccordionById; | ||
initStepper: typeof initStepper; | ||
cleanupSteppers: typeof cleanupSteppers; | ||
initGallery: typeof initGallery; | ||
cleanupGallery: typeof cleanupGallery; | ||
}; | ||
export declare function initDavidAI(): void; | ||
declare const _default: { | ||
initDavidAI: typeof initDavidAI; | ||
initAlert: typeof initAlert; | ||
initCollapse: typeof initCollapse; | ||
initDropdowns: typeof initDropdowns; | ||
cleanupDropdowns: typeof cleanupDropdowns; | ||
initPopovers: typeof initPopovers; | ||
cleanupPopovers: typeof cleanupPopovers; | ||
initTooltips: typeof initTooltips; | ||
cleanupTooltips: typeof cleanupTooltips; | ||
initTabs: typeof initTabs; | ||
cleanupTabs: typeof cleanupTabs; | ||
initModal: typeof initModal; | ||
cleanupModals: typeof cleanupModals; | ||
initAccordion: typeof initAccordion; | ||
cleanupAccordions: typeof cleanupAccordions; | ||
toggleAccordionById: typeof toggleAccordionById; | ||
initStepper: typeof initStepper; | ||
cleanupSteppers: typeof cleanupSteppers; | ||
initGallery: typeof initGallery; | ||
cleanupGallery: typeof cleanupGallery; | ||
}; | ||
export default _default; |
{ | ||
"name": "@material-tailwind/html", | ||
"version": "3.0.0-beta.1", | ||
"version": "3.0.0-beta.2", | ||
"description": "Material Tailwind is an open-source library that uses the power of Tailwind CSS and React to help you build unique web projects faster and easier. The stunning design inspired by Material Design is a bonus!", | ||
"main": "dist/material-tailwind.js", | ||
"module": "dist/material-tailwind.esm.js", | ||
"browser": "dist/material-tailwind.js", | ||
"unpkg": "dist/material-tailwind.min.js", | ||
"types": "dist/index.d.ts", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"exports": { | ||
"import": "./dist/material-tailwind.esm.js", | ||
"require": "./dist/material-tailwind.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
"src", | ||
"README.md", | ||
"LICENSE.md", | ||
"package.json", | ||
"rollup.config.mjs" | ||
], | ||
"scripts": { | ||
"lint": "tsc", | ||
"build": "tsup src --dts", | ||
"dev": "tsup src --watch" | ||
"build": "rollup -c", | ||
"build:watch": "rollup -c --watch", | ||
"dev": "rollup -c -w", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/creativetimofficial/material-tailwind.git" | ||
}, | ||
"author": { | ||
"name": "sajadevo", | ||
"url": "https://twitter.com/sajadevo_" | ||
}, | ||
"keywords": [ | ||
"ui", | ||
"material", | ||
"tailwind", | ||
"components", | ||
"tailwindcss", | ||
"javascript" | ||
], | ||
"author": "Creative Tim", | ||
"license": "MIT", | ||
@@ -23,13 +46,19 @@ "bugs": { | ||
}, | ||
"homepage": "https://github.com/creativetimofficial/material-tailwind/packages/html#readme", | ||
"homepage": "https://www.material-tailwind.com/docs/v3/html/button", | ||
"devDependencies": { | ||
"tailwindcss": "3.3.3", | ||
"tsconfig": "workspace:*", | ||
"tsup": "7.2.0", | ||
"typescript": "5.2.2" | ||
"@babel/core": "^7.26.8", | ||
"@babel/preset-env": "^7.26.8", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-commonjs": "^28.0.2", | ||
"@rollup/plugin-node-resolve": "^16.0.0", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"rollup": "^4.34.6", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"deepmerge": "4.3.1", | ||
"hex-rgb": "5.0.0" | ||
"@popperjs/core": "^2.11.8", | ||
"tslib": "^2.8.1" | ||
} | ||
} |
158
src/index.ts
@@ -1,1 +0,157 @@ | ||
export * from "@plugins"; | ||
// Utilities | ||
import { loadPopperJs } from './utils/loadPopper'; | ||
// Alert Component | ||
import { initAlert } from './alert/ts/alert'; | ||
// Gallery Component | ||
import { initGallery, cleanupGallery } from './gallery/ts/gallery'; | ||
// Collapse Component | ||
import { initCollapse } from './collapse/ts/collapse'; | ||
import { Collapse } from './collapse/ts/collapse-programmatic'; | ||
import type { CollapseConfig, ICollapse } from './collapse/ts/collapse.types'; | ||
// Dropdown Component | ||
import { initDropdowns, cleanupDropdowns } from './dropdown/ts/dropdown'; | ||
import { Dropdown } from './dropdown/ts/dropdown-programmatic'; | ||
import type { DropdownConfig, IDropdown } from './dropdown/ts/dropdown.types'; | ||
// Popover Component | ||
import { initPopovers, cleanupPopovers } from './popover/ts/popover'; | ||
import { Popover } from './popover/ts/popover-programmatic'; | ||
import type { PopoverConfig, IPopover } from './popover/ts/popover.types'; | ||
// Tooltip Component | ||
import { initTooltips, cleanupTooltips } from './tooltip/ts/tooltip'; | ||
import { Tooltip } from './tooltip/ts/tooltip-programmatic'; | ||
import type { TooltipConfig, ITooltip } from './tooltip/ts/tooltip.types'; | ||
// Tabs Component | ||
import { initTabs, cleanupTabs } from './tabs/ts/tabs'; | ||
import { Tabs } from './tabs/ts/tabs-programmatic'; | ||
import type { TabsConfig, ITabs } from './tabs/ts/tabs.types'; | ||
// Modal Component | ||
import { initModal, cleanupModals } from './modal/ts/modal'; | ||
import { Modal } from './modal/ts/modal-programmatic'; // Export the Modal class | ||
import type { ModalConfig, IModal } from './modal/ts/modal.types'; // Export types for external use | ||
// Accordion Component | ||
import { initAccordion, cleanupAccordions, toggleAccordionById } from './accordion/ts/accordion'; | ||
import { Accordion } from './accordion/ts/accordion-programmatic'; | ||
import type { AccordionConfig, IAccordion } from './accordion/ts/accordion.types'; | ||
// Stepper Component | ||
import { initStepper, cleanupSteppers } from './stepper/ts/stepper'; | ||
import { Stepper } from './stepper/ts/stepper-programmatic'; | ||
import type { StepperConfig, IStepper } from './stepper/ts/stepper.types'; | ||
// Export individual components | ||
export { | ||
initAlert, | ||
initCollapse, | ||
Collapse, | ||
initDropdowns, | ||
cleanupDropdowns, | ||
Dropdown, | ||
initPopovers, | ||
cleanupPopovers, | ||
Popover, | ||
initTooltips, | ||
cleanupTooltips, | ||
Tooltip, | ||
initTabs, | ||
cleanupTabs, | ||
Tabs, | ||
initModal, | ||
cleanupModals, | ||
Modal, | ||
initAccordion, | ||
cleanupAccordions, | ||
Accordion, | ||
toggleAccordionById, | ||
initStepper, | ||
cleanupSteppers, | ||
Stepper, | ||
initGallery, | ||
cleanupGallery, | ||
}; | ||
export type { ModalConfig, IModal, DropdownConfig, IDropdown, CollapseConfig, ICollapse, PopoverConfig, IPopover, TabsConfig, ITabs, TooltipConfig, ITooltip, AccordionConfig, IAccordion, StepperConfig, IStepper }; | ||
// Aggregate all exports into a single object for UMD consumers | ||
export const DavidAI = { | ||
initAlert, | ||
initCollapse, | ||
initDropdowns, | ||
cleanupDropdowns, | ||
initPopovers, | ||
cleanupPopovers, | ||
initTooltips, | ||
cleanupTooltips, | ||
initTabs, | ||
cleanupTabs, | ||
initModal, | ||
cleanupModals, | ||
initAccordion, | ||
cleanupAccordions, | ||
toggleAccordionById, | ||
initStepper, | ||
cleanupSteppers, | ||
initGallery, | ||
cleanupGallery, | ||
}; | ||
// Global initialization function | ||
export function initDavidAI(): void { | ||
// Initialize non-Popper components | ||
initAlert(); | ||
initCollapse(); | ||
initTabs(); | ||
initModal(); | ||
initAccordion(); | ||
initStepper(); | ||
initGallery(); | ||
// Dynamically load Popper.js and initialize Popper-dependent components | ||
loadPopperJs() | ||
.then(() => { | ||
initDropdowns(); | ||
initPopovers(); | ||
initTooltips(); | ||
}) | ||
.catch((error:any) => { | ||
console.error('Failed to load Popper.js:', error); | ||
}); | ||
} | ||
// Automatically initialize in the browser environment | ||
if (typeof window !== 'undefined' && typeof document !== 'undefined') { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
// Initialize all components | ||
initDavidAI(); | ||
// Observe DOM changes for dynamically added elements | ||
const observer = new MutationObserver(() => { | ||
initAlert(); | ||
initCollapse(); | ||
initAccordion(); | ||
initStepper(); | ||
initGallery(); | ||
initTabs(); | ||
initModal(); | ||
initDropdowns(); | ||
initPopovers(); | ||
initTooltips(); | ||
}); | ||
observer.observe(document.body, { childList: true, subtree: true }); | ||
// Expose DavidAI globally for UMD usage | ||
(window as any).DavidAI = { ...DavidAI, initDavidAI }; | ||
}); | ||
} | ||
// Default export for ES modules | ||
export default { ...DavidAI, initDavidAI }; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
875571
78
10630
0
457
10
+ Added@popperjs/core@^2.11.8
+ Addedtslib@^2.8.1
+ Added@popperjs/core@2.11.8(transitive)
+ Addedtslib@2.8.1(transitive)
- Removeddeepmerge@4.3.1
- Removedhex-rgb@5.0.0
- Removeddeepmerge@4.3.1(transitive)
- Removedhex-rgb@5.0.0(transitive)