@threadlabs/looma 0.1.22 → 0.1.24
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/dist/chunk-HNFCGIBP.js +8 -0
- package/dist/{chunk-NIPNHZ5W.js → chunk-IMHSPETJ.js} +65 -31
- package/dist/chunk-NB6DBRXQ.js +323 -0
- package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
- package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
- package/dist/cjs/icons-BAdjrnhS.js +680 -0
- package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/looma.cjs.js +2 -2
- package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +2 -2
- package/dist/cjs/ui-avatar-group.cjs.entry.js +10 -18
- package/dist/cjs/ui-avatar.cjs.entry.js +3 -3
- package/dist/cjs/ui-badge.cjs.entry.js +3 -3
- package/dist/cjs/ui-button.cjs.entry.js +16 -5
- package/dist/cjs/ui-callout.cjs.entry.js +27 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +14 -8
- package/dist/cjs/ui-chip.cjs.entry.js +19 -0
- package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
- package/dist/cjs/ui-dialog.cjs.entry.js +46 -10
- package/dist/cjs/ui-disclosure.cjs.entry.js +10 -7
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-form-field.cjs.entry.js +61 -6
- package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-input.cjs.entry.js +11 -6
- package/dist/cjs/ui-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/ui-menu.cjs.entry.js +16 -11
- package/dist/cjs/ui-popover.cjs.entry.js +12 -9
- package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/ui-radio.cjs.entry.js +18 -9
- package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
- package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
- package/dist/cjs/ui-select.cjs.entry.js +15 -7
- package/dist/cjs/ui-switch.cjs.entry.js +20 -11
- package/dist/cjs/ui-tabs.cjs.entry.js +11 -10
- package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
- package/dist/cjs/ui-toast-region.cjs.entry.js +31 -20
- package/dist/cjs/ui-tooltip.cjs.entry.js +63 -23
- package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
- package/dist/cjs/ui-tree-item.cjs.entry.js +57 -616
- package/dist/cjs/ui-tree.cjs.entry.js +198 -14
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
- package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
- package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
- package/dist/collection/components/ui-badge/ui-badge.css +64 -48
- package/dist/collection/components/ui-badge/ui-badge.js +1 -1
- package/dist/collection/components/ui-button/ui-button.css +36 -26
- package/dist/collection/components/ui-button/ui-button.js +14 -3
- package/dist/collection/components/ui-callout/ui-callout.css +74 -0
- package/dist/collection/components/ui-callout/ui-callout.js +59 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
- package/dist/collection/components/ui-chip/ui-chip.css +43 -0
- package/dist/collection/components/ui-chip/ui-chip.js +45 -0
- package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
- package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.css +8 -6
- package/dist/collection/components/ui-input/ui-input.js +11 -7
- package/dist/collection/components/ui-menu/ui-menu.css +12 -23
- package/dist/collection/components/ui-menu/ui-menu.js +16 -12
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
- package/dist/collection/components/ui-popover/ui-popover.css +14 -5
- package/dist/collection/components/ui-popover/ui-popover.js +12 -10
- package/dist/collection/components/ui-radio/ui-radio.js +25 -12
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
- package/dist/collection/components/ui-select/ui-select.css +8 -6
- package/dist/collection/components/ui-select/ui-select.js +17 -11
- package/dist/collection/components/ui-switch/ui-switch.js +22 -14
- package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
- package/dist/collection/components/ui-textarea/ui-textarea.css +7 -6
- package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +115 -25
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.css +2 -1
- package/dist/collection/components/ui-tree/ui-tree.js +216 -12
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +84 -25
- package/dist/collection/field/combobox.js +4 -0
- package/dist/collection/field/valibot.js +5 -0
- package/dist/collection/field/validation.js +62 -0
- package/dist/collection/icons.js +6 -1
- package/dist/collection/overlay/manager.js +6 -7
- package/dist/collection/utils/controlled-state.js +4 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-Bh_1GxOD.js +1 -0
- package/dist/components/p-Bk55QiUK.js +1 -0
- package/dist/components/p-BnGhGgTH.js +1 -0
- package/dist/components/p-C-0syqXZ.js +1 -0
- package/dist/components/p-CoFximGM.js +13 -0
- package/dist/components/p-DIGcRYAW.js +1 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-avatar-group.js +1 -1
- package/dist/components/ui-avatar.js +1 -1
- package/dist/components/ui-badge.js +1 -1
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-callout.d.ts +11 -0
- package/dist/components/ui-callout.js +1 -0
- package/dist/components/ui-checkbox.js +1 -1
- package/dist/components/ui-chip.d.ts +11 -0
- package/dist/components/ui-chip.js +1 -0
- package/dist/components/ui-combobox.d.ts +11 -0
- package/dist/components/ui-combobox.js +1 -0
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-disclosure.js +1 -1
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-form-field.js +1 -1
- package/dist/components/ui-icon-button.js +1 -1
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-menu-item.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-radio.js +1 -1
- package/dist/components/ui-search-result-row.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/components/ui-tree-item.js +1 -13
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
- package/dist/esm/icons-CoFximGM.js +678 -0
- package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/looma.js +3 -3
- package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
- package/dist/esm/ui-affordance-scope.entry.js +2 -2
- package/dist/esm/ui-avatar-group.entry.js +10 -18
- package/dist/esm/ui-avatar.entry.js +3 -3
- package/dist/esm/ui-badge.entry.js +3 -3
- package/dist/esm/ui-button.entry.js +16 -5
- package/dist/esm/ui-callout.entry.js +25 -0
- package/dist/esm/ui-checkbox.entry.js +14 -8
- package/dist/esm/ui-chip.entry.js +17 -0
- package/dist/esm/ui-combobox.entry.js +539 -0
- package/dist/esm/ui-context-menu.entry.js +3 -3
- package/dist/esm/ui-dialog.entry.js +46 -10
- package/dist/esm/ui-disclosure.entry.js +10 -7
- package/dist/esm/ui-floating-action-button.entry.js +2 -2
- package/dist/esm/ui-form-field.entry.js +61 -6
- package/dist/esm/ui-icon-button.entry.js +2 -2
- package/dist/esm/ui-input.entry.js +11 -6
- package/dist/esm/ui-menu-item.entry.js +3 -3
- package/dist/esm/ui-menu.entry.js +16 -11
- package/dist/esm/ui-popover.entry.js +12 -9
- package/dist/esm/ui-radio-group.entry.js +2 -2
- package/dist/esm/ui-radio.entry.js +18 -9
- package/dist/esm/ui-search-result-row.entry.js +2 -2
- package/dist/esm/ui-search-shell.entry.js +2 -2
- package/dist/esm/ui-select.entry.js +15 -7
- package/dist/esm/ui-switch.entry.js +20 -11
- package/dist/esm/ui-tabs.entry.js +11 -10
- package/dist/esm/ui-textarea.entry.js +10 -6
- package/dist/esm/ui-toast-region.entry.js +31 -20
- package/dist/esm/ui-tooltip.entry.js +63 -23
- package/dist/esm/ui-top-bar.entry.js +2 -2
- package/dist/esm/ui-tree-item.entry.js +57 -616
- package/dist/esm/ui-tree.entry.js +198 -14
- package/dist/index.cjs +2012 -870
- package/dist/index.d.cts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +72 -8
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-03f44c45.entry.js +1 -0
- package/dist/looma/p-08f80207.entry.js +1 -0
- package/dist/looma/p-13f8195a.entry.js +1 -0
- package/dist/looma/{p-d273b857.entry.js → p-25e18ad6.entry.js} +1 -1
- package/dist/looma/p-2c03fa73.entry.js +1 -0
- package/dist/looma/p-314d5c7c.entry.js +1 -0
- package/dist/looma/{p-2ed7e241.entry.js → p-3ef2a21b.entry.js} +1 -1
- package/dist/looma/{p-063f5a89.entry.js → p-5a900d89.entry.js} +1 -1
- package/dist/looma/p-5fdcee1d.entry.js +1 -0
- package/dist/looma/{p-0198bb21.entry.js → p-672e3d16.entry.js} +1 -1
- package/dist/looma/p-68430534.entry.js +1 -0
- package/dist/looma/{p-2e6f791e.entry.js → p-72338f53.entry.js} +1 -1
- package/dist/looma/p-7ab661ec.entry.js +1 -0
- package/dist/looma/p-7c4a225f.entry.js +1 -0
- package/dist/looma/p-82f2fa3d.entry.js +1 -0
- package/dist/looma/p-839faf55.entry.js +1 -0
- package/dist/looma/p-8BGiMGQ0.js +2 -0
- package/dist/looma/p-8e254bc4.entry.js +1 -0
- package/dist/looma/p-8e6b1001.entry.js +1 -0
- package/dist/looma/p-920656cf.entry.js +1 -0
- package/dist/looma/p-97e8cb0e.entry.js +1 -0
- package/dist/looma/p-9d2662ca.entry.js +1 -0
- package/dist/looma/p-9e1c4020.entry.js +1 -0
- package/dist/looma/p-BnGhGgTH.js +1 -0
- package/dist/looma/p-C-0syqXZ.js +1 -0
- package/dist/looma/p-CoFximGM.js +13 -0
- package/dist/looma/{p-051f578c.entry.js → p-a63e2561.entry.js} +1 -1
- package/dist/looma/p-add67e4c.entry.js +1 -0
- package/dist/looma/p-b63f6d4f.entry.js +1 -0
- package/dist/looma/p-bd00d4e8.entry.js +1 -0
- package/dist/looma/p-cc915913.entry.js +1 -0
- package/dist/looma/p-cfba8f7c.entry.js +1 -0
- package/dist/looma/p-d56571a2.entry.js +1 -0
- package/dist/looma/{p-7e94d90d.entry.js → p-e0f241ab.entry.js} +1 -1
- package/dist/looma/p-f1750fd7.entry.js +1 -0
- package/dist/looma/p-fd1e4d22.entry.js +1 -0
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
- package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
- package/dist/types/components/ui-chip/ui-chip.d.ts +6 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
- package/dist/types/components/ui-input/ui-input.d.ts +1 -1
- package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
- package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
- package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
- package/dist/types/components/ui-select/ui-select.d.ts +3 -2
- package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +20 -2
- package/dist/types/components/ui-tree/ui-tree.d.ts +21 -1
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +13 -5
- package/dist/types/components.d.ts +366 -71
- package/dist/types/field/combobox.d.ts +46 -0
- package/dist/types/field/valibot.d.ts +7 -0
- package/dist/types/field/validation.d.ts +56 -0
- package/dist/types/icons.d.ts +5 -0
- package/dist/types/utils/controlled-state.d.ts +4 -0
- package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-3TUZ6GLW.js} +2 -2
- package/dist/ui-avatar-group.entry-XGJKN25W.js +51 -0
- package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-SN3G44HW.js} +3 -3
- package/dist/ui-badge.entry-B6WDCWJX.js +22 -0
- package/dist/ui-button.entry-AZYUELLV.js +80 -0
- package/dist/ui-callout.entry-QRPWRMPC.js +32 -0
- package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-OB6GFC4M.js} +17 -8
- package/dist/ui-chip.entry-XSNPJXX3.js +22 -0
- package/dist/ui-combobox.entry-IIMMUJF7.js +553 -0
- package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-AIULIE5Y.js} +3 -3
- package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-QSYWYHLY.js} +48 -10
- package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-3BJEYU3U.js} +13 -7
- package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-JEVNV6FI.js} +2 -2
- package/dist/ui-form-field.entry-PKSY7UU4.js +120 -0
- package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-TPX7BE7R.js} +2 -2
- package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-6NCLNW4E.js} +8 -6
- package/dist/ui-menu-item.entry-KA2K3PKV.js +22 -0
- package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-7GDO5L2T.js} +19 -11
- package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-FR6YRNK6.js} +15 -9
- package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-7QHXQSNO.js} +2 -2
- package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-YNMXKLDW.js} +21 -9
- package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-AHVVAAIO.js} +2 -2
- package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-CNBEAMEZ.js} +2 -2
- package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-TUY6TCTC.js} +13 -7
- package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-26LFI7B5.js} +23 -11
- package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-LXB62RJJ.js} +14 -10
- package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-JYGMGPX2.js} +8 -6
- package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-TOW4KZLZ.js} +29 -20
- package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-SKFNYXPH.js} +68 -25
- package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-S3YP52EA.js} +2 -2
- package/dist/ui-tree-item.entry-LWYIPYLC.js +145 -0
- package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-LXKUQFRU.js} +184 -13
- package/dist/valibot.d.ts +52 -0
- package/dist/valibot.js +7 -0
- package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
- package/editor/extensions/index.d.ts +14 -6
- package/editor/extensions/index.js +1 -1
- package/editor/index.js +1 -1
- package/editor.css +37 -20
- package/package.json +11 -3
- package/styles.css +46 -20
- package/theme-high-contrast.css +12 -0
- package/tokens.css +26 -0
- package/vue/{chunk-5KWCMTXB.js → chunk-D4AJULDE.js} +116 -17
- package/vue/editor/index.d.ts +5 -15
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +447 -115
- package/vue/index.js +7 -1
- package/dist/components/p-CEYIKqYc.js +0 -1
- package/dist/components/p-CIA4RyEp.js +0 -1
- package/dist/components/p-PM9a74r7.js +0 -1
- package/dist/looma/p-0584a051.entry.js +0 -1
- package/dist/looma/p-078f9fb8.entry.js +0 -1
- package/dist/looma/p-0f45c5f0.entry.js +0 -1
- package/dist/looma/p-11083743.entry.js +0 -1
- package/dist/looma/p-1674cda4.entry.js +0 -1
- package/dist/looma/p-1681b218.entry.js +0 -1
- package/dist/looma/p-34417499.entry.js +0 -1
- package/dist/looma/p-4b422d40.entry.js +0 -1
- package/dist/looma/p-54722713.entry.js +0 -13
- package/dist/looma/p-54c41576.entry.js +0 -1
- package/dist/looma/p-5ba9d496.entry.js +0 -1
- package/dist/looma/p-5d4713a6.entry.js +0 -1
- package/dist/looma/p-624ba086.entry.js +0 -1
- package/dist/looma/p-8d5adb17.entry.js +0 -1
- package/dist/looma/p-9194a99d.entry.js +0 -1
- package/dist/looma/p-CEeiinfk.js +0 -2
- package/dist/looma/p-PM9a74r7.js +0 -1
- package/dist/looma/p-a33522a2.entry.js +0 -1
- package/dist/looma/p-a5127c7d.entry.js +0 -1
- package/dist/looma/p-a9f46811.entry.js +0 -1
- package/dist/looma/p-b7aa4488.entry.js +0 -1
- package/dist/looma/p-caa8fc7b.entry.js +0 -1
- package/dist/looma/p-e3f99a24.entry.js +0 -1
- package/dist/looma/p-ed5abf6d.entry.js +0 -1
- package/dist/ui-avatar-group.entry-BWS7E2CM.js +0 -59
- package/dist/ui-badge.entry-2WOBVOYP.js +0 -22
- package/dist/ui-button.entry-VCGSEONK.js +0 -71
- package/dist/ui-form-field.entry-SJ6NNFXB.js +0 -67
- package/dist/ui-menu-item.entry-V3HIMR75.js +0 -22
- package/dist/ui-tree-item.entry-45RR3CMP.js +0 -385
|
@@ -5,10 +5,12 @@ import { createViewportSurface } from "../../overlay/positioning";
|
|
|
5
5
|
export class UIToastRegion {
|
|
6
6
|
host;
|
|
7
7
|
open = true;
|
|
8
|
-
internalOpen =
|
|
8
|
+
internalOpen = false;
|
|
9
9
|
surface = null;
|
|
10
|
+
contentObserver = null;
|
|
11
|
+
pendingDismiss = null;
|
|
10
12
|
syncFromProp() {
|
|
11
|
-
this.
|
|
13
|
+
this.syncContents();
|
|
12
14
|
}
|
|
13
15
|
syncSurface() {
|
|
14
16
|
if (this.internalOpen)
|
|
@@ -18,22 +20,39 @@ export class UIToastRegion {
|
|
|
18
20
|
}
|
|
19
21
|
componentDidLoad() {
|
|
20
22
|
this.surface = createViewportSurface(this.host);
|
|
21
|
-
this.
|
|
23
|
+
this.contentObserver = new MutationObserver(this.syncContents);
|
|
24
|
+
this.contentObserver.observe(this.host, { childList: true, subtree: true });
|
|
25
|
+
this.syncContents();
|
|
22
26
|
this.syncSurface();
|
|
23
27
|
this.host.addEventListener('click', this.onClick);
|
|
24
28
|
}
|
|
25
29
|
disconnectedCallback() {
|
|
26
30
|
this.host.removeEventListener('click', this.onClick);
|
|
31
|
+
this.contentObserver?.disconnect();
|
|
32
|
+
this.contentObserver = null;
|
|
27
33
|
this.surface?.destroy();
|
|
28
34
|
this.surface = null;
|
|
29
35
|
}
|
|
30
36
|
getToasts() {
|
|
31
37
|
return Array.from(this.host.querySelectorAll('[data-ui-toast]'));
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
syncContents = () => {
|
|
40
|
+
const nextOpen = this.open && this.getToasts().length > 0;
|
|
41
|
+
const wasOpen = this.internalOpen;
|
|
42
|
+
const completedDismiss = this.pendingDismiss && !this.host.contains(this.pendingDismiss.toast)
|
|
43
|
+
? this.pendingDismiss
|
|
44
|
+
: null;
|
|
45
|
+
this.internalOpen = nextOpen;
|
|
46
|
+
if (wasOpen && !nextOpen && completedDismiss) {
|
|
47
|
+
dispatchDetail(this.host, 'close', {
|
|
48
|
+
open: false,
|
|
49
|
+
reason: 'action',
|
|
50
|
+
trigger: completedDismiss.trigger,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (completedDismiss || !this.open)
|
|
54
|
+
this.pendingDismiss = null;
|
|
55
|
+
};
|
|
37
56
|
onClick = (e) => {
|
|
38
57
|
const dismissBtn = e.target.closest?.('[data-ui-toast-dismiss]');
|
|
39
58
|
if (!dismissBtn)
|
|
@@ -42,24 +61,16 @@ export class UIToastRegion {
|
|
|
42
61
|
if (!toast)
|
|
43
62
|
return;
|
|
44
63
|
const id = toast.id ?? '';
|
|
45
|
-
|
|
46
|
-
toast
|
|
64
|
+
const trigger = eventToTrigger(e);
|
|
65
|
+
this.pendingDismiss = { toast: toast, trigger };
|
|
47
66
|
dispatchDetail(this.host, 'dismiss', {
|
|
48
67
|
id,
|
|
49
68
|
reason: 'action',
|
|
50
|
-
trigger
|
|
69
|
+
trigger,
|
|
51
70
|
});
|
|
52
|
-
this.updateOpenState();
|
|
53
|
-
if (this.getToasts().length === 0) {
|
|
54
|
-
dispatchDetail(this.host, 'close', {
|
|
55
|
-
open: false,
|
|
56
|
-
reason: 'action',
|
|
57
|
-
trigger: eventToTrigger(e),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
71
|
};
|
|
61
72
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
73
|
+
return (h(Host, { key: 'b4430aceacb7a66202c6a43ad7b0bbe31c51eb94', role: "region", "aria-label": "Notifications", "aria-live": "polite", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: '8bfb02d38366fab29a1668a53b7834ccd1a9aa65' })));
|
|
63
74
|
}
|
|
64
75
|
static get is() { return "ui-toast-region"; }
|
|
65
76
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
inset: auto;
|
|
4
4
|
margin: 0;
|
|
5
5
|
display: inline-block;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
font-size: var(--ui-font-size-sm);
|
|
12
|
-
box-shadow: var(--ui-shadow-md);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding: 0;
|
|
8
|
+
border: 0;
|
|
9
|
+
border-radius: 0;
|
|
10
|
+
background: transparent;
|
|
13
11
|
opacity: 0;
|
|
14
12
|
transform: translateY(4px);
|
|
15
13
|
transition:
|
|
@@ -19,6 +17,17 @@
|
|
|
19
17
|
overlay var(--ui-motion-fast) allow-discrete;
|
|
20
18
|
}
|
|
21
19
|
|
|
20
|
+
.tooltip__surface {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
border: 1px solid var(--ui-border-default);
|
|
23
|
+
border-radius: var(--ui-radius-2);
|
|
24
|
+
background: var(--ui-surface-elevated);
|
|
25
|
+
color: var(--ui-text-primary);
|
|
26
|
+
padding: var(--ui-space-2) var(--ui-space-3);
|
|
27
|
+
font-size: var(--ui-font-size-sm);
|
|
28
|
+
box-shadow: var(--ui-shadow-md);
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
:host(:popover-open) { opacity: 1; transform: translateY(0); }
|
|
23
32
|
|
|
24
33
|
@starting-style {
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { openOverlay, closeOverlay
|
|
2
|
+
import { openOverlay, closeOverlay } from "../../overlay/manager";
|
|
3
3
|
import { dispatchDetail } from "../../utils/events";
|
|
4
|
+
import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
|
|
4
5
|
import { createAnchoredSurface, } from "../../overlay/positioning";
|
|
5
6
|
export class UITooltip {
|
|
6
7
|
host;
|
|
7
8
|
for = '';
|
|
8
|
-
open
|
|
9
|
+
/** Controlled open state. Omit it to use defaultOpen and local interaction state. */
|
|
10
|
+
open;
|
|
9
11
|
defaultOpen = false;
|
|
10
12
|
placement = 'top-start';
|
|
11
13
|
/** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
|
|
12
14
|
showDelay = 500;
|
|
13
15
|
/** Pointer leave grace period in milliseconds. */
|
|
14
16
|
hideDelay = 100;
|
|
17
|
+
/** Click or tap pins the description; activate again to dismiss. */
|
|
18
|
+
toggleOnClick = false;
|
|
19
|
+
pinned = false;
|
|
20
|
+
focused = false;
|
|
21
|
+
opened;
|
|
22
|
+
closed;
|
|
15
23
|
internalOpen = false;
|
|
16
24
|
overlayId = `ui-tooltip-${Math.random().toString(36).slice(2, 11)}`;
|
|
17
25
|
trigger = null;
|
|
@@ -20,7 +28,8 @@ export class UITooltip {
|
|
|
20
28
|
hideTimer = null;
|
|
21
29
|
syncFromProp() {
|
|
22
30
|
this.clearTimers();
|
|
23
|
-
|
|
31
|
+
if (isControlled(this.open))
|
|
32
|
+
this.internalOpen = this.open;
|
|
24
33
|
}
|
|
25
34
|
resetSurface() {
|
|
26
35
|
this.syncTrigger();
|
|
@@ -45,11 +54,13 @@ export class UITooltip {
|
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
componentDidLoad() {
|
|
48
|
-
this.
|
|
49
|
-
|
|
57
|
+
if (!this.host.id)
|
|
58
|
+
this.host.id = this.overlayId;
|
|
59
|
+
this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
|
|
50
60
|
this.syncTrigger();
|
|
51
61
|
this.setupSurface();
|
|
52
|
-
this.host.addEventListener('
|
|
62
|
+
this.host.addEventListener('pointerenter', this.onSurfaceEnter);
|
|
63
|
+
this.host.addEventListener('pointerleave', this.onTriggerLeave);
|
|
53
64
|
this.syncOverlay();
|
|
54
65
|
}
|
|
55
66
|
componentDidUpdate() {
|
|
@@ -60,12 +71,13 @@ export class UITooltip {
|
|
|
60
71
|
this.detachTriggerListeners();
|
|
61
72
|
this.surface?.destroy();
|
|
62
73
|
this.surface = null;
|
|
63
|
-
this.host.removeEventListener('
|
|
74
|
+
this.host.removeEventListener('pointerenter', this.onSurfaceEnter);
|
|
75
|
+
this.host.removeEventListener('pointerleave', this.onTriggerLeave);
|
|
64
76
|
closeOverlay(this.overlayId);
|
|
65
77
|
}
|
|
66
78
|
syncTrigger() {
|
|
67
79
|
const next = this.for
|
|
68
|
-
? this.host.
|
|
80
|
+
? this.host.getRootNode().getElementById(this.for)
|
|
69
81
|
: this.host.previousElementSibling;
|
|
70
82
|
if (next === this.trigger)
|
|
71
83
|
return;
|
|
@@ -85,6 +97,11 @@ export class UITooltip {
|
|
|
85
97
|
this.detachTriggerListeners();
|
|
86
98
|
if (!this.trigger)
|
|
87
99
|
return;
|
|
100
|
+
const ids = new Set((this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(Boolean));
|
|
101
|
+
ids.add(this.host.id);
|
|
102
|
+
this.trigger.setAttribute('aria-describedby', [...ids].join(' '));
|
|
103
|
+
this.trigger.addEventListener('click', this.onTriggerClick);
|
|
104
|
+
this.trigger.addEventListener('keydown', this.onTriggerKeydown);
|
|
88
105
|
this.trigger.addEventListener('pointerenter', this.onTriggerEnter);
|
|
89
106
|
this.trigger.addEventListener('pointerleave', this.onTriggerLeave);
|
|
90
107
|
this.trigger.addEventListener('focusin', this.onTriggerFocusIn);
|
|
@@ -93,6 +110,13 @@ export class UITooltip {
|
|
|
93
110
|
detachTriggerListeners() {
|
|
94
111
|
if (!this.trigger)
|
|
95
112
|
return;
|
|
113
|
+
const ids = (this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(id => id && id !== this.host.id);
|
|
114
|
+
if (ids.length)
|
|
115
|
+
this.trigger.setAttribute('aria-describedby', ids.join(' '));
|
|
116
|
+
else
|
|
117
|
+
this.trigger.removeAttribute('aria-describedby');
|
|
118
|
+
this.trigger.removeEventListener('click', this.onTriggerClick);
|
|
119
|
+
this.trigger.removeEventListener('keydown', this.onTriggerKeydown);
|
|
96
120
|
this.trigger.removeEventListener('pointerenter', this.onTriggerEnter);
|
|
97
121
|
this.trigger.removeEventListener('pointerleave', this.onTriggerLeave);
|
|
98
122
|
this.trigger.removeEventListener('focusin', this.onTriggerFocusIn);
|
|
@@ -117,14 +141,29 @@ export class UITooltip {
|
|
|
117
141
|
setInteractionOpen(nextOpen, trigger) {
|
|
118
142
|
if (this.internalOpen === nextOpen)
|
|
119
143
|
return;
|
|
120
|
-
this.
|
|
144
|
+
if (!isControlled(this.open))
|
|
145
|
+
this.internalOpen = nextOpen;
|
|
121
146
|
dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
|
|
122
147
|
open: nextOpen,
|
|
123
148
|
reason: 'action',
|
|
124
149
|
trigger,
|
|
125
150
|
});
|
|
126
151
|
}
|
|
127
|
-
|
|
152
|
+
onSurfaceEnter = () => this.clearHideTimer();
|
|
153
|
+
onTriggerClick = (event) => {
|
|
154
|
+
if (!this.toggleOnClick)
|
|
155
|
+
return;
|
|
156
|
+
this.clearTimers();
|
|
157
|
+
this.pinned = !this.pinned;
|
|
158
|
+
this.setInteractionOpen(this.pinned, event.detail === 0 ? 'keyboard' : 'pointer');
|
|
159
|
+
};
|
|
160
|
+
onTriggerKeydown = (event) => {
|
|
161
|
+
if (event.key === 'Escape')
|
|
162
|
+
this.clearTimers();
|
|
163
|
+
};
|
|
164
|
+
onTriggerEnter = (event) => {
|
|
165
|
+
if (event.pointerType === 'touch')
|
|
166
|
+
return;
|
|
128
167
|
this.clearHideTimer();
|
|
129
168
|
if (this.internalOpen || this.showTimer !== null)
|
|
130
169
|
return;
|
|
@@ -135,7 +174,7 @@ export class UITooltip {
|
|
|
135
174
|
};
|
|
136
175
|
onTriggerLeave = () => {
|
|
137
176
|
this.clearShowTimer();
|
|
138
|
-
if (!this.internalOpen || this.hideTimer !== null)
|
|
177
|
+
if (this.focused || this.pinned || !this.internalOpen || this.hideTimer !== null)
|
|
139
178
|
return;
|
|
140
179
|
this.hideTimer = setTimeout(() => {
|
|
141
180
|
this.hideTimer = null;
|
|
@@ -143,6 +182,7 @@ export class UITooltip {
|
|
|
143
182
|
}, Math.max(0, this.hideDelay));
|
|
144
183
|
};
|
|
145
184
|
onTriggerFocusIn = () => {
|
|
185
|
+
this.focused = true;
|
|
146
186
|
this.clearTimers();
|
|
147
187
|
this.setInteractionOpen(true, 'keyboard');
|
|
148
188
|
};
|
|
@@ -150,28 +190,26 @@ export class UITooltip {
|
|
|
150
190
|
const related = e.relatedTarget;
|
|
151
191
|
if (related && this.host.contains(related))
|
|
152
192
|
return;
|
|
193
|
+
this.focused = false;
|
|
194
|
+
this.pinned = false;
|
|
153
195
|
this.clearTimers();
|
|
154
196
|
this.setInteractionOpen(false, 'keyboard');
|
|
155
197
|
};
|
|
156
198
|
handleRequestClose(reason, trigger) {
|
|
157
|
-
if (reason === 'escape') {
|
|
199
|
+
if (reason === 'escape' || (reason === 'light-dismiss' && this.toggleOnClick)) {
|
|
200
|
+
this.pinned = false;
|
|
158
201
|
this.clearTimers();
|
|
159
|
-
this.
|
|
202
|
+
if (!isControlled(this.open))
|
|
203
|
+
this.internalOpen = false;
|
|
160
204
|
dispatchDetail(this.host, 'close', {
|
|
161
205
|
open: false,
|
|
162
|
-
reason
|
|
206
|
+
reason,
|
|
163
207
|
trigger: trigger,
|
|
164
208
|
});
|
|
165
|
-
this.trigger?.focus();
|
|
166
209
|
}
|
|
167
210
|
}
|
|
168
|
-
onKeydown = (e) => {
|
|
169
|
-
if (e.key === 'Escape') {
|
|
170
|
-
requestTopOverlayClose('escape', 'keyboard');
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
211
|
render() {
|
|
174
|
-
return (h(Host, { key: '
|
|
212
|
+
return (h(Host, { key: 'ce34c51bc3a9c9f7f31b7f0d329175df0cee1ab3', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, h("div", { key: 'e5bb2bcb146fe8ec3b4e9a6abb550961181e3c06', class: "tooltip__surface" }, h("slot", { key: 'bdb71bfcb0f72c212cbb5c64fb69510fdded4afb' }))));
|
|
175
213
|
}
|
|
176
214
|
static get is() { return "ui-tooltip"; }
|
|
177
215
|
static get encapsulation() { return "shadow"; }
|
|
@@ -216,16 +254,15 @@ export class UITooltip {
|
|
|
216
254
|
"references": {}
|
|
217
255
|
},
|
|
218
256
|
"required": false,
|
|
219
|
-
"optional":
|
|
257
|
+
"optional": true,
|
|
220
258
|
"docs": {
|
|
221
259
|
"tags": [],
|
|
222
|
-
"text": ""
|
|
260
|
+
"text": "Controlled open state. Omit it to use defaultOpen and local interaction state."
|
|
223
261
|
},
|
|
224
262
|
"getter": false,
|
|
225
263
|
"setter": false,
|
|
226
264
|
"reflect": false,
|
|
227
|
-
"attribute": "open"
|
|
228
|
-
"defaultValue": "false"
|
|
265
|
+
"attribute": "open"
|
|
229
266
|
},
|
|
230
267
|
"defaultOpen": {
|
|
231
268
|
"type": "boolean",
|
|
@@ -313,6 +350,26 @@ export class UITooltip {
|
|
|
313
350
|
"reflect": false,
|
|
314
351
|
"attribute": "hide-delay",
|
|
315
352
|
"defaultValue": "100"
|
|
353
|
+
},
|
|
354
|
+
"toggleOnClick": {
|
|
355
|
+
"type": "boolean",
|
|
356
|
+
"mutable": false,
|
|
357
|
+
"complexType": {
|
|
358
|
+
"original": "boolean",
|
|
359
|
+
"resolved": "boolean",
|
|
360
|
+
"references": {}
|
|
361
|
+
},
|
|
362
|
+
"required": false,
|
|
363
|
+
"optional": false,
|
|
364
|
+
"docs": {
|
|
365
|
+
"tags": [],
|
|
366
|
+
"text": "Click or tap pins the description; activate again to dismiss."
|
|
367
|
+
},
|
|
368
|
+
"getter": false,
|
|
369
|
+
"setter": false,
|
|
370
|
+
"reflect": false,
|
|
371
|
+
"attribute": "toggle-on-click",
|
|
372
|
+
"defaultValue": "false"
|
|
316
373
|
}
|
|
317
374
|
};
|
|
318
375
|
}
|
|
@@ -321,6 +378,39 @@ export class UITooltip {
|
|
|
321
378
|
"internalOpen": {}
|
|
322
379
|
};
|
|
323
380
|
}
|
|
381
|
+
static get events() {
|
|
382
|
+
return [{
|
|
383
|
+
"method": "opened",
|
|
384
|
+
"name": "open",
|
|
385
|
+
"bubbles": true,
|
|
386
|
+
"cancelable": true,
|
|
387
|
+
"composed": true,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": ""
|
|
391
|
+
},
|
|
392
|
+
"complexType": {
|
|
393
|
+
"original": "{ open: boolean; reason: string; trigger: string }",
|
|
394
|
+
"resolved": "{ open: boolean; reason: string; trigger: string; }",
|
|
395
|
+
"references": {}
|
|
396
|
+
}
|
|
397
|
+
}, {
|
|
398
|
+
"method": "closed",
|
|
399
|
+
"name": "close",
|
|
400
|
+
"bubbles": true,
|
|
401
|
+
"cancelable": true,
|
|
402
|
+
"composed": true,
|
|
403
|
+
"docs": {
|
|
404
|
+
"tags": [],
|
|
405
|
+
"text": ""
|
|
406
|
+
},
|
|
407
|
+
"complexType": {
|
|
408
|
+
"original": "{ open: boolean; reason: string; trigger: string }",
|
|
409
|
+
"resolved": "{ open: boolean; reason: string; trigger: string; }",
|
|
410
|
+
"references": {}
|
|
411
|
+
}
|
|
412
|
+
}];
|
|
413
|
+
}
|
|
324
414
|
static get elementRef() { return "host"; }
|
|
325
415
|
static get watchers() {
|
|
326
416
|
return [{
|
|
@@ -27,7 +27,7 @@ export class UITopBar {
|
|
|
27
27
|
this.hasActions = slotHasContent(this.actionsSlot);
|
|
28
28
|
};
|
|
29
29
|
render() {
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: 'b92aa4e03475b3e623212a1e98f45d5532860b51' }, h("header", { key: 'a3552708b0e424e762e100ee55fc6bfac4cd830a', class: "top-bar", part: "base" }, h("div", { key: '4c8a9e3a04ff23a615bf09e368f4212dd5b38157', class: "top-bar__leading", hidden: !this.hasLeading }, h("slot", { key: '64ecc99672b8fd37305810e0776a24bf87ea6f08', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), h("div", { key: '37fc003aba2b87f7c8c0e654cd6810d7f231f365', class: "top-bar__title" }, h("slot", { key: 'e6c901c15852e83340ca8ad1e264fd5e35445e84' })), h("div", { key: '37b1ac319367eeded4182ada401a31e0b9c2555a', class: "top-bar__search", hidden: !this.hasSearch }, h("slot", { key: '0a8b5ef500dd843909bb35a1133be548411f3b71', name: "search", ref: (el) => (this.searchSlot = el), onSlotchange: this.syncSlots })), h("div", { key: '7e5054a3ed6ecfe8d9d8b1b36992843aa0fb62eb', class: "top-bar__actions", hidden: !this.hasActions }, h("slot", { key: '19fe59c5ba4da7f0ceda764948f1288bfaa2a41d', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.syncSlots })))));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "ui-top-bar"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|