Add supporting themes required for Lotusdocs

This commit is contained in:
Abner Coimbre
2026-01-11 16:48:19 -08:00
parent 8a4d04db58
commit f8d40c4e41
1289 changed files with 234948 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import collapse from '../src/index.js'
document.addEventListener('alpine:init', () => {
window.Alpine.plugin(collapse)
})

View File

@@ -0,0 +1,5 @@
import collapse from '../src/index.js'
export default collapse
export { collapse }

View File

@@ -0,0 +1,99 @@
(() => {
// packages/collapse/src/index.js
function src_default(Alpine) {
Alpine.directive("collapse", collapse);
collapse.inline = (el, { modifiers }) => {
if (!modifiers.includes("min"))
return;
el._x_doShow = () => {
};
el._x_doHide = () => {
};
};
function collapse(el, { modifiers }) {
let duration = modifierValue(modifiers, "duration", 250) / 1e3;
let floor = modifierValue(modifiers, "min", 0);
let fullyHide = !modifiers.includes("min");
if (!el._x_isShown)
el.style.height = `${floor}px`;
if (!el._x_isShown && fullyHide)
el.hidden = true;
if (!el._x_isShown)
el.style.overflow = "hidden";
let setFunction = (el2, styles) => {
let revertFunction = Alpine.setStyles(el2, styles);
return styles.height ? () => {
} : revertFunction;
};
let transitionStyles = {
transitionProperty: "height",
transitionDuration: `${duration}s`,
transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
};
el._x_transition = {
in(before = () => {
}, after = () => {
}) {
if (fullyHide)
el.hidden = false;
if (fullyHide)
el.style.display = null;
let current = el.getBoundingClientRect().height;
el.style.height = "auto";
let full = el.getBoundingClientRect().height;
if (current === full) {
current = floor;
}
Alpine.transition(el, Alpine.setStyles, {
during: transitionStyles,
start: { height: current + "px" },
end: { height: full + "px" }
}, () => el._x_isShown = true, () => {
if (el.getBoundingClientRect().height == full) {
el.style.overflow = null;
}
});
},
out(before = () => {
}, after = () => {
}) {
let full = el.getBoundingClientRect().height;
Alpine.transition(el, setFunction, {
during: transitionStyles,
start: { height: full + "px" },
end: { height: floor + "px" }
}, () => el.style.overflow = "hidden", () => {
el._x_isShown = false;
if (el.style.height == `${floor}px` && fullyHide) {
el.style.display = "none";
el.hidden = true;
}
});
}
};
}
}
function modifierValue(modifiers, key, fallback) {
if (modifiers.indexOf(key) === -1)
return fallback;
const rawValue = modifiers[modifiers.indexOf(key) + 1];
if (!rawValue)
return fallback;
if (key === "duration") {
let match = rawValue.match(/([0-9]+)ms/);
if (match)
return match[1];
}
if (key === "min") {
let match = rawValue.match(/([0-9]+)px/);
if (match)
return match[1];
}
return rawValue;
}
// packages/collapse/builds/cdn.js
document.addEventListener("alpine:init", () => {
window.Alpine.plugin(src_default);
});
})();

View File

@@ -0,0 +1 @@
(()=>{function g(n){n.directive("collapse",e),e.inline=(t,{modifiers:i})=>{i.includes("min")&&(t._x_doShow=()=>{},t._x_doHide=()=>{})};function e(t,{modifiers:i}){let r=l(i,"duration",250)/1e3,u=l(i,"min",0),h=!i.includes("min");t._x_isShown||(t.style.height=`${u}px`),!t._x_isShown&&h&&(t.hidden=!0),t._x_isShown||(t.style.overflow="hidden");let c=(d,s)=>{let o=n.setStyles(d,s);return s.height?()=>{}:o},f={transitionProperty:"height",transitionDuration:`${r}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(d=()=>{},s=()=>{}){h&&(t.hidden=!1),h&&(t.style.display=null);let o=t.getBoundingClientRect().height;t.style.height="auto";let a=t.getBoundingClientRect().height;o===a&&(o=u),n.transition(t,n.setStyles,{during:f,start:{height:o+"px"},end:{height:a+"px"}},()=>t._x_isShown=!0,()=>{t.getBoundingClientRect().height==a&&(t.style.overflow=null)})},out(d=()=>{},s=()=>{}){let o=t.getBoundingClientRect().height;n.transition(t,c,{during:f,start:{height:o+"px"},end:{height:u+"px"}},()=>t.style.overflow="hidden",()=>{t._x_isShown=!1,t.style.height==`${u}px`&&h&&(t.style.display="none",t.hidden=!0)})}}}}function l(n,e,t){if(n.indexOf(e)===-1)return t;let i=n[n.indexOf(e)+1];if(!i)return t;if(e==="duration"){let r=i.match(/([0-9]+)ms/);if(r)return r[1]}if(e==="min"){let r=i.match(/([0-9]+)px/);if(r)return r[1]}return i}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(g)});})();

View File

@@ -0,0 +1,125 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// packages/collapse/builds/module.js
var module_exports = {};
__export(module_exports, {
collapse: () => src_default,
default: () => module_default
});
module.exports = __toCommonJS(module_exports);
// packages/collapse/src/index.js
function src_default(Alpine) {
Alpine.directive("collapse", collapse);
collapse.inline = (el, { modifiers }) => {
if (!modifiers.includes("min"))
return;
el._x_doShow = () => {
};
el._x_doHide = () => {
};
};
function collapse(el, { modifiers }) {
let duration = modifierValue(modifiers, "duration", 250) / 1e3;
let floor = modifierValue(modifiers, "min", 0);
let fullyHide = !modifiers.includes("min");
if (!el._x_isShown)
el.style.height = `${floor}px`;
if (!el._x_isShown && fullyHide)
el.hidden = true;
if (!el._x_isShown)
el.style.overflow = "hidden";
let setFunction = (el2, styles) => {
let revertFunction = Alpine.setStyles(el2, styles);
return styles.height ? () => {
} : revertFunction;
};
let transitionStyles = {
transitionProperty: "height",
transitionDuration: `${duration}s`,
transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
};
el._x_transition = {
in(before = () => {
}, after = () => {
}) {
if (fullyHide)
el.hidden = false;
if (fullyHide)
el.style.display = null;
let current = el.getBoundingClientRect().height;
el.style.height = "auto";
let full = el.getBoundingClientRect().height;
if (current === full) {
current = floor;
}
Alpine.transition(el, Alpine.setStyles, {
during: transitionStyles,
start: { height: current + "px" },
end: { height: full + "px" }
}, () => el._x_isShown = true, () => {
if (el.getBoundingClientRect().height == full) {
el.style.overflow = null;
}
});
},
out(before = () => {
}, after = () => {
}) {
let full = el.getBoundingClientRect().height;
Alpine.transition(el, setFunction, {
during: transitionStyles,
start: { height: full + "px" },
end: { height: floor + "px" }
}, () => el.style.overflow = "hidden", () => {
el._x_isShown = false;
if (el.style.height == `${floor}px` && fullyHide) {
el.style.display = "none";
el.hidden = true;
}
});
}
};
}
}
function modifierValue(modifiers, key, fallback) {
if (modifiers.indexOf(key) === -1)
return fallback;
const rawValue = modifiers[modifiers.indexOf(key) + 1];
if (!rawValue)
return fallback;
if (key === "duration") {
let match = rawValue.match(/([0-9]+)ms/);
if (match)
return match[1];
}
if (key === "min") {
let match = rawValue.match(/([0-9]+)px/);
if (match)
return match[1];
}
return rawValue;
}
// packages/collapse/builds/module.js
var module_default = src_default;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
collapse
});

View File

@@ -0,0 +1,99 @@
// packages/collapse/src/index.js
function src_default(Alpine) {
Alpine.directive("collapse", collapse);
collapse.inline = (el, { modifiers }) => {
if (!modifiers.includes("min"))
return;
el._x_doShow = () => {
};
el._x_doHide = () => {
};
};
function collapse(el, { modifiers }) {
let duration = modifierValue(modifiers, "duration", 250) / 1e3;
let floor = modifierValue(modifiers, "min", 0);
let fullyHide = !modifiers.includes("min");
if (!el._x_isShown)
el.style.height = `${floor}px`;
if (!el._x_isShown && fullyHide)
el.hidden = true;
if (!el._x_isShown)
el.style.overflow = "hidden";
let setFunction = (el2, styles) => {
let revertFunction = Alpine.setStyles(el2, styles);
return styles.height ? () => {
} : revertFunction;
};
let transitionStyles = {
transitionProperty: "height",
transitionDuration: `${duration}s`,
transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
};
el._x_transition = {
in(before = () => {
}, after = () => {
}) {
if (fullyHide)
el.hidden = false;
if (fullyHide)
el.style.display = null;
let current = el.getBoundingClientRect().height;
el.style.height = "auto";
let full = el.getBoundingClientRect().height;
if (current === full) {
current = floor;
}
Alpine.transition(el, Alpine.setStyles, {
during: transitionStyles,
start: { height: current + "px" },
end: { height: full + "px" }
}, () => el._x_isShown = true, () => {
if (el.getBoundingClientRect().height == full) {
el.style.overflow = null;
}
});
},
out(before = () => {
}, after = () => {
}) {
let full = el.getBoundingClientRect().height;
Alpine.transition(el, setFunction, {
during: transitionStyles,
start: { height: full + "px" },
end: { height: floor + "px" }
}, () => el.style.overflow = "hidden", () => {
el._x_isShown = false;
if (el.style.height == `${floor}px` && fullyHide) {
el.style.display = "none";
el.hidden = true;
}
});
}
};
}
}
function modifierValue(modifiers, key, fallback) {
if (modifiers.indexOf(key) === -1)
return fallback;
const rawValue = modifiers[modifiers.indexOf(key) + 1];
if (!rawValue)
return fallback;
if (key === "duration") {
let match = rawValue.match(/([0-9]+)ms/);
if (match)
return match[1];
}
if (key === "min") {
let match = rawValue.match(/([0-9]+)px/);
if (match)
return match[1];
}
return rawValue;
}
// packages/collapse/builds/module.js
var module_default = src_default;
export {
src_default as collapse,
module_default as default
};

View File

@@ -0,0 +1,17 @@
{
"name": "@alpinejs/collapse",
"version": "3.13.8",
"description": "Collapse and expand elements with robust animations",
"homepage": "https://alpinejs.dev/plugins/collapse",
"repository": {
"type": "git",
"url": "https://github.com/alpinejs/alpine.git",
"directory": "packages/collapse"
},
"author": "Caleb Porzio",
"license": "MIT",
"main": "dist/module.cjs.js",
"module": "dist/module.esm.js",
"unpkg": "dist/cdn.min.js",
"dependencies": {}
}

View File

@@ -0,0 +1,108 @@
export default function (Alpine) {
Alpine.directive('collapse', collapse)
// If we're using a "minimum height", we'll need to disable
// x-show's default behavior of setting display: 'none'.
collapse.inline = (el, { modifiers }) => {
if (! modifiers.includes('min')) return
el._x_doShow = () => {}
el._x_doHide = () => {}
}
function collapse(el, { modifiers }) {
let duration = modifierValue(modifiers, 'duration', 250) / 1000
let floor = modifierValue(modifiers, 'min', 0)
let fullyHide = ! modifiers.includes('min')
if (! el._x_isShown) el.style.height = `${floor}px`
// We use the hidden attribute for the benefit of Tailwind
// users as the .space utility will ignore [hidden] elements.
// We also use display:none as the hidden attribute has very
// low CSS specificity and could be accidentally overridden
// by a user.
if (! el._x_isShown && fullyHide) el.hidden = true
if (! el._x_isShown) el.style.overflow = 'hidden'
// Override the setStyles function with one that won't
// revert updates to the height style.
let setFunction = (el, styles) => {
let revertFunction = Alpine.setStyles(el, styles);
return styles.height ? () => {} : revertFunction
}
let transitionStyles = {
transitionProperty: 'height',
transitionDuration: `${duration}s`,
transitionTimingFunction: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
}
el._x_transition = {
in(before = () => {}, after = () => {}) {
if (fullyHide) el.hidden = false;
if (fullyHide) el.style.display = null
let current = el.getBoundingClientRect().height
el.style.height = 'auto'
let full = el.getBoundingClientRect().height
if (current === full) { current = floor }
Alpine.transition(el, Alpine.setStyles, {
during: transitionStyles,
start: { height: current+'px' },
end: { height: full+'px' },
}, () => el._x_isShown = true, () => {
if (el.getBoundingClientRect().height == full) {
el.style.overflow = null
}
})
},
out(before = () => {}, after = () => {}) {
let full = el.getBoundingClientRect().height
Alpine.transition(el, setFunction, {
during: transitionStyles,
start: { height: full+'px' },
end: { height: floor+'px' },
}, () => el.style.overflow = 'hidden', () => {
el._x_isShown = false
// check if element is fully collapsed
if (el.style.height == `${floor}px` && fullyHide) {
el.style.display = 'none'
el.hidden = true
}
})
},
}
}
}
function modifierValue(modifiers, key, fallback) {
// If the modifier isn't present, use the default.
if (modifiers.indexOf(key) === -1) return fallback
// If it IS present, grab the value after it: x-show.transition.duration.500ms
const rawValue = modifiers[modifiers.indexOf(key) + 1]
if (! rawValue) return fallback
if (key === 'duration') {
// Support x-collapse.duration.500ms && duration.500
let match = rawValue.match(/([0-9]+)ms/)
if (match) return match[1]
}
if (key === 'min') {
// Support x-collapse.min.100px && min.100
let match = rawValue.match(/([0-9]+)px/)
if (match) return match[1]
}
return rawValue
}