@threadlabs/looma 0.1.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/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/chunk-G53JEAQK.js +94 -0
- package/dist/chunk-OF57X5AR.js +10 -0
- package/dist/chunk-UL7UIUJZ.js +20 -0
- package/dist/chunk-YK4MTZGJ.js +1580 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/events-TcQIzpNv.js +19 -0
- package/dist/cjs/id-CYbKpaYr.js +9 -0
- package/dist/cjs/index-D07f6BOw.js +1569 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/looma.cjs.js +25 -0
- package/dist/cjs/manager-BOpVXb92.js +93 -0
- package/dist/cjs/ui-avatar-group.cjs.entry.js +51 -0
- package/dist/cjs/ui-avatar.cjs.entry.js +50 -0
- package/dist/cjs/ui-badge.cjs.entry.js +19 -0
- package/dist/cjs/ui-button.cjs.entry.js +62 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +91 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +201 -0
- package/dist/cjs/ui-dialog.cjs.entry.js +93 -0
- package/dist/cjs/ui-disclosure.cjs.entry.js +109 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +20 -0
- package/dist/cjs/ui-form-field.cjs.entry.js +59 -0
- package/dist/cjs/ui-icon-button.cjs.entry.js +21 -0
- package/dist/cjs/ui-input.cjs.entry.js +101 -0
- package/dist/cjs/ui-menu-item.cjs.entry.js +19 -0
- package/dist/cjs/ui-menu.cjs.entry.js +96 -0
- package/dist/cjs/ui-popover.cjs.entry.js +92 -0
- package/dist/cjs/ui-radio-group.cjs.entry.js +134 -0
- package/dist/cjs/ui-radio.cjs.entry.js +85 -0
- package/dist/cjs/ui-search-result-row.cjs.entry.js +47 -0
- package/dist/cjs/ui-search-shell.cjs.entry.js +39 -0
- package/dist/cjs/ui-select.cjs.entry.js +100 -0
- package/dist/cjs/ui-switch.cjs.entry.js +65 -0
- package/dist/cjs/ui-tabs.cjs.entry.js +117 -0
- package/dist/cjs/ui-textarea.cjs.entry.js +106 -0
- package/dist/cjs/ui-toast-region.cjs.entry.js +67 -0
- package/dist/cjs/ui-tooltip.cjs.entry.js +133 -0
- package/dist/cjs/ui-top-bar.cjs.entry.js +43 -0
- package/dist/collection/collection-manifest.json +38 -0
- package/dist/collection/components/ui-avatar/ui-avatar.css +35 -0
- package/dist/collection/components/ui-avatar/ui-avatar.js +130 -0
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +32 -0
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +103 -0
- package/dist/collection/components/ui-badge/ui-badge.css +74 -0
- package/dist/collection/components/ui-badge/ui-badge.js +62 -0
- package/dist/collection/components/ui-button/ui-button.css +101 -0
- package/dist/collection/components/ui-button/ui-button.js +127 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.css +24 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +223 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.css +17 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +272 -0
- package/dist/collection/components/ui-dialog/ui-dialog.css +65 -0
- package/dist/collection/components/ui-dialog/ui-dialog.js +185 -0
- package/dist/collection/components/ui-disclosure/ui-disclosure.css +7 -0
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +182 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +70 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +85 -0
- package/dist/collection/components/ui-form-field/ui-form-field.css +21 -0
- package/dist/collection/components/ui-form-field/ui-form-field.js +125 -0
- package/dist/collection/components/ui-icon-button/ui-icon-button.css +92 -0
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +106 -0
- package/dist/collection/components/ui-input/ui-input.css +46 -0
- package/dist/collection/components/ui-input/ui-input.js +213 -0
- package/dist/collection/components/ui-menu/ui-menu.css +37 -0
- package/dist/collection/components/ui-menu/ui-menu.js +149 -0
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +26 -0
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +64 -0
- package/dist/collection/components/ui-popover/ui-popover.css +8 -0
- package/dist/collection/components/ui-popover/ui-popover.js +144 -0
- package/dist/collection/components/ui-radio/ui-radio.css +22 -0
- package/dist/collection/components/ui-radio/ui-radio.js +213 -0
- package/dist/collection/components/ui-radio-group/ui-radio-group.css +10 -0
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +247 -0
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +80 -0
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +100 -0
- package/dist/collection/components/ui-search-shell/ui-search-shell.css +61 -0
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +46 -0
- package/dist/collection/components/ui-select/ui-select.css +62 -0
- package/dist/collection/components/ui-select/ui-select.js +212 -0
- package/dist/collection/components/ui-switch/ui-switch.css +63 -0
- package/dist/collection/components/ui-switch/ui-switch.js +177 -0
- package/dist/collection/components/ui-tabs/ui-tabs.css +65 -0
- package/dist/collection/components/ui-tabs/ui-tabs.js +190 -0
- package/dist/collection/components/ui-textarea/ui-textarea.css +48 -0
- package/dist/collection/components/ui-textarea/ui-textarea.js +238 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.css +52 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +100 -0
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +14 -0
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +205 -0
- package/dist/collection/components/ui-top-bar/ui-top-bar.css +43 -0
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +52 -0
- package/dist/collection/overlay/manager.js +90 -0
- package/dist/collection/utils/events.js +13 -0
- package/dist/collection/utils/id.js +5 -0
- package/dist/collection/utils/initials.js +11 -0
- package/dist/components/index.d.ts +88 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CIA4RyEp.js +1 -0
- package/dist/components/p-CR7f2MQC.js +1 -0
- package/dist/components/p-JwSoedEO.js +1 -0
- package/dist/components/p-WvL4iAhX.js +1 -0
- package/dist/components/p-hgBUJRDa.js +1 -0
- package/dist/components/ui-avatar-group.d.ts +11 -0
- package/dist/components/ui-avatar-group.js +1 -0
- package/dist/components/ui-avatar.d.ts +11 -0
- package/dist/components/ui-avatar.js +1 -0
- package/dist/components/ui-badge.d.ts +11 -0
- package/dist/components/ui-badge.js +1 -0
- package/dist/components/ui-button.d.ts +11 -0
- package/dist/components/ui-button.js +1 -0
- package/dist/components/ui-checkbox.d.ts +11 -0
- package/dist/components/ui-checkbox.js +1 -0
- package/dist/components/ui-context-menu.d.ts +11 -0
- package/dist/components/ui-context-menu.js +1 -0
- package/dist/components/ui-dialog.d.ts +11 -0
- package/dist/components/ui-dialog.js +1 -0
- package/dist/components/ui-disclosure.d.ts +11 -0
- package/dist/components/ui-disclosure.js +1 -0
- package/dist/components/ui-floating-action-button.d.ts +11 -0
- package/dist/components/ui-floating-action-button.js +1 -0
- package/dist/components/ui-form-field.d.ts +11 -0
- package/dist/components/ui-form-field.js +1 -0
- package/dist/components/ui-icon-button.d.ts +11 -0
- package/dist/components/ui-icon-button.js +1 -0
- package/dist/components/ui-input.d.ts +11 -0
- package/dist/components/ui-input.js +1 -0
- package/dist/components/ui-menu-item.d.ts +11 -0
- package/dist/components/ui-menu-item.js +1 -0
- package/dist/components/ui-menu.d.ts +11 -0
- package/dist/components/ui-menu.js +1 -0
- package/dist/components/ui-popover.d.ts +11 -0
- package/dist/components/ui-popover.js +1 -0
- package/dist/components/ui-radio-group.d.ts +11 -0
- package/dist/components/ui-radio-group.js +1 -0
- package/dist/components/ui-radio.d.ts +11 -0
- package/dist/components/ui-radio.js +1 -0
- package/dist/components/ui-search-result-row.d.ts +11 -0
- package/dist/components/ui-search-result-row.js +1 -0
- package/dist/components/ui-search-shell.d.ts +11 -0
- package/dist/components/ui-search-shell.js +1 -0
- package/dist/components/ui-select.d.ts +11 -0
- package/dist/components/ui-select.js +1 -0
- package/dist/components/ui-switch.d.ts +11 -0
- package/dist/components/ui-switch.js +1 -0
- package/dist/components/ui-tabs.d.ts +11 -0
- package/dist/components/ui-tabs.js +1 -0
- package/dist/components/ui-textarea.d.ts +11 -0
- package/dist/components/ui-textarea.js +1 -0
- package/dist/components/ui-toast-region.d.ts +11 -0
- package/dist/components/ui-toast-region.js +1 -0
- package/dist/components/ui-tooltip.d.ts +11 -0
- package/dist/components/ui-tooltip.js +1 -0
- package/dist/components/ui-top-bar.d.ts +11 -0
- package/dist/components/ui-top-bar.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/events-JwSoedEO.js +15 -0
- package/dist/esm/id-hgBUJRDa.js +7 -0
- package/dist/esm/index-CEeiinfk.js +1561 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/looma.js +21 -0
- package/dist/esm/manager-CR7f2MQC.js +89 -0
- package/dist/esm/ui-avatar-group.entry.js +49 -0
- package/dist/esm/ui-avatar.entry.js +48 -0
- package/dist/esm/ui-badge.entry.js +17 -0
- package/dist/esm/ui-button.entry.js +60 -0
- package/dist/esm/ui-checkbox.entry.js +89 -0
- package/dist/esm/ui-context-menu.entry.js +199 -0
- package/dist/esm/ui-dialog.entry.js +91 -0
- package/dist/esm/ui-disclosure.entry.js +107 -0
- package/dist/esm/ui-floating-action-button.entry.js +18 -0
- package/dist/esm/ui-form-field.entry.js +57 -0
- package/dist/esm/ui-icon-button.entry.js +19 -0
- package/dist/esm/ui-input.entry.js +99 -0
- package/dist/esm/ui-menu-item.entry.js +17 -0
- package/dist/esm/ui-menu.entry.js +94 -0
- package/dist/esm/ui-popover.entry.js +90 -0
- package/dist/esm/ui-radio-group.entry.js +132 -0
- package/dist/esm/ui-radio.entry.js +83 -0
- package/dist/esm/ui-search-result-row.entry.js +45 -0
- package/dist/esm/ui-search-shell.entry.js +37 -0
- package/dist/esm/ui-select.entry.js +98 -0
- package/dist/esm/ui-switch.entry.js +63 -0
- package/dist/esm/ui-tabs.entry.js +115 -0
- package/dist/esm/ui-textarea.entry.js +104 -0
- package/dist/esm/ui-toast-region.entry.js +65 -0
- package/dist/esm/ui-tooltip.entry.js +131 -0
- package/dist/esm/ui-top-bar.entry.js +41 -0
- package/dist/index.cjs +4062 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +129 -0
- package/dist/looma/index.esm.js +0 -0
- package/dist/looma/looma.esm.js +1 -0
- package/dist/looma/p-03f0594b.entry.js +1 -0
- package/dist/looma/p-15e619fd.entry.js +1 -0
- package/dist/looma/p-201243dc.entry.js +1 -0
- package/dist/looma/p-24d7aa5b.entry.js +1 -0
- package/dist/looma/p-341ba64a.entry.js +1 -0
- package/dist/looma/p-41d62a83.entry.js +1 -0
- package/dist/looma/p-4742e6b4.entry.js +1 -0
- package/dist/looma/p-4c54d489.entry.js +1 -0
- package/dist/looma/p-52c537fa.entry.js +1 -0
- package/dist/looma/p-5a645647.entry.js +1 -0
- package/dist/looma/p-610b2eca.entry.js +1 -0
- package/dist/looma/p-649dad92.entry.js +1 -0
- package/dist/looma/p-66a203a1.entry.js +1 -0
- package/dist/looma/p-754cfff3.entry.js +1 -0
- package/dist/looma/p-93ce1c62.entry.js +1 -0
- package/dist/looma/p-955fb814.entry.js +1 -0
- package/dist/looma/p-96de71ad.entry.js +1 -0
- package/dist/looma/p-CEeiinfk.js +2 -0
- package/dist/looma/p-CR7f2MQC.js +1 -0
- package/dist/looma/p-DQuL1Twl.js +1 -0
- package/dist/looma/p-JwSoedEO.js +1 -0
- package/dist/looma/p-ab4151d5.entry.js +1 -0
- package/dist/looma/p-c14233bc.entry.js +1 -0
- package/dist/looma/p-dc857ed4.entry.js +1 -0
- package/dist/looma/p-dfcb2cca.entry.js +1 -0
- package/dist/looma/p-dff144bd.entry.js +1 -0
- package/dist/looma/p-ebb74106.entry.js +1 -0
- package/dist/looma/p-ecb5739b.entry.js +1 -0
- package/dist/looma/p-ee31c7b4.entry.js +1 -0
- package/dist/looma/p-fa4659c4.entry.js +1 -0
- package/dist/looma/p-hgBUJRDa.js +1 -0
- package/dist/types/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +12 -0
- package/dist/types/components/ui-badge/ui-badge.d.ts +5 -0
- package/dist/types/components/ui-button/ui-button.d.ts +13 -0
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +19 -0
- package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +37 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +19 -0
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +20 -0
- package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +6 -0
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +10 -0
- package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +7 -0
- package/dist/types/components/ui-input/ui-input.d.ts +19 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +14 -0
- package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +5 -0
- package/dist/types/components/ui-popover/ui-popover.d.ts +16 -0
- package/dist/types/components/ui-radio/ui-radio.d.ts +17 -0
- package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +21 -0
- package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +15 -0
- package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +9 -0
- package/dist/types/components/ui-select/ui-select.d.ts +19 -0
- package/dist/types/components/ui-switch/ui-switch.d.ts +15 -0
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +17 -0
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +20 -0
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +12 -0
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +24 -0
- package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +12 -0
- package/dist/types/components.d.ts +1148 -0
- package/dist/types/overlay/manager.d.ts +14 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/events.d.ts +4 -0
- package/dist/types/utils/id.d.ts +1 -0
- package/dist/types/utils/initials.d.ts +1 -0
- package/dist/ui-avatar-group.entry-BZGXBOSE.js +59 -0
- package/dist/ui-avatar.entry-S2O2W5SA.js +51 -0
- package/dist/ui-badge.entry-CVJDISCR.js +22 -0
- package/dist/ui-button.entry-LNJBEJFE.js +72 -0
- package/dist/ui-checkbox.entry-5RA2CB43.js +102 -0
- package/dist/ui-context-menu.entry-UUOCT75F.js +211 -0
- package/dist/ui-dialog.entry-OEPJTEES.js +106 -0
- package/dist/ui-disclosure.entry-LRRISGUD.js +120 -0
- package/dist/ui-floating-action-button.entry-7TSAZRXP.js +23 -0
- package/dist/ui-form-field.entry-73YOVICF.js +67 -0
- package/dist/ui-icon-button.entry-MNXGPG36.js +24 -0
- package/dist/ui-input.entry-UWRVAOSW.js +112 -0
- package/dist/ui-menu-item.entry-5AOJO5MP.js +22 -0
- package/dist/ui-menu.entry-YDS6UMB5.js +98 -0
- package/dist/ui-popover.entry-PGWDCQIX.js +104 -0
- package/dist/ui-radio-group.entry-RHP5GNWU.js +142 -0
- package/dist/ui-radio.entry-5WRWPSTK.js +96 -0
- package/dist/ui-search-result-row.entry-IKJB2SJJ.js +50 -0
- package/dist/ui-search-shell.entry-ZIWF4ZHH.js +41 -0
- package/dist/ui-select.entry-N5TIKHR7.js +111 -0
- package/dist/ui-switch.entry-WUSZTXIR.js +75 -0
- package/dist/ui-tabs.entry-UFAVAQIF.js +124 -0
- package/dist/ui-textarea.entry-BYT47RAQ.js +117 -0
- package/dist/ui-toast-region.entry-6UYR3ZU2.js +78 -0
- package/dist/ui-tooltip.entry-YS7UX4FS.js +145 -0
- package/dist/ui-top-bar.entry-V27H6NFO.js +49 -0
- package/editor/chunk-JKRA4D4W.js +435 -0
- package/editor/chunk-NOOV344H.js +783 -0
- package/editor/extensions/index.d.ts +78 -0
- package/editor/extensions/index.js +28 -0
- package/editor/index.d.ts +7 -0
- package/editor/index.js +29 -0
- package/editor/table-overlay-DTr3KC9e.d.ts +12 -0
- package/editor/ui.d.ts +48 -0
- package/editor/ui.js +1 -0
- package/editor.css +662 -0
- package/layout/index.cjs +207 -0
- package/layout/index.css +166 -0
- package/layout/index.d.cts +3 -0
- package/layout/index.d.ts +3 -0
- package/layout/index.js +182 -0
- package/layout.css +124 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +244 -0
- package/styles.css +899 -0
- package/theme-dark.css +59 -0
- package/theme-high-contrast.css +21 -0
- package/theme-light.css +30 -0
- package/tokens.css +148 -0
- package/vue/chunk-J4UBEIIL.js +83 -0
- package/vue/editor/index.d.ts +89 -0
- package/vue/editor/index.js +125 -0
- package/vue/index.d.ts +167 -0
- package/vue/index.js +113 -0
package/layout/index.cjs
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
registerLayoutPrimitives: () => registerLayoutPrimitives
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var ORIENTATION_HORIZONTAL = "horizontal";
|
|
27
|
+
var ORIENTATION_VERTICAL = "vertical";
|
|
28
|
+
function normalizeOrientation(value) {
|
|
29
|
+
return value === ORIENTATION_VERTICAL ? ORIENTATION_VERTICAL : ORIENTATION_HORIZONTAL;
|
|
30
|
+
}
|
|
31
|
+
if (typeof HTMLElement !== "undefined") {
|
|
32
|
+
class UILayoutElement extends HTMLElement {
|
|
33
|
+
getPrimitiveAttribute(name) {
|
|
34
|
+
return this.getAttribute(name) ?? "";
|
|
35
|
+
}
|
|
36
|
+
setPrimitiveAttribute(name, value) {
|
|
37
|
+
const normalizedValue = value.trim();
|
|
38
|
+
if (normalizedValue.length === 0) {
|
|
39
|
+
this.removeAttribute(name);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.setAttribute(name, normalizedValue);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class UIStackElement extends UILayoutElement {
|
|
46
|
+
static get observedAttributes() {
|
|
47
|
+
return ["gap", "align", "justify"];
|
|
48
|
+
}
|
|
49
|
+
get gap() {
|
|
50
|
+
return this.getPrimitiveAttribute("gap");
|
|
51
|
+
}
|
|
52
|
+
set gap(value) {
|
|
53
|
+
this.setPrimitiveAttribute("gap", value);
|
|
54
|
+
}
|
|
55
|
+
get align() {
|
|
56
|
+
return this.getPrimitiveAttribute("align");
|
|
57
|
+
}
|
|
58
|
+
set align(value) {
|
|
59
|
+
this.setPrimitiveAttribute("align", value);
|
|
60
|
+
}
|
|
61
|
+
get justify() {
|
|
62
|
+
return this.getPrimitiveAttribute("justify");
|
|
63
|
+
}
|
|
64
|
+
set justify(value) {
|
|
65
|
+
this.setPrimitiveAttribute("justify", value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
class UIInlineElement extends UILayoutElement {
|
|
69
|
+
static get observedAttributes() {
|
|
70
|
+
return ["gap", "align", "justify", "wrap"];
|
|
71
|
+
}
|
|
72
|
+
get gap() {
|
|
73
|
+
return this.getPrimitiveAttribute("gap");
|
|
74
|
+
}
|
|
75
|
+
set gap(value) {
|
|
76
|
+
this.setPrimitiveAttribute("gap", value);
|
|
77
|
+
}
|
|
78
|
+
get align() {
|
|
79
|
+
return this.getPrimitiveAttribute("align");
|
|
80
|
+
}
|
|
81
|
+
set align(value) {
|
|
82
|
+
this.setPrimitiveAttribute("align", value);
|
|
83
|
+
}
|
|
84
|
+
get justify() {
|
|
85
|
+
return this.getPrimitiveAttribute("justify");
|
|
86
|
+
}
|
|
87
|
+
set justify(value) {
|
|
88
|
+
this.setPrimitiveAttribute("justify", value);
|
|
89
|
+
}
|
|
90
|
+
get wrap() {
|
|
91
|
+
return this.getPrimitiveAttribute("wrap");
|
|
92
|
+
}
|
|
93
|
+
set wrap(value) {
|
|
94
|
+
this.setPrimitiveAttribute("wrap", value);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
class UIClusterElement extends UILayoutElement {
|
|
98
|
+
static get observedAttributes() {
|
|
99
|
+
return ["gap", "align", "justify"];
|
|
100
|
+
}
|
|
101
|
+
get gap() {
|
|
102
|
+
return this.getPrimitiveAttribute("gap");
|
|
103
|
+
}
|
|
104
|
+
set gap(value) {
|
|
105
|
+
this.setPrimitiveAttribute("gap", value);
|
|
106
|
+
}
|
|
107
|
+
get align() {
|
|
108
|
+
return this.getPrimitiveAttribute("align");
|
|
109
|
+
}
|
|
110
|
+
set align(value) {
|
|
111
|
+
this.setPrimitiveAttribute("align", value);
|
|
112
|
+
}
|
|
113
|
+
get justify() {
|
|
114
|
+
return this.getPrimitiveAttribute("justify");
|
|
115
|
+
}
|
|
116
|
+
set justify(value) {
|
|
117
|
+
this.setPrimitiveAttribute("justify", value);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
class UIGridElement extends UILayoutElement {
|
|
121
|
+
static get observedAttributes() {
|
|
122
|
+
return ["gap", "min"];
|
|
123
|
+
}
|
|
124
|
+
get gap() {
|
|
125
|
+
return this.getPrimitiveAttribute("gap");
|
|
126
|
+
}
|
|
127
|
+
set gap(value) {
|
|
128
|
+
this.setPrimitiveAttribute("gap", value);
|
|
129
|
+
}
|
|
130
|
+
get min() {
|
|
131
|
+
return this.getPrimitiveAttribute("min");
|
|
132
|
+
}
|
|
133
|
+
set min(value) {
|
|
134
|
+
this.setPrimitiveAttribute("min", value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
class UICenterElement extends UILayoutElement {
|
|
138
|
+
static get observedAttributes() {
|
|
139
|
+
return ["measure", "gutters"];
|
|
140
|
+
}
|
|
141
|
+
get measure() {
|
|
142
|
+
return this.getPrimitiveAttribute("measure");
|
|
143
|
+
}
|
|
144
|
+
set measure(value) {
|
|
145
|
+
this.setPrimitiveAttribute("measure", value);
|
|
146
|
+
}
|
|
147
|
+
get gutters() {
|
|
148
|
+
return this.getPrimitiveAttribute("gutters");
|
|
149
|
+
}
|
|
150
|
+
set gutters(value) {
|
|
151
|
+
this.setPrimitiveAttribute("gutters", value);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
class UISeparatorElement extends UILayoutElement {
|
|
155
|
+
static get observedAttributes() {
|
|
156
|
+
return ["orientation", "role"];
|
|
157
|
+
}
|
|
158
|
+
connectedCallback() {
|
|
159
|
+
this.ensureDefaults();
|
|
160
|
+
}
|
|
161
|
+
get orientation() {
|
|
162
|
+
return normalizeOrientation(this.getAttribute("orientation"));
|
|
163
|
+
}
|
|
164
|
+
set orientation(value) {
|
|
165
|
+
const normalizedValue = normalizeOrientation(value);
|
|
166
|
+
this.setPrimitiveAttribute("orientation", normalizedValue);
|
|
167
|
+
this.syncOrientationAria();
|
|
168
|
+
}
|
|
169
|
+
attributeChangedCallback(name) {
|
|
170
|
+
if (name === "orientation" || name === "role") {
|
|
171
|
+
this.syncOrientationAria();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
ensureDefaults() {
|
|
175
|
+
if (!this.hasAttribute("role")) {
|
|
176
|
+
this.setAttribute("role", "separator");
|
|
177
|
+
}
|
|
178
|
+
this.syncOrientationAria();
|
|
179
|
+
}
|
|
180
|
+
syncOrientationAria() {
|
|
181
|
+
if (this.getAttribute("role") !== "separator") {
|
|
182
|
+
this.removeAttribute("aria-orientation");
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.setAttribute("aria-orientation", this.orientation);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const definitions = [
|
|
189
|
+
["ui-stack", UIStackElement],
|
|
190
|
+
["ui-inline", UIInlineElement],
|
|
191
|
+
["ui-cluster", UIClusterElement],
|
|
192
|
+
["ui-grid", UIGridElement],
|
|
193
|
+
["ui-center", UICenterElement],
|
|
194
|
+
["ui-separator", UISeparatorElement]
|
|
195
|
+
];
|
|
196
|
+
for (const [tag, constructor] of definitions) {
|
|
197
|
+
if (!customElements.get(tag)) {
|
|
198
|
+
customElements.define(tag, constructor);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function registerLayoutPrimitives() {
|
|
203
|
+
}
|
|
204
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
205
|
+
0 && (module.exports = {
|
|
206
|
+
registerLayoutPrimitives
|
|
207
|
+
});
|
package/layout/index.css
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/* src/layout.css */
|
|
2
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator),
|
|
3
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *,
|
|
4
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::before,
|
|
5
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) {
|
|
9
|
+
all: revert;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin: 0;
|
|
12
|
+
font-family: var(--ui-font-family-sans);
|
|
13
|
+
font-size: var(--ui-font-size-md);
|
|
14
|
+
line-height: var(--ui-line-height-md);
|
|
15
|
+
color: var(--ui-text-primary);
|
|
16
|
+
}
|
|
17
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator)[data-ui-inherit-typography] {
|
|
18
|
+
font-family: inherit;
|
|
19
|
+
font-size: inherit;
|
|
20
|
+
line-height: inherit;
|
|
21
|
+
font-weight: inherit;
|
|
22
|
+
color: inherit;
|
|
23
|
+
direction: inherit;
|
|
24
|
+
writing-mode: inherit;
|
|
25
|
+
text-orientation: inherit;
|
|
26
|
+
text-rendering: inherit;
|
|
27
|
+
font-feature-settings: inherit;
|
|
28
|
+
font-variation-settings: inherit;
|
|
29
|
+
}
|
|
30
|
+
@layer components {
|
|
31
|
+
ui-stack {
|
|
32
|
+
--ui-layout-gap: var(--ui-space-4, 1rem);
|
|
33
|
+
--ui-layout-align: stretch;
|
|
34
|
+
--ui-layout-justify: flex-start;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: var(--ui-layout-gap);
|
|
38
|
+
align-items: var(--ui-layout-align);
|
|
39
|
+
justify-content: var(--ui-layout-justify);
|
|
40
|
+
}
|
|
41
|
+
ui-stack[gap=xs] {
|
|
42
|
+
--ui-layout-gap: var(--ui-space-2, 0.5rem);
|
|
43
|
+
}
|
|
44
|
+
ui-stack[gap=s] {
|
|
45
|
+
--ui-layout-gap: var(--ui-space-3, 0.75rem);
|
|
46
|
+
}
|
|
47
|
+
ui-stack[gap=m] {
|
|
48
|
+
--ui-layout-gap: var(--ui-space-4, 1rem);
|
|
49
|
+
}
|
|
50
|
+
ui-stack[gap=l] {
|
|
51
|
+
--ui-layout-gap: var(--ui-space-5, 1.5rem);
|
|
52
|
+
}
|
|
53
|
+
ui-stack[gap=xl] {
|
|
54
|
+
--ui-layout-gap: var(--ui-space-6, 2rem);
|
|
55
|
+
}
|
|
56
|
+
ui-stack[align=start] {
|
|
57
|
+
--ui-layout-align: flex-start;
|
|
58
|
+
}
|
|
59
|
+
ui-stack[align=center] {
|
|
60
|
+
--ui-layout-align: center;
|
|
61
|
+
}
|
|
62
|
+
ui-stack[align=end] {
|
|
63
|
+
--ui-layout-align: flex-end;
|
|
64
|
+
}
|
|
65
|
+
ui-stack[justify=center] {
|
|
66
|
+
--ui-layout-justify: center;
|
|
67
|
+
}
|
|
68
|
+
ui-stack[justify=end] {
|
|
69
|
+
--ui-layout-justify: flex-end;
|
|
70
|
+
}
|
|
71
|
+
ui-stack[justify=between] {
|
|
72
|
+
--ui-layout-justify: space-between;
|
|
73
|
+
}
|
|
74
|
+
ui-inline,
|
|
75
|
+
ui-cluster {
|
|
76
|
+
--ui-layout-gap: var(--ui-space-3, 0.75rem);
|
|
77
|
+
--ui-layout-align: center;
|
|
78
|
+
--ui-layout-justify: flex-start;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
align-items: var(--ui-layout-align);
|
|
82
|
+
justify-content: var(--ui-layout-justify);
|
|
83
|
+
gap: var(--ui-layout-gap);
|
|
84
|
+
}
|
|
85
|
+
ui-inline[wrap=nowrap] {
|
|
86
|
+
flex-wrap: nowrap;
|
|
87
|
+
}
|
|
88
|
+
ui-inline[gap=xs],
|
|
89
|
+
ui-cluster[gap=xs] {
|
|
90
|
+
--ui-layout-gap: var(--ui-space-2, 0.5rem);
|
|
91
|
+
}
|
|
92
|
+
ui-inline[gap=s],
|
|
93
|
+
ui-cluster[gap=s] {
|
|
94
|
+
--ui-layout-gap: var(--ui-space-3, 0.75rem);
|
|
95
|
+
}
|
|
96
|
+
ui-inline[gap=m],
|
|
97
|
+
ui-cluster[gap=m] {
|
|
98
|
+
--ui-layout-gap: var(--ui-space-4, 1rem);
|
|
99
|
+
}
|
|
100
|
+
ui-grid {
|
|
101
|
+
--ui-grid-gap: var(--ui-space-4, 1rem);
|
|
102
|
+
--ui-grid-min: 16rem;
|
|
103
|
+
display: grid;
|
|
104
|
+
gap: var(--ui-grid-gap);
|
|
105
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--ui-grid-min), 1fr));
|
|
106
|
+
}
|
|
107
|
+
ui-grid[gap=xs] {
|
|
108
|
+
--ui-grid-gap: var(--ui-space-2, 0.5rem);
|
|
109
|
+
}
|
|
110
|
+
ui-grid[gap=s] {
|
|
111
|
+
--ui-grid-gap: var(--ui-space-3, 0.75rem);
|
|
112
|
+
}
|
|
113
|
+
ui-grid[gap=m] {
|
|
114
|
+
--ui-grid-gap: var(--ui-space-4, 1rem);
|
|
115
|
+
}
|
|
116
|
+
ui-grid[gap=l] {
|
|
117
|
+
--ui-grid-gap: var(--ui-space-5, 1.5rem);
|
|
118
|
+
}
|
|
119
|
+
ui-grid[min=sm] {
|
|
120
|
+
--ui-grid-min: 12rem;
|
|
121
|
+
}
|
|
122
|
+
ui-grid[min=md] {
|
|
123
|
+
--ui-grid-min: 16rem;
|
|
124
|
+
}
|
|
125
|
+
ui-grid[min=lg] {
|
|
126
|
+
--ui-grid-min: 20rem;
|
|
127
|
+
}
|
|
128
|
+
ui-center {
|
|
129
|
+
--ui-center-measure: 65ch;
|
|
130
|
+
--ui-center-gutters: var(--ui-space-4, 1rem);
|
|
131
|
+
display: block;
|
|
132
|
+
max-inline-size: var(--ui-center-measure);
|
|
133
|
+
margin-inline: auto;
|
|
134
|
+
padding-inline: var(--ui-center-gutters);
|
|
135
|
+
}
|
|
136
|
+
ui-center[measure=narrow] {
|
|
137
|
+
--ui-center-measure: 45ch;
|
|
138
|
+
}
|
|
139
|
+
ui-center[measure=wide] {
|
|
140
|
+
--ui-center-measure: 80ch;
|
|
141
|
+
}
|
|
142
|
+
ui-center[gutters=s] {
|
|
143
|
+
--ui-center-gutters: var(--ui-space-3, 0.75rem);
|
|
144
|
+
}
|
|
145
|
+
ui-center[gutters=m] {
|
|
146
|
+
--ui-center-gutters: var(--ui-space-4, 1rem);
|
|
147
|
+
}
|
|
148
|
+
ui-center[gutters=l] {
|
|
149
|
+
--ui-center-gutters: var(--ui-space-5, 1.5rem);
|
|
150
|
+
}
|
|
151
|
+
ui-separator {
|
|
152
|
+
--ui-separator-color: var(--ui-border-default, #d0d5dd);
|
|
153
|
+
--ui-separator-space: var(--ui-space-4, 1rem);
|
|
154
|
+
display: block;
|
|
155
|
+
margin: 0;
|
|
156
|
+
border: 0;
|
|
157
|
+
border-block-start: 1px solid var(--ui-separator-color);
|
|
158
|
+
padding: 0;
|
|
159
|
+
}
|
|
160
|
+
ui-separator[orientation=vertical] {
|
|
161
|
+
inline-size: 1px;
|
|
162
|
+
block-size: 100%;
|
|
163
|
+
border-block-start: 0;
|
|
164
|
+
border-inline-start: 1px solid var(--ui-separator-color);
|
|
165
|
+
}
|
|
166
|
+
}
|
package/layout/index.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var ORIENTATION_HORIZONTAL = "horizontal";
|
|
3
|
+
var ORIENTATION_VERTICAL = "vertical";
|
|
4
|
+
function normalizeOrientation(value) {
|
|
5
|
+
return value === ORIENTATION_VERTICAL ? ORIENTATION_VERTICAL : ORIENTATION_HORIZONTAL;
|
|
6
|
+
}
|
|
7
|
+
if (typeof HTMLElement !== "undefined") {
|
|
8
|
+
class UILayoutElement extends HTMLElement {
|
|
9
|
+
getPrimitiveAttribute(name) {
|
|
10
|
+
return this.getAttribute(name) ?? "";
|
|
11
|
+
}
|
|
12
|
+
setPrimitiveAttribute(name, value) {
|
|
13
|
+
const normalizedValue = value.trim();
|
|
14
|
+
if (normalizedValue.length === 0) {
|
|
15
|
+
this.removeAttribute(name);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
this.setAttribute(name, normalizedValue);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class UIStackElement extends UILayoutElement {
|
|
22
|
+
static get observedAttributes() {
|
|
23
|
+
return ["gap", "align", "justify"];
|
|
24
|
+
}
|
|
25
|
+
get gap() {
|
|
26
|
+
return this.getPrimitiveAttribute("gap");
|
|
27
|
+
}
|
|
28
|
+
set gap(value) {
|
|
29
|
+
this.setPrimitiveAttribute("gap", value);
|
|
30
|
+
}
|
|
31
|
+
get align() {
|
|
32
|
+
return this.getPrimitiveAttribute("align");
|
|
33
|
+
}
|
|
34
|
+
set align(value) {
|
|
35
|
+
this.setPrimitiveAttribute("align", value);
|
|
36
|
+
}
|
|
37
|
+
get justify() {
|
|
38
|
+
return this.getPrimitiveAttribute("justify");
|
|
39
|
+
}
|
|
40
|
+
set justify(value) {
|
|
41
|
+
this.setPrimitiveAttribute("justify", value);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class UIInlineElement extends UILayoutElement {
|
|
45
|
+
static get observedAttributes() {
|
|
46
|
+
return ["gap", "align", "justify", "wrap"];
|
|
47
|
+
}
|
|
48
|
+
get gap() {
|
|
49
|
+
return this.getPrimitiveAttribute("gap");
|
|
50
|
+
}
|
|
51
|
+
set gap(value) {
|
|
52
|
+
this.setPrimitiveAttribute("gap", value);
|
|
53
|
+
}
|
|
54
|
+
get align() {
|
|
55
|
+
return this.getPrimitiveAttribute("align");
|
|
56
|
+
}
|
|
57
|
+
set align(value) {
|
|
58
|
+
this.setPrimitiveAttribute("align", value);
|
|
59
|
+
}
|
|
60
|
+
get justify() {
|
|
61
|
+
return this.getPrimitiveAttribute("justify");
|
|
62
|
+
}
|
|
63
|
+
set justify(value) {
|
|
64
|
+
this.setPrimitiveAttribute("justify", value);
|
|
65
|
+
}
|
|
66
|
+
get wrap() {
|
|
67
|
+
return this.getPrimitiveAttribute("wrap");
|
|
68
|
+
}
|
|
69
|
+
set wrap(value) {
|
|
70
|
+
this.setPrimitiveAttribute("wrap", value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
class UIClusterElement extends UILayoutElement {
|
|
74
|
+
static get observedAttributes() {
|
|
75
|
+
return ["gap", "align", "justify"];
|
|
76
|
+
}
|
|
77
|
+
get gap() {
|
|
78
|
+
return this.getPrimitiveAttribute("gap");
|
|
79
|
+
}
|
|
80
|
+
set gap(value) {
|
|
81
|
+
this.setPrimitiveAttribute("gap", value);
|
|
82
|
+
}
|
|
83
|
+
get align() {
|
|
84
|
+
return this.getPrimitiveAttribute("align");
|
|
85
|
+
}
|
|
86
|
+
set align(value) {
|
|
87
|
+
this.setPrimitiveAttribute("align", value);
|
|
88
|
+
}
|
|
89
|
+
get justify() {
|
|
90
|
+
return this.getPrimitiveAttribute("justify");
|
|
91
|
+
}
|
|
92
|
+
set justify(value) {
|
|
93
|
+
this.setPrimitiveAttribute("justify", value);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
class UIGridElement extends UILayoutElement {
|
|
97
|
+
static get observedAttributes() {
|
|
98
|
+
return ["gap", "min"];
|
|
99
|
+
}
|
|
100
|
+
get gap() {
|
|
101
|
+
return this.getPrimitiveAttribute("gap");
|
|
102
|
+
}
|
|
103
|
+
set gap(value) {
|
|
104
|
+
this.setPrimitiveAttribute("gap", value);
|
|
105
|
+
}
|
|
106
|
+
get min() {
|
|
107
|
+
return this.getPrimitiveAttribute("min");
|
|
108
|
+
}
|
|
109
|
+
set min(value) {
|
|
110
|
+
this.setPrimitiveAttribute("min", value);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
class UICenterElement extends UILayoutElement {
|
|
114
|
+
static get observedAttributes() {
|
|
115
|
+
return ["measure", "gutters"];
|
|
116
|
+
}
|
|
117
|
+
get measure() {
|
|
118
|
+
return this.getPrimitiveAttribute("measure");
|
|
119
|
+
}
|
|
120
|
+
set measure(value) {
|
|
121
|
+
this.setPrimitiveAttribute("measure", value);
|
|
122
|
+
}
|
|
123
|
+
get gutters() {
|
|
124
|
+
return this.getPrimitiveAttribute("gutters");
|
|
125
|
+
}
|
|
126
|
+
set gutters(value) {
|
|
127
|
+
this.setPrimitiveAttribute("gutters", value);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class UISeparatorElement extends UILayoutElement {
|
|
131
|
+
static get observedAttributes() {
|
|
132
|
+
return ["orientation", "role"];
|
|
133
|
+
}
|
|
134
|
+
connectedCallback() {
|
|
135
|
+
this.ensureDefaults();
|
|
136
|
+
}
|
|
137
|
+
get orientation() {
|
|
138
|
+
return normalizeOrientation(this.getAttribute("orientation"));
|
|
139
|
+
}
|
|
140
|
+
set orientation(value) {
|
|
141
|
+
const normalizedValue = normalizeOrientation(value);
|
|
142
|
+
this.setPrimitiveAttribute("orientation", normalizedValue);
|
|
143
|
+
this.syncOrientationAria();
|
|
144
|
+
}
|
|
145
|
+
attributeChangedCallback(name) {
|
|
146
|
+
if (name === "orientation" || name === "role") {
|
|
147
|
+
this.syncOrientationAria();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
ensureDefaults() {
|
|
151
|
+
if (!this.hasAttribute("role")) {
|
|
152
|
+
this.setAttribute("role", "separator");
|
|
153
|
+
}
|
|
154
|
+
this.syncOrientationAria();
|
|
155
|
+
}
|
|
156
|
+
syncOrientationAria() {
|
|
157
|
+
if (this.getAttribute("role") !== "separator") {
|
|
158
|
+
this.removeAttribute("aria-orientation");
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this.setAttribute("aria-orientation", this.orientation);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const definitions = [
|
|
165
|
+
["ui-stack", UIStackElement],
|
|
166
|
+
["ui-inline", UIInlineElement],
|
|
167
|
+
["ui-cluster", UIClusterElement],
|
|
168
|
+
["ui-grid", UIGridElement],
|
|
169
|
+
["ui-center", UICenterElement],
|
|
170
|
+
["ui-separator", UISeparatorElement]
|
|
171
|
+
];
|
|
172
|
+
for (const [tag, constructor] of definitions) {
|
|
173
|
+
if (!customElements.get(tag)) {
|
|
174
|
+
customElements.define(tag, constructor);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function registerLayoutPrimitives() {
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
registerLayoutPrimitives
|
|
182
|
+
};
|
package/layout.css
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* Unlayered: isolation contract (hard guarantees). */
|
|
2
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator),
|
|
3
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *,
|
|
4
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::before,
|
|
5
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) {
|
|
10
|
+
all: revert;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
margin: 0;
|
|
13
|
+
font-family: var(--ui-font-family-sans);
|
|
14
|
+
font-size: var(--ui-font-size-md);
|
|
15
|
+
line-height: var(--ui-line-height-md);
|
|
16
|
+
color: var(--ui-text-primary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator)[data-ui-inherit-typography] {
|
|
20
|
+
font-family: inherit;
|
|
21
|
+
font-size: inherit;
|
|
22
|
+
line-height: inherit;
|
|
23
|
+
font-weight: inherit;
|
|
24
|
+
color: inherit;
|
|
25
|
+
direction: inherit;
|
|
26
|
+
writing-mode: inherit;
|
|
27
|
+
text-orientation: inherit;
|
|
28
|
+
text-rendering: inherit;
|
|
29
|
+
font-feature-settings: inherit;
|
|
30
|
+
font-variation-settings: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@layer components {
|
|
34
|
+
ui-stack {
|
|
35
|
+
--ui-layout-gap: var(--ui-space-4, 1rem);
|
|
36
|
+
--ui-layout-align: stretch;
|
|
37
|
+
--ui-layout-justify: flex-start;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: var(--ui-layout-gap);
|
|
41
|
+
align-items: var(--ui-layout-align);
|
|
42
|
+
justify-content: var(--ui-layout-justify);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ui-stack[gap="xs"] { --ui-layout-gap: var(--ui-space-2, 0.5rem); }
|
|
46
|
+
ui-stack[gap="s"] { --ui-layout-gap: var(--ui-space-3, 0.75rem); }
|
|
47
|
+
ui-stack[gap="m"] { --ui-layout-gap: var(--ui-space-4, 1rem); }
|
|
48
|
+
ui-stack[gap="l"] { --ui-layout-gap: var(--ui-space-5, 1.5rem); }
|
|
49
|
+
ui-stack[gap="xl"] { --ui-layout-gap: var(--ui-space-6, 2rem); }
|
|
50
|
+
ui-stack[align="start"] { --ui-layout-align: flex-start; }
|
|
51
|
+
ui-stack[align="center"] { --ui-layout-align: center; }
|
|
52
|
+
ui-stack[align="end"] { --ui-layout-align: flex-end; }
|
|
53
|
+
ui-stack[justify="center"] { --ui-layout-justify: center; }
|
|
54
|
+
ui-stack[justify="end"] { --ui-layout-justify: flex-end; }
|
|
55
|
+
ui-stack[justify="between"] { --ui-layout-justify: space-between; }
|
|
56
|
+
|
|
57
|
+
ui-inline,
|
|
58
|
+
ui-cluster {
|
|
59
|
+
--ui-layout-gap: var(--ui-space-3, 0.75rem);
|
|
60
|
+
--ui-layout-align: center;
|
|
61
|
+
--ui-layout-justify: flex-start;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
align-items: var(--ui-layout-align);
|
|
65
|
+
justify-content: var(--ui-layout-justify);
|
|
66
|
+
gap: var(--ui-layout-gap);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
ui-inline[wrap="nowrap"] { flex-wrap: nowrap; }
|
|
70
|
+
ui-inline[gap="xs"],
|
|
71
|
+
ui-cluster[gap="xs"] { --ui-layout-gap: var(--ui-space-2, 0.5rem); }
|
|
72
|
+
ui-inline[gap="s"],
|
|
73
|
+
ui-cluster[gap="s"] { --ui-layout-gap: var(--ui-space-3, 0.75rem); }
|
|
74
|
+
ui-inline[gap="m"],
|
|
75
|
+
ui-cluster[gap="m"] { --ui-layout-gap: var(--ui-space-4, 1rem); }
|
|
76
|
+
|
|
77
|
+
ui-grid {
|
|
78
|
+
--ui-grid-gap: var(--ui-space-4, 1rem);
|
|
79
|
+
--ui-grid-min: 16rem;
|
|
80
|
+
display: grid;
|
|
81
|
+
gap: var(--ui-grid-gap);
|
|
82
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--ui-grid-min), 1fr));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ui-grid[gap="xs"] { --ui-grid-gap: var(--ui-space-2, 0.5rem); }
|
|
86
|
+
ui-grid[gap="s"] { --ui-grid-gap: var(--ui-space-3, 0.75rem); }
|
|
87
|
+
ui-grid[gap="m"] { --ui-grid-gap: var(--ui-space-4, 1rem); }
|
|
88
|
+
ui-grid[gap="l"] { --ui-grid-gap: var(--ui-space-5, 1.5rem); }
|
|
89
|
+
ui-grid[min="sm"] { --ui-grid-min: 12rem; }
|
|
90
|
+
ui-grid[min="md"] { --ui-grid-min: 16rem; }
|
|
91
|
+
ui-grid[min="lg"] { --ui-grid-min: 20rem; }
|
|
92
|
+
|
|
93
|
+
ui-center {
|
|
94
|
+
--ui-center-measure: 65ch;
|
|
95
|
+
--ui-center-gutters: var(--ui-space-4, 1rem);
|
|
96
|
+
display: block;
|
|
97
|
+
max-inline-size: var(--ui-center-measure);
|
|
98
|
+
margin-inline: auto;
|
|
99
|
+
padding-inline: var(--ui-center-gutters);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
ui-center[measure="narrow"] { --ui-center-measure: 45ch; }
|
|
103
|
+
ui-center[measure="wide"] { --ui-center-measure: 80ch; }
|
|
104
|
+
ui-center[gutters="s"] { --ui-center-gutters: var(--ui-space-3, 0.75rem); }
|
|
105
|
+
ui-center[gutters="m"] { --ui-center-gutters: var(--ui-space-4, 1rem); }
|
|
106
|
+
ui-center[gutters="l"] { --ui-center-gutters: var(--ui-space-5, 1.5rem); }
|
|
107
|
+
|
|
108
|
+
ui-separator {
|
|
109
|
+
--ui-separator-color: var(--ui-border-default, #d0d5dd);
|
|
110
|
+
--ui-separator-space: var(--ui-space-4, 1rem);
|
|
111
|
+
display: block;
|
|
112
|
+
margin: 0;
|
|
113
|
+
border: 0;
|
|
114
|
+
border-block-start: 1px solid var(--ui-separator-color);
|
|
115
|
+
padding: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ui-separator[orientation="vertical"] {
|
|
119
|
+
inline-size: 1px;
|
|
120
|
+
block-size: 100%;
|
|
121
|
+
border-block-start: 0;
|
|
122
|
+
border-inline-start: 1px solid var(--ui-separator-color);
|
|
123
|
+
}
|
|
124
|
+
}
|
package/loader/cdn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/cjs/loader.cjs.js');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/cjs/loader.cjs.js');
|