@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
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var manager = require('./manager-BOpVXb92.js');
|
|
5
|
+
var events = require('./events-TcQIzpNv.js');
|
|
6
|
+
|
|
7
|
+
const uiDialogCss = () => `:host{display:block}:host:not([open]){display:none}:host dialog{--ui-dialog-duration:var(--ui-motion-base);position:fixed;inset:var(--ui-space-4);width:min(100%, 440px);max-width:min(100%, 440px);margin:auto;padding:var(--ui-space-4);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-dialog);box-shadow:var(--ui-shadow-dialog);visibility:hidden;pointer-events:none;opacity:0;transform:scale(0.96);transition:opacity var(--ui-dialog-duration) var(--ui-motion-ease), transform var(--ui-dialog-duration) var(--ui-motion-ease), visibility var(--ui-dialog-duration), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]{visibility:visible;pointer-events:auto;opacity:1;transform:scale(1);animation:ui-dialog-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-enter{from{opacity:0;transform:scale(0.96)}}:host dialog::backdrop{background-color:transparent;transition:background-color var(--ui-dialog-duration) var(--ui-motion-ease), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]::backdrop{background-color:var(--ui-overlay-backdrop);animation:ui-dialog-backdrop-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-backdrop-enter{from{background-color:transparent}}`;
|
|
8
|
+
|
|
9
|
+
const UIDialog = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
get host() { return index.getElement(this); }
|
|
14
|
+
open = false;
|
|
15
|
+
defaultOpen = false;
|
|
16
|
+
modal = true;
|
|
17
|
+
dismissible = true;
|
|
18
|
+
internalOpen = false;
|
|
19
|
+
overlayId = `ui-dialog-${Math.random().toString(36).slice(2, 11)}`;
|
|
20
|
+
dialogRef;
|
|
21
|
+
syncFromProp() {
|
|
22
|
+
this.internalOpen = this.open;
|
|
23
|
+
}
|
|
24
|
+
syncOpen() {
|
|
25
|
+
if (this.dialogRef) {
|
|
26
|
+
if (this.internalOpen) {
|
|
27
|
+
this.dialogRef.showModal();
|
|
28
|
+
manager.openOverlay({
|
|
29
|
+
id: this.overlayId,
|
|
30
|
+
modal: this.modal,
|
|
31
|
+
element: this.host,
|
|
32
|
+
dismissible: this.dismissible,
|
|
33
|
+
requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.dialogRef.close();
|
|
38
|
+
manager.closeOverlay(this.overlayId);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
componentDidLoad() {
|
|
43
|
+
this.syncFromProp();
|
|
44
|
+
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
45
|
+
this.dialogRef?.addEventListener('close', this.onDialogClose);
|
|
46
|
+
this.syncOpen();
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
this.dialogRef?.removeEventListener('close', this.onDialogClose);
|
|
50
|
+
manager.closeOverlay(this.overlayId);
|
|
51
|
+
}
|
|
52
|
+
componentDidUpdate() {
|
|
53
|
+
this.syncOpen();
|
|
54
|
+
}
|
|
55
|
+
handleRequestClose(reason, trigger) {
|
|
56
|
+
this.internalOpen = false;
|
|
57
|
+
events.dispatchDetail(this.host, 'close', {
|
|
58
|
+
open: false,
|
|
59
|
+
reason: reason,
|
|
60
|
+
trigger: trigger,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
onDialogClose = () => {
|
|
64
|
+
if (this.internalOpen) {
|
|
65
|
+
this.internalOpen = false;
|
|
66
|
+
manager.closeOverlay(this.overlayId);
|
|
67
|
+
events.dispatchDetail(this.host, 'close', {
|
|
68
|
+
open: false,
|
|
69
|
+
reason: 'programmatic',
|
|
70
|
+
trigger: 'programmatic',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
onKeydown = (e) => {
|
|
75
|
+
if (e.key === 'Escape') {
|
|
76
|
+
manager.requestTopOverlayClose('escape', 'keyboard');
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
render() {
|
|
80
|
+
return (index.h(index.Host, { key: '2a2fcdfa1e3fac5eb3c0e3d6748cebdf388c216d', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, index.h("dialog", { key: 'c3eef2bb3bec77fa518269fce38c19c2ededda49', ref: (el) => (this.dialogRef = el), open: this.internalOpen }, index.h("slot", { key: '9ae5c30d57096184ec287fd9dd134ff566b9fd39' }))));
|
|
81
|
+
}
|
|
82
|
+
static get watchers() { return {
|
|
83
|
+
"open": [{
|
|
84
|
+
"syncFromProp": 0
|
|
85
|
+
}],
|
|
86
|
+
"internalOpen": [{
|
|
87
|
+
"syncOpen": 0
|
|
88
|
+
}]
|
|
89
|
+
}; }
|
|
90
|
+
};
|
|
91
|
+
UIDialog.style = uiDialogCss();
|
|
92
|
+
|
|
93
|
+
exports.ui_dialog = UIDialog;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var id = require('./id-CYbKpaYr.js');
|
|
5
|
+
var events = require('./events-TcQIzpNv.js');
|
|
6
|
+
|
|
7
|
+
const uiDisclosureCss = () => `:host{display:block}::slotted([hidden]){display:none !important}`;
|
|
8
|
+
|
|
9
|
+
const UIDisclosure = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
get host() { return index.getElement(this); }
|
|
14
|
+
open = false;
|
|
15
|
+
defaultOpen = false;
|
|
16
|
+
disabled = false;
|
|
17
|
+
internalOpen = false;
|
|
18
|
+
contentId = '';
|
|
19
|
+
trigger = null;
|
|
20
|
+
content = null;
|
|
21
|
+
syncFromProp() {
|
|
22
|
+
this.internalOpen = this.open;
|
|
23
|
+
}
|
|
24
|
+
syncState() {
|
|
25
|
+
if (this.trigger) {
|
|
26
|
+
this.trigger.setAttribute('aria-expanded', String(this.internalOpen));
|
|
27
|
+
}
|
|
28
|
+
if (this.content) {
|
|
29
|
+
this.content.hidden = !this.internalOpen;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
componentDidLoad() {
|
|
33
|
+
this.resolveParts();
|
|
34
|
+
this.syncFromProp();
|
|
35
|
+
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
36
|
+
this.syncState();
|
|
37
|
+
this.trigger?.addEventListener('click', this.onTriggerClick);
|
|
38
|
+
this.trigger?.addEventListener('keydown', this.onTriggerKeydown);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.trigger?.removeEventListener('click', this.onTriggerClick);
|
|
42
|
+
this.trigger?.removeEventListener('keydown', this.onTriggerKeydown);
|
|
43
|
+
}
|
|
44
|
+
componentDidUpdate() {
|
|
45
|
+
this.syncState();
|
|
46
|
+
}
|
|
47
|
+
resolveParts() {
|
|
48
|
+
this.trigger =
|
|
49
|
+
this.host.querySelector('[data-ui-disclosure-trigger], button, [aria-controls]');
|
|
50
|
+
const controlsId = this.trigger?.getAttribute('aria-controls') ?? '';
|
|
51
|
+
if (controlsId) {
|
|
52
|
+
this.content = document.getElementById(controlsId);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const children = Array.from(this.host.children);
|
|
56
|
+
this.content = children.find((c) => c !== this.trigger) ?? null;
|
|
57
|
+
}
|
|
58
|
+
if (this.trigger && this.content) {
|
|
59
|
+
if (!this.content.id) {
|
|
60
|
+
this.content.id = id.createId('disclosure-content');
|
|
61
|
+
}
|
|
62
|
+
this.trigger.setAttribute('aria-controls', this.content.id);
|
|
63
|
+
this.contentId = this.content.id;
|
|
64
|
+
}
|
|
65
|
+
if (this.trigger instanceof HTMLButtonElement) {
|
|
66
|
+
this.trigger.disabled = this.disabled;
|
|
67
|
+
}
|
|
68
|
+
else if (this.trigger) {
|
|
69
|
+
this.trigger.setAttribute('aria-disabled', String(this.disabled));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
setOpen(next, action) {
|
|
73
|
+
if (this.internalOpen === next)
|
|
74
|
+
return;
|
|
75
|
+
this.internalOpen = next;
|
|
76
|
+
events.dispatchDetail(this.host, next ? 'open' : 'close', {
|
|
77
|
+
open: next,
|
|
78
|
+
reason: action.reason,
|
|
79
|
+
trigger: action.trigger,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
onTriggerClick = (e) => {
|
|
83
|
+
if (this.disabled) {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.setOpen(!this.internalOpen, { reason: 'action', trigger: events.eventToTrigger(e) });
|
|
88
|
+
};
|
|
89
|
+
onTriggerKeydown = (e) => {
|
|
90
|
+
if (this.disabled || !events.isActivationKey(e))
|
|
91
|
+
return;
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
|
|
94
|
+
};
|
|
95
|
+
render() {
|
|
96
|
+
return (index.h(index.Host, { key: '433d2a0f6efe939e1a1ae60e27464139571004db' }, index.h("slot", { key: '7533ae794a7ce8be044c2ff0b5d3d1b72c01575c' })));
|
|
97
|
+
}
|
|
98
|
+
static get watchers() { return {
|
|
99
|
+
"open": [{
|
|
100
|
+
"syncFromProp": 0
|
|
101
|
+
}],
|
|
102
|
+
"internalOpen": [{
|
|
103
|
+
"syncState": 0
|
|
104
|
+
}]
|
|
105
|
+
}; }
|
|
106
|
+
};
|
|
107
|
+
UIDisclosure.style = uiDisclosureCss();
|
|
108
|
+
|
|
109
|
+
exports.ui_disclosure = UIDisclosure;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
|
|
5
|
+
const uiFloatingActionButtonCss = () => `:host{position:fixed;inset-block-end:calc( var(--ui-floating-action-button-bottom, var(--ui-space-6, 1.5rem)) + env(safe-area-inset-bottom) );inset-inline-end:var(--ui-floating-action-button-inline-end, var(--ui-space-5, 1.25rem));inline-size:var(--ui-floating-action-button-size, 56px);block-size:var(--ui-floating-action-button-size, 56px);display:inline-flex;z-index:var(--ui-floating-action-button-z-index, 100)}button{appearance:none;inline-size:100%;block-size:100%;border:none;border-radius:999px;margin:0;padding:0;display:inline-flex;align-items:center;justify-content:center;background:var(--ui-floating-action-button-bg, var(--ui-accent-solid));color:var(--ui-floating-action-button-color, var(--ui-text-on-accent));box-shadow:var( --ui-floating-action-button-shadow, 0 4px 12px color-mix(in srgb, var(--ui-accent-solid) 40%, transparent) );cursor:pointer;transition:background-color var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease), transform var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease), box-shadow var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease)}button:hover:enabled{background:var(--ui-floating-action-button-hover-bg, var(--ui-accent-hover));box-shadow:var( --ui-floating-action-button-hover-shadow, 0 6px 16px color-mix(in srgb, var(--ui-accent-solid) 50%, transparent) )}button:active:enabled{transform:scale(var(--ui-floating-action-button-active-scale, 0.94))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-floating-action-button-icon-size, 24px);block-size:var(--ui-floating-action-button-icon-size, 24px);flex-shrink:0}@media (min-width: 768px){:host([mobile-only]){display:none}}`;
|
|
6
|
+
|
|
7
|
+
const UIFloatingActionButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
disabled = false;
|
|
12
|
+
mobileOnly = false;
|
|
13
|
+
label = '';
|
|
14
|
+
render() {
|
|
15
|
+
return (index.h(index.Host, { key: '4b5b5eb530e4ab424e1189cff83d697f28432d84', "data-disabled": this.disabled ? '' : undefined }, index.h("button", { key: 'f8a4b8ac90bf306434b2b905030b46c1fcbcb000', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, index.h("slot", { key: '500d0606ea7166669f104e42813591395fc81c3f' }))));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
UIFloatingActionButton.style = uiFloatingActionButtonCss();
|
|
19
|
+
|
|
20
|
+
exports.ui_floating_action_button = UIFloatingActionButton;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var id = require('./id-CYbKpaYr.js');
|
|
5
|
+
|
|
6
|
+
const uiFormFieldCss = () => `:host{display:grid;gap:var(--ui-space-2);color:var(--ui-text-primary)}::slotted(label){color:var(--ui-text-secondary);font-size:0.95rem}::slotted([data-slot='help']){color:var(--ui-text-muted);font-size:0.875rem}::slotted([data-slot='error']),::slotted([role='alert']){color:var(--ui-accent-active);font-size:0.875rem}`;
|
|
7
|
+
|
|
8
|
+
const UIFormField = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
get host() { return index.getElement(this); }
|
|
13
|
+
invalid = false;
|
|
14
|
+
disabled = false;
|
|
15
|
+
required = false;
|
|
16
|
+
componentDidLoad() {
|
|
17
|
+
this.wire();
|
|
18
|
+
}
|
|
19
|
+
componentDidUpdate() {
|
|
20
|
+
this.wire();
|
|
21
|
+
}
|
|
22
|
+
wire() {
|
|
23
|
+
const label = this.host.querySelector('label');
|
|
24
|
+
const input = this.host.querySelector('input, textarea, select');
|
|
25
|
+
const help = this.host.querySelector('[data-slot="help"]');
|
|
26
|
+
const error = this.host.querySelector('[data-slot="error"], [role="alert"]');
|
|
27
|
+
if (!input)
|
|
28
|
+
return;
|
|
29
|
+
if (!input.id) {
|
|
30
|
+
input.id = id.createId('form-field-input');
|
|
31
|
+
}
|
|
32
|
+
if (label && !label.getAttribute('for')) {
|
|
33
|
+
label.setAttribute('for', input.id);
|
|
34
|
+
}
|
|
35
|
+
const describedIds = [];
|
|
36
|
+
if (help) {
|
|
37
|
+
if (!help.id)
|
|
38
|
+
help.id = id.createId('form-field-help');
|
|
39
|
+
describedIds.push(help.id);
|
|
40
|
+
}
|
|
41
|
+
if (error) {
|
|
42
|
+
if (!error.id)
|
|
43
|
+
error.id = id.createId('form-field-error');
|
|
44
|
+
describedIds.push(error.id);
|
|
45
|
+
}
|
|
46
|
+
if (describedIds.length) {
|
|
47
|
+
input.setAttribute('aria-describedby', describedIds.join(' '));
|
|
48
|
+
}
|
|
49
|
+
input.disabled = this.disabled;
|
|
50
|
+
input.required = this.required;
|
|
51
|
+
input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return (index.h(index.Host, { key: 'f2eb3a7bf493c0630ef27ee21fca1ffee94be536', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, index.h("slot", { key: 'f5f30e388ed9473ee50103f12527a1dd9cfb0b0b' })));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
UIFormField.style = uiFormFieldCss();
|
|
58
|
+
|
|
59
|
+
exports.ui_form_field = UIFormField;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
|
|
5
|
+
const uiIconButtonCss = () => `:host{display:inline-flex;color:var(--ui-text-secondary)}button{appearance:none;inline-size:var(--ui-icon-button-size, 2.5rem);block-size:var(--ui-icon-button-size, 2.5rem);min-inline-size:var(--ui-icon-button-size, 2.5rem);min-block-size:var(--ui-icon-button-size, 2.5rem);padding:0;margin:0;border:1px solid transparent;border-radius:var(--ui-icon-button-radius, var(--ui-radius-2));background:var(--ui-icon-button-bg, transparent);color:inherit;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease)}:host([size='sm']) button{inline-size:var(--ui-icon-button-size-sm, 2rem);block-size:var(--ui-icon-button-size-sm, 2rem);min-inline-size:var(--ui-icon-button-size-sm, 2rem);min-block-size:var(--ui-icon-button-size-sm, 2rem)}:host([size='lg']) button{inline-size:var(--ui-icon-button-size-lg, 2.75rem);block-size:var(--ui-icon-button-size-lg, 2.75rem);min-inline-size:var(--ui-icon-button-size-lg, 2.75rem);min-block-size:var(--ui-icon-button-size-lg, 2.75rem)}:host([variant='outline']) button{border-color:var(--ui-icon-button-border, var(--ui-border-default));background:var(--ui-icon-button-outline-bg, var(--ui-surface-default));color:var(--ui-icon-button-outline-color, var(--ui-text-primary))}:host([variant='solid']) button{background:var(--ui-icon-button-solid-bg, var(--ui-accent-solid));color:var(--ui-icon-button-solid-color, var(--ui-text-on-accent));box-shadow:var( --ui-icon-button-solid-shadow, 0 1px 2px color-mix(in srgb, var(--ui-accent-solid) 18%, transparent) )}button:hover:enabled{background:var(--ui-icon-button-hover-bg, var(--ui-surface-muted));color:var(--ui-icon-button-hover-color, var(--ui-text-primary))}:host([variant='outline']) button:hover:enabled{border-color:var(--ui-icon-button-hover-border, var(--ui-border-strong))}:host([variant='solid']) button:hover:enabled{background:var(--ui-icon-button-solid-hover-bg, var(--ui-accent-hover))}button:active:enabled{transform:scale(var(--ui-icon-button-active-scale, 0.96))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-icon-button-icon-size, 1.125rem);block-size:var(--ui-icon-button-icon-size, 1.125rem);flex-shrink:0;stroke-width:var(--ui-icon-button-icon-stroke-width, 1.75)}`;
|
|
6
|
+
|
|
7
|
+
const UIIconButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
disabled = false;
|
|
12
|
+
label = '';
|
|
13
|
+
size = 'md';
|
|
14
|
+
variant = 'ghost';
|
|
15
|
+
render() {
|
|
16
|
+
return (index.h(index.Host, { key: '8f4c7271505fa061da954f1e989fc526dc980407', "data-disabled": this.disabled ? '' : undefined }, index.h("button", { key: 'c56009d4028a557cd6f7f19833b0af6412b90c1c', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, index.h("slot", { key: 'ac2f201b0fbedb23106f72135ff8c3b6f25fca60' }))));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
UIIconButton.style = uiIconButtonCss();
|
|
20
|
+
|
|
21
|
+
exports.ui_icon_button = UIIconButton;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var events = require('./events-TcQIzpNv.js');
|
|
5
|
+
|
|
6
|
+
const uiInputCss = () => `:host{display:inline-flex;color:var(--ui-text-primary)}::slotted(input){width:100%;appearance:none;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-default);color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;transition:border-color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), background-color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(input:hover:not(:focus):not(:disabled)){border-color:var(--ui-border-strong)}::slotted(input:focus){border-color:var(--ui-focus-ring);box-shadow:0 0 0 3px var(--ui-accent-soft)}:host([data-invalid='true'])::slotted(input),::slotted(input[aria-invalid='true']){border-color:var(--ui-accent-active)}::slotted(input:disabled){background:var(--ui-surface-muted);color:var(--ui-text-muted);cursor:not-allowed}::slotted(input:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}`;
|
|
7
|
+
|
|
8
|
+
const UIInput = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
get host() { return index.getElement(this); }
|
|
13
|
+
value = '';
|
|
14
|
+
defaultValue = '';
|
|
15
|
+
disabled = false;
|
|
16
|
+
invalid = false;
|
|
17
|
+
readOnly = false;
|
|
18
|
+
internalValue = '';
|
|
19
|
+
slotRef;
|
|
20
|
+
syncFromProp() {
|
|
21
|
+
this.internalValue = this.value;
|
|
22
|
+
}
|
|
23
|
+
syncToInput() {
|
|
24
|
+
const input = this.getInput();
|
|
25
|
+
if (!input)
|
|
26
|
+
return;
|
|
27
|
+
this.host.dataset.invalid = this.invalid ? 'true' : '';
|
|
28
|
+
input.value = this.internalValue;
|
|
29
|
+
input.defaultValue = this.defaultValue;
|
|
30
|
+
input.disabled = this.disabled;
|
|
31
|
+
input.readOnly = this.readOnly;
|
|
32
|
+
input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
|
|
33
|
+
}
|
|
34
|
+
componentDidLoad() {
|
|
35
|
+
this.syncFromProp();
|
|
36
|
+
this.slotRef?.addEventListener('slotchange', () => this.syncToInput());
|
|
37
|
+
this.syncToInput();
|
|
38
|
+
const input = this.getInput();
|
|
39
|
+
input?.addEventListener('input', this.onInput);
|
|
40
|
+
input?.addEventListener('change', this.onChange);
|
|
41
|
+
}
|
|
42
|
+
disconnectedCallback() {
|
|
43
|
+
const input = this.getInput();
|
|
44
|
+
input?.removeEventListener('input', this.onInput);
|
|
45
|
+
input?.removeEventListener('change', this.onChange);
|
|
46
|
+
}
|
|
47
|
+
componentDidUpdate() {
|
|
48
|
+
this.syncToInput();
|
|
49
|
+
}
|
|
50
|
+
getInput() {
|
|
51
|
+
const slot = this.host.shadowRoot?.querySelector('slot');
|
|
52
|
+
const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
|
|
53
|
+
return nodes.find((el) => el.tagName === 'INPUT') ?? null;
|
|
54
|
+
}
|
|
55
|
+
onInput = (e) => {
|
|
56
|
+
const input = e.target;
|
|
57
|
+
if (!input)
|
|
58
|
+
return;
|
|
59
|
+
this.internalValue = input.value;
|
|
60
|
+
events.dispatchDetail(this.host, 'input', {
|
|
61
|
+
value: this.internalValue,
|
|
62
|
+
trigger: events.eventToTrigger(e),
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
onChange = (e) => {
|
|
66
|
+
const input = this.getInput();
|
|
67
|
+
if (!input)
|
|
68
|
+
return;
|
|
69
|
+
this.internalValue = input.value;
|
|
70
|
+
events.dispatchDetail(this.host, 'change', {
|
|
71
|
+
value: this.internalValue,
|
|
72
|
+
trigger: events.eventToTrigger(e),
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
render() {
|
|
76
|
+
return (index.h(index.Host, { key: '73f518c7f12fa483d592041d185498bd91f9bb8b', "data-invalid": this.invalid ? '' : undefined }, index.h("slot", { key: '7ef93ef7c5d36ccdfa66cfb4d14f08707e9ea790', ref: (el) => (this.slotRef = el) })));
|
|
77
|
+
}
|
|
78
|
+
static get watchers() { return {
|
|
79
|
+
"value": [{
|
|
80
|
+
"syncFromProp": 0
|
|
81
|
+
}],
|
|
82
|
+
"internalValue": [{
|
|
83
|
+
"syncToInput": 0
|
|
84
|
+
}],
|
|
85
|
+
"defaultValue": [{
|
|
86
|
+
"syncToInput": 0
|
|
87
|
+
}],
|
|
88
|
+
"disabled": [{
|
|
89
|
+
"syncToInput": 0
|
|
90
|
+
}],
|
|
91
|
+
"invalid": [{
|
|
92
|
+
"syncToInput": 0
|
|
93
|
+
}],
|
|
94
|
+
"readOnly": [{
|
|
95
|
+
"syncToInput": 0
|
|
96
|
+
}]
|
|
97
|
+
}; }
|
|
98
|
+
};
|
|
99
|
+
UIInput.style = uiInputCss();
|
|
100
|
+
|
|
101
|
+
exports.ui_input = UIInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
|
|
5
|
+
const uiMenuItemCss = () => `:host{display:block;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}:host(:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}:host([aria-disabled='true']),:host([disabled]){opacity:0.6;cursor:not-allowed}`;
|
|
6
|
+
|
|
7
|
+
const UIMenuItem = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
disabled = false;
|
|
12
|
+
value = '';
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, { key: '485ac24af80b72a751f6fc13a084847ba0f7605e', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, index.h("slot", { key: 'b2bde48d9b819b0e55fbe00c2939ccd44f63bc15' })));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
UIMenuItem.style = uiMenuItemCss();
|
|
18
|
+
|
|
19
|
+
exports.ui_menu_item = UIMenuItem;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var events = require('./events-TcQIzpNv.js');
|
|
5
|
+
|
|
6
|
+
const uiMenuCss = () => `:host{display:flex;flex-direction:column;min-width:12rem;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}::slotted(ui-menu-item){display:block;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(ui-menu-item:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}::slotted(ui-menu-item[aria-disabled='true']),::slotted(ui-menu-item[disabled]){opacity:0.6;cursor:not-allowed}`;
|
|
7
|
+
|
|
8
|
+
const UIMenu = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
}
|
|
12
|
+
get host() { return index.getElement(this); }
|
|
13
|
+
open = false;
|
|
14
|
+
defaultOpen = false;
|
|
15
|
+
internalOpen = false;
|
|
16
|
+
syncFromProp() {
|
|
17
|
+
this.internalOpen = this.open;
|
|
18
|
+
}
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.syncFromProp();
|
|
21
|
+
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
22
|
+
this.host.addEventListener('click', this.onItemClick);
|
|
23
|
+
this.host.addEventListener('keydown', this.onKeydown);
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
this.host.removeEventListener('click', this.onItemClick);
|
|
27
|
+
this.host.removeEventListener('keydown', this.onKeydown);
|
|
28
|
+
}
|
|
29
|
+
getItems() {
|
|
30
|
+
return Array.from(this.host.querySelectorAll('ui-menu-item'));
|
|
31
|
+
}
|
|
32
|
+
isItemDisabled(item) {
|
|
33
|
+
return (item.getAttribute('aria-disabled') === 'true' ||
|
|
34
|
+
item.hasAttribute('disabled') ||
|
|
35
|
+
item.getAttribute('disabled') === 'true' ||
|
|
36
|
+
item.disabled === true);
|
|
37
|
+
}
|
|
38
|
+
onItemClick = (e) => {
|
|
39
|
+
const item = e.target.closest?.('ui-menu-item');
|
|
40
|
+
if (!item || item.getRootNode() !== this.host.getRootNode())
|
|
41
|
+
return;
|
|
42
|
+
if (this.isItemDisabled(item))
|
|
43
|
+
return;
|
|
44
|
+
const value = item.getAttribute('value') ?? item.getAttribute('data-value') ?? '';
|
|
45
|
+
events.dispatchDetail(this.host, 'select', { value, trigger: events.eventToTrigger(e) });
|
|
46
|
+
events.dispatchDetail(this.host, 'close', {
|
|
47
|
+
open: false,
|
|
48
|
+
reason: 'action',
|
|
49
|
+
trigger: events.eventToTrigger(e),
|
|
50
|
+
});
|
|
51
|
+
this.internalOpen = false;
|
|
52
|
+
};
|
|
53
|
+
onKeydown = (e) => {
|
|
54
|
+
const items = this.getItems().filter((i) => !this.isItemDisabled(i));
|
|
55
|
+
if (items.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const target = e.target.closest?.('ui-menu-item');
|
|
58
|
+
const currentIndex = target && target instanceof HTMLElement ? items.indexOf(target) : -1;
|
|
59
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
if (target && currentIndex >= 0) {
|
|
62
|
+
const value = target.getAttribute('value') ?? target.getAttribute('data-value') ?? '';
|
|
63
|
+
events.dispatchDetail(this.host, 'select', { value, trigger: 'keyboard' });
|
|
64
|
+
events.dispatchDetail(this.host, 'close', {
|
|
65
|
+
open: false,
|
|
66
|
+
reason: 'action',
|
|
67
|
+
trigger: 'keyboard',
|
|
68
|
+
});
|
|
69
|
+
this.internalOpen = false;
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
const nextIndex = e.key === 'ArrowDown'
|
|
76
|
+
? currentIndex < 0
|
|
77
|
+
? 0
|
|
78
|
+
: Math.min(currentIndex + 1, items.length - 1)
|
|
79
|
+
: currentIndex <= 0
|
|
80
|
+
? items.length - 1
|
|
81
|
+
: currentIndex - 1;
|
|
82
|
+
items[nextIndex].focus();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
render() {
|
|
86
|
+
return (index.h(index.Host, { key: 'f06ad0f8c09060495757ced2da095817409720b7', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, index.h("slot", { key: 'd504fd3c33894d0e464b957ce67c75fe8a24899c' })));
|
|
87
|
+
}
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"open": [{
|
|
90
|
+
"syncFromProp": 0
|
|
91
|
+
}]
|
|
92
|
+
}; }
|
|
93
|
+
};
|
|
94
|
+
UIMenu.style = uiMenuCss();
|
|
95
|
+
|
|
96
|
+
exports.ui_menu = UIMenu;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-D07f6BOw.js');
|
|
4
|
+
var manager = require('./manager-BOpVXb92.js');
|
|
5
|
+
var events = require('./events-TcQIzpNv.js');
|
|
6
|
+
|
|
7
|
+
const uiPopoverCss = () => `:host{padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg);max-width:min(20rem, 90vw)}`;
|
|
8
|
+
|
|
9
|
+
const UIPopover = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
get host() { return index.getElement(this); }
|
|
14
|
+
open = false;
|
|
15
|
+
defaultOpen = false;
|
|
16
|
+
internalOpen = false;
|
|
17
|
+
overlayId = `ui-popover-${Math.random().toString(36).slice(2, 11)}`;
|
|
18
|
+
syncFromProp() {
|
|
19
|
+
this.internalOpen = this.open;
|
|
20
|
+
}
|
|
21
|
+
onOpenChange() {
|
|
22
|
+
this.syncOverlay();
|
|
23
|
+
if (this.internalOpen) {
|
|
24
|
+
events.dispatchDetail(this.host, 'open', {
|
|
25
|
+
open: true,
|
|
26
|
+
reason: 'programmatic',
|
|
27
|
+
trigger: 'programmatic',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
events.dispatchDetail(this.host, 'close', {
|
|
32
|
+
open: false,
|
|
33
|
+
reason: 'programmatic',
|
|
34
|
+
trigger: 'programmatic',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
syncOverlay() {
|
|
39
|
+
if (this.internalOpen) {
|
|
40
|
+
manager.openOverlay({
|
|
41
|
+
id: this.overlayId,
|
|
42
|
+
modal: false,
|
|
43
|
+
element: this.host,
|
|
44
|
+
dismissible: true,
|
|
45
|
+
requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
manager.closeOverlay(this.overlayId);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
componentDidLoad() {
|
|
53
|
+
this.syncFromProp();
|
|
54
|
+
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
55
|
+
this.host.addEventListener('keydown', this.onKeydown);
|
|
56
|
+
this.syncOverlay();
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
this.host.removeEventListener('keydown', this.onKeydown);
|
|
60
|
+
manager.closeOverlay(this.overlayId);
|
|
61
|
+
}
|
|
62
|
+
componentDidUpdate() {
|
|
63
|
+
this.syncOverlay();
|
|
64
|
+
}
|
|
65
|
+
handleRequestClose(reason, trigger) {
|
|
66
|
+
this.internalOpen = false;
|
|
67
|
+
events.dispatchDetail(this.host, 'close', {
|
|
68
|
+
open: false,
|
|
69
|
+
reason: reason,
|
|
70
|
+
trigger: trigger,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
onKeydown = (e) => {
|
|
74
|
+
if (e.key === 'Escape') {
|
|
75
|
+
manager.requestTopOverlayClose('escape', 'keyboard');
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
render() {
|
|
79
|
+
return (index.h(index.Host, { key: '121482cf2fe9ba972ae6b902568389790b9accaa', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, index.h("slot", { key: '095ce0c147ed8c8411114563c9efcb5fe775fcae' })));
|
|
80
|
+
}
|
|
81
|
+
static get watchers() { return {
|
|
82
|
+
"open": [{
|
|
83
|
+
"syncFromProp": 0
|
|
84
|
+
}],
|
|
85
|
+
"internalOpen": [{
|
|
86
|
+
"onOpenChange": 0
|
|
87
|
+
}]
|
|
88
|
+
}; }
|
|
89
|
+
};
|
|
90
|
+
UIPopover.style = uiPopoverCss();
|
|
91
|
+
|
|
92
|
+
exports.ui_popover = UIPopover;
|