This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { attachRef } from "svelte-toolbelt";
import { createBitsAttrs } from "../../internal/attrs.js";
const aspectRatioAttrs = createBitsAttrs({
component: "aspect-ratio",
parts: ["root"],
});
export class AspectRatioRootState {
static create(opts) {
return new AspectRatioRootState(opts);
}
opts;
attachment;
constructor(opts) {
this.opts = opts;
this.attachment = attachRef(this.opts.ref);
}
props = $derived.by(() => ({
id: this.opts.id.current,
style: {
position: "absolute",
top: 0,
right: 0,
bottom: 0,
left: 0,
},
[aspectRatioAttrs.root]: "",
...this.attachment,
}));
}