@threadlabs/looma 0.1.23 → 0.1.25
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-NB6DBRXQ.js +323 -0
- package/dist/{chunk-GDMQKT5F.js → chunk-UY423IKN.js} +33 -30
- package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
- package/dist/cjs/icons-BAdjrnhS.js +680 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
- package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ui-badge.cjs.entry.js +2 -2
- package/dist/cjs/ui-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-callout.cjs.entry.js +27 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
- package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
- package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
- package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
- package/dist/cjs/ui-editable.cjs.entry.js +100 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
- package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-input.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-menu.cjs.entry.js +14 -9
- package/dist/cjs/ui-multi-combobox.cjs.entry.js +158 -0
- package/dist/cjs/ui-popover.cjs.entry.js +10 -7
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio.cjs.entry.js +16 -7
- package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-select.cjs.entry.js +1 -1
- package/dist/cjs/ui-switch.cjs.entry.js +19 -10
- package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
- package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
- package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
- package/dist/cjs/ui-tree.cjs.entry.js +123 -11
- package/dist/collection/collection-manifest.json +4 -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.js +1 -1
- 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 +47 -0
- package/dist/collection/components/ui-chip/ui-chip.js +67 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
- 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-editable/ui-editable.css +2 -0
- package/dist/collection/components/ui-editable/ui-editable.js +196 -0
- 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.js +59 -4
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.js +1 -1
- 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-multi-combobox/ui-multi-combobox.css +29 -0
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +503 -0
- 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 +24 -11
- 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.js +1 -1
- 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.js +1 -1
- 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 +14 -11
- 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 +122 -10
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
- package/dist/collection/field/editable.js +1 -0
- package/dist/collection/field/multi-combobox.js +1 -0
- package/dist/collection/icons.js +6 -1
- package/dist/collection/utils/controlled-state.js +4 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-B9CzOHvE.js +1 -0
- package/dist/components/p-BMgIcOh-.js +1 -0
- package/dist/components/p-BVteuP_d.js +1 -0
- package/dist/components/p-BnGhGgTH.js +1 -0
- package/dist/components/p-C6p-ygxq.js +1 -0
- package/dist/components/p-CoFximGM.js +13 -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.js +1 -1
- 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-editable.d.ts +11 -0
- package/dist/components/ui-editable.js +1 -0
- 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-multi-combobox.d.ts +11 -0
- package/dist/components/ui-multi-combobox.js +1 -0
- 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/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-avatar-group.entry.js +9 -17
- package/dist/esm/ui-avatar.entry.js +2 -2
- package/dist/esm/ui-badge.entry.js +2 -2
- package/dist/esm/ui-button.entry.js +1 -1
- package/dist/esm/ui-callout.entry.js +25 -0
- package/dist/esm/ui-checkbox.entry.js +13 -7
- package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
- package/dist/esm/ui-context-menu.entry.js +1 -1
- package/dist/esm/ui-dialog.entry.js +44 -8
- package/dist/esm/ui-disclosure.entry.js +9 -6
- package/dist/esm/ui-editable.entry.js +98 -0
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-form-field.entry.js +59 -4
- package/dist/esm/ui-icon-button.entry.js +1 -1
- package/dist/esm/ui-input.entry.js +1 -1
- package/dist/esm/ui-menu-item.entry.js +2 -2
- package/dist/esm/ui-menu.entry.js +14 -9
- package/dist/esm/ui-multi-combobox.entry.js +156 -0
- package/dist/esm/ui-popover.entry.js +10 -7
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-radio.entry.js +16 -7
- package/dist/esm/ui-search-result-row.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-select.entry.js +1 -1
- package/dist/esm/ui-switch.entry.js +19 -10
- package/dist/esm/ui-tabs.entry.js +10 -9
- package/dist/esm/ui-textarea.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +30 -19
- package/dist/esm/ui-tooltip.entry.js +12 -8
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/esm/ui-tree-item.entry.js +54 -617
- package/dist/esm/ui-tree.entry.js +123 -11
- package/dist/index.cjs +1552 -894
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +12 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-08f80207.entry.js +1 -0
- package/dist/looma/{p-ed368426.entry.js → p-0e1741cb.entry.js} +1 -1
- package/dist/looma/p-0ef4bf13.entry.js +1 -0
- package/dist/looma/{p-7e0bb7f6.entry.js → p-166f8593.entry.js} +1 -1
- package/dist/looma/p-262a542c.entry.js +1 -0
- package/dist/looma/{p-13347631.entry.js → p-26d357ae.entry.js} +1 -1
- package/dist/looma/p-30f01909.entry.js +1 -0
- package/dist/looma/p-393e3e02.entry.js +1 -0
- package/dist/looma/p-3a44b9f9.entry.js +1 -0
- package/dist/looma/p-558d4f5b.entry.js +1 -0
- package/dist/looma/{p-5a87b59d.entry.js → p-5780cefa.entry.js} +1 -1
- package/dist/looma/p-5a7261e1.entry.js +1 -0
- package/dist/looma/p-5fdcee1d.entry.js +1 -0
- package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
- package/dist/looma/p-7319c147.entry.js +1 -0
- package/dist/looma/p-78b7e466.entry.js +1 -0
- package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
- package/dist/looma/p-7eb04f09.entry.js +1 -0
- package/dist/looma/{p-69a5557b.entry.js → p-81c533f5.entry.js} +1 -1
- package/dist/looma/p-87f501cf.entry.js +1 -0
- package/dist/looma/p-89e71bbb.entry.js +1 -0
- package/dist/looma/{p-8b8840b8.entry.js → p-92cd1841.entry.js} +1 -1
- package/dist/looma/{p-f0487ff3.entry.js → p-95eb3b58.entry.js} +1 -1
- package/dist/looma/p-96ec4d7a.entry.js +1 -0
- package/dist/looma/p-9d2662ca.entry.js +1 -0
- package/dist/looma/p-BnGhGgTH.js +1 -0
- package/dist/looma/p-CoFximGM.js +13 -0
- package/dist/looma/p-add67e4c.entry.js +1 -0
- package/dist/looma/p-b6c776fb.entry.js +1 -0
- package/dist/looma/p-bcb1b47b.entry.js +1 -0
- package/dist/looma/p-d56571a2.entry.js +1 -0
- package/dist/looma/{p-582973b5.entry.js → p-d62da01d.entry.js} +1 -1
- package/dist/looma/{p-f74e5546.entry.js → p-dbcb479c.entry.js} +1 -1
- package/dist/looma/p-e14024bf.entry.js +1 -0
- package/dist/looma/{p-5da09f47.entry.js → p-fc180770.entry.js} +1 -1
- 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 +8 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -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-editable/ui-editable.d.ts +24 -0
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
- package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +47 -0
- 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-switch/ui-switch.d.ts +2 -1
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -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 +2 -1
- package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
- package/dist/types/components.d.ts +343 -46
- package/dist/types/field/editable.d.ts +5 -0
- package/dist/types/field/multi-combobox.d.ts +11 -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-VO4C2MZX.js → ui-affordance-scope.entry-VSSP52ZP.js} +2 -2
- package/dist/ui-avatar-group.entry-JMCLL6FW.js +51 -0
- package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-X2YQ3QPG.js} +3 -3
- package/dist/ui-badge.entry-OJ6FJJKL.js +22 -0
- package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-ZN6JLND7.js} +2 -2
- package/dist/ui-callout.entry-7K6NXQ7U.js +32 -0
- package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-GUYRVU6O.js} +17 -8
- package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-chip_2.entry-M2DOTIGY.js} +32 -7
- package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-BM7FHOUJ.js} +5 -5
- package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-AZAD37CG.js} +50 -12
- package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-XDPGKMBK.js} +13 -7
- package/dist/ui-editable.entry-S3TE6KFT.js +110 -0
- package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-U7HGA3CS.js} +2 -2
- package/dist/ui-form-field.entry-C2ZSP3TM.js +120 -0
- package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-P6H2LY7D.js} +2 -2
- package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-GTNQJCQ2.js} +2 -2
- package/dist/ui-menu-item.entry-2HWOGUO5.js +22 -0
- package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-NZ7ER54K.js} +22 -14
- package/dist/ui-multi-combobox.entry-DZ5LLSVQ.js +167 -0
- package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-ZOEQMUWG.js} +17 -11
- package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-QCQ46EK5.js} +2 -2
- package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-QAATWUYT.js} +20 -8
- package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-2I3DH2OT.js} +2 -2
- package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-7RS55ORF.js} +2 -2
- package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-6O4KD4G7.js} +2 -2
- package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-DY5PSHCQ.js} +23 -11
- package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-6X56UOUE.js} +14 -10
- package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-RDYP6O77.js} +2 -2
- package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-EBY42KS5.js} +32 -23
- package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-PLXMPOKV.js} +19 -12
- package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-QKE2DLVD.js} +2 -2
- package/dist/ui-tree-item.entry-TC6YWIC6.js +145 -0
- package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-UL6UHCUT.js} +114 -12
- 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 +1 -1
- package/styles.css +10 -0
- package/tokens.css +3 -0
- package/vue/{chunk-JLW23USW.js → chunk-GXQY27K2.js} +112 -17
- package/vue/editor/index.d.ts +5 -15
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +442 -116
- package/vue/index.js +9 -1
- package/dist/components/p-CaietZcq.js +0 -1
- package/dist/components/p-DHd18bK7.js +0 -1
- package/dist/looma/p-14c081cf.entry.js +0 -1
- package/dist/looma/p-25366205.entry.js +0 -1
- package/dist/looma/p-2e3aa869.entry.js +0 -1
- package/dist/looma/p-40fe7fee.entry.js +0 -1
- package/dist/looma/p-446cda76.entry.js +0 -1
- package/dist/looma/p-4fc1b005.entry.js +0 -13
- package/dist/looma/p-6a8a4736.entry.js +0 -1
- package/dist/looma/p-6bf4038b.entry.js +0 -1
- package/dist/looma/p-8204fee6.entry.js +0 -1
- package/dist/looma/p-8238e0dc.entry.js +0 -1
- package/dist/looma/p-99d88efb.entry.js +0 -1
- package/dist/looma/p-a27669b1.entry.js +0 -1
- package/dist/looma/p-a6ee76b7.entry.js +0 -1
- package/dist/looma/p-b6398a6b.entry.js +0 -1
- package/dist/looma/p-d50faaff.entry.js +0 -1
- package/dist/looma/p-d77278ce.entry.js +0 -1
- package/dist/looma/p-d9ec13b7.entry.js +0 -1
- package/dist/looma/p-ecf8005f.entry.js +0 -1
- package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
- package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
- package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
- package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
- package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createId
|
|
3
3
|
} from "./chunk-OF57X5AR.js";
|
|
4
|
+
import {
|
|
5
|
+
controlledOrDefault,
|
|
6
|
+
isControlled
|
|
7
|
+
} from "./chunk-HNFCGIBP.js";
|
|
4
8
|
import {
|
|
5
9
|
dispatchDetail,
|
|
6
10
|
eventToTrigger,
|
|
@@ -11,7 +15,7 @@ import {
|
|
|
11
15
|
getElement,
|
|
12
16
|
h,
|
|
13
17
|
registerInstance
|
|
14
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UY423IKN.js";
|
|
15
19
|
|
|
16
20
|
// dist/esm/ui-disclosure.entry.js
|
|
17
21
|
var uiDisclosureCss = () => `:host{display:block}::slotted([hidden]){display:none !important}`;
|
|
@@ -22,7 +26,8 @@ var UIDisclosure = class {
|
|
|
22
26
|
get host() {
|
|
23
27
|
return getElement(this);
|
|
24
28
|
}
|
|
25
|
-
open
|
|
29
|
+
/** Controlled open state. Omit it to use defaultOpen and local interaction state. */
|
|
30
|
+
open;
|
|
26
31
|
defaultOpen = false;
|
|
27
32
|
disabled = false;
|
|
28
33
|
internalOpen = false;
|
|
@@ -30,7 +35,8 @@ var UIDisclosure = class {
|
|
|
30
35
|
trigger = null;
|
|
31
36
|
content = null;
|
|
32
37
|
syncFromProp() {
|
|
33
|
-
|
|
38
|
+
if (isControlled(this.open))
|
|
39
|
+
this.internalOpen = this.open;
|
|
34
40
|
}
|
|
35
41
|
syncState() {
|
|
36
42
|
if (this.trigger) {
|
|
@@ -42,8 +48,7 @@ var UIDisclosure = class {
|
|
|
42
48
|
}
|
|
43
49
|
componentDidLoad() {
|
|
44
50
|
this.resolveParts();
|
|
45
|
-
this.
|
|
46
|
-
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
51
|
+
this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
|
|
47
52
|
this.syncState();
|
|
48
53
|
this.trigger?.addEventListener("click", this.onTriggerClick);
|
|
49
54
|
this.trigger?.addEventListener("keydown", this.onTriggerKeydown);
|
|
@@ -80,7 +85,8 @@ var UIDisclosure = class {
|
|
|
80
85
|
setOpen(next, action) {
|
|
81
86
|
if (this.internalOpen === next)
|
|
82
87
|
return;
|
|
83
|
-
this.
|
|
88
|
+
if (!isControlled(this.open))
|
|
89
|
+
this.internalOpen = next;
|
|
84
90
|
dispatchDetail(this.host, next ? "open" : "close", {
|
|
85
91
|
open: next,
|
|
86
92
|
reason: action.reason,
|
|
@@ -101,7 +107,7 @@ var UIDisclosure = class {
|
|
|
101
107
|
this.setOpen(!this.internalOpen, { reason: "action", trigger: "keyboard" });
|
|
102
108
|
};
|
|
103
109
|
render() {
|
|
104
|
-
return h(Host, { key: "
|
|
110
|
+
return h(Host, { key: "55f998f8e47ebe01fd5832d6c3dac310dda34b8d" }, h("slot", { key: "0d88728151901e1e412d7f5a3ae78b06aa7548fb" }));
|
|
105
111
|
}
|
|
106
112
|
static get watchers() {
|
|
107
113
|
return {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
controlledOrDefault,
|
|
3
|
+
isControlled
|
|
4
|
+
} from "./chunk-HNFCGIBP.js";
|
|
5
|
+
import {
|
|
6
|
+
Host,
|
|
7
|
+
createEvent,
|
|
8
|
+
getElement,
|
|
9
|
+
h,
|
|
10
|
+
registerInstance
|
|
11
|
+
} from "./chunk-UY423IKN.js";
|
|
12
|
+
|
|
13
|
+
// dist/esm/ui-editable.entry.js
|
|
14
|
+
var uiEditableCss = () => `:host{display:block;min-inline-size:0}[hidden]{display:none !important}`;
|
|
15
|
+
var UIEditable = class {
|
|
16
|
+
constructor(hostRef) {
|
|
17
|
+
registerInstance(this, hostRef);
|
|
18
|
+
this.editChange = createEvent(this, "edit-change");
|
|
19
|
+
}
|
|
20
|
+
get host() {
|
|
21
|
+
return getElement(this);
|
|
22
|
+
}
|
|
23
|
+
/** Controlled edit state. Omit it to use defaultEdit and local interaction state. */
|
|
24
|
+
edit;
|
|
25
|
+
defaultEdit = false;
|
|
26
|
+
disabled = false;
|
|
27
|
+
editChange;
|
|
28
|
+
internalEdit = false;
|
|
29
|
+
trigger = null;
|
|
30
|
+
syncFromProp() {
|
|
31
|
+
if (isControlled(this.edit))
|
|
32
|
+
this.internalEdit = this.edit;
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.internalEdit = controlledOrDefault(this.edit, this.defaultEdit);
|
|
36
|
+
}
|
|
37
|
+
componentDidLoad() {
|
|
38
|
+
this.host.ownerDocument.addEventListener("pointerdown", this.onDocumentPointerDown, true);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.host.ownerDocument.removeEventListener("pointerdown", this.onDocumentPointerDown, true);
|
|
42
|
+
}
|
|
43
|
+
requestEdit(next, reason, trigger) {
|
|
44
|
+
if (this.disabled || this.internalEdit === next)
|
|
45
|
+
return;
|
|
46
|
+
if (!isControlled(this.edit))
|
|
47
|
+
this.internalEdit = next;
|
|
48
|
+
this.editChange.emit({ edit: next, reason, trigger });
|
|
49
|
+
if (next)
|
|
50
|
+
requestAnimationFrame(() => this.focusEditor());
|
|
51
|
+
else
|
|
52
|
+
requestAnimationFrame(() => this.trigger?.focus());
|
|
53
|
+
}
|
|
54
|
+
focusEditor() {
|
|
55
|
+
const editRoot = this.host.querySelector('[slot="edit"]');
|
|
56
|
+
const candidate = editRoot?.matches("input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox") ? editRoot : editRoot?.querySelector("input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox");
|
|
57
|
+
const focusInput = candidate?.focusInput;
|
|
58
|
+
if (typeof focusInput === "function")
|
|
59
|
+
void focusInput.call(candidate);
|
|
60
|
+
else
|
|
61
|
+
candidate?.focus();
|
|
62
|
+
}
|
|
63
|
+
eventTrigger(event) {
|
|
64
|
+
return event.composedPath().find((node) => node instanceof HTMLElement && node.hasAttribute("data-ui-editable-trigger"));
|
|
65
|
+
}
|
|
66
|
+
onClick = (event) => {
|
|
67
|
+
if (this.internalEdit || this.disabled)
|
|
68
|
+
return;
|
|
69
|
+
const trigger = this.eventTrigger(event);
|
|
70
|
+
if (!trigger)
|
|
71
|
+
return;
|
|
72
|
+
this.trigger = trigger;
|
|
73
|
+
this.requestEdit(true, "activate", "pointer");
|
|
74
|
+
};
|
|
75
|
+
onKeyDown = (event) => {
|
|
76
|
+
if (this.internalEdit && event.key === "Escape") {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
event.stopPropagation();
|
|
79
|
+
this.requestEdit(false, "escape", "keyboard");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (this.internalEdit || !["Enter", " "].includes(event.key))
|
|
83
|
+
return;
|
|
84
|
+
const trigger = this.eventTrigger(event);
|
|
85
|
+
if (!trigger)
|
|
86
|
+
return;
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
this.trigger = trigger;
|
|
89
|
+
this.requestEdit(true, "activate", "keyboard");
|
|
90
|
+
};
|
|
91
|
+
onDocumentPointerDown = (event) => {
|
|
92
|
+
if (!this.internalEdit || event.composedPath().includes(this.host))
|
|
93
|
+
return;
|
|
94
|
+
this.requestEdit(false, "light-dismiss", "pointer");
|
|
95
|
+
};
|
|
96
|
+
render() {
|
|
97
|
+
return h(Host, { key: "f350400d4ebf897fb657b83b7cba9d309c5067bd", "data-edit": this.internalEdit ? "" : void 0, "data-disabled": this.disabled ? "" : void 0, onClick: this.onClick, onKeyDown: this.onKeyDown }, h("div", { key: "f365ac61f59e9aaa1516121e3d6e2a42187e1d7b", part: "preview", hidden: this.internalEdit }, h("slot", { key: "ea234b437cc4eb530f2994d695429be91d874ef7", name: "preview" })), h("div", { key: "dacf0e74e72c47868986c80aaa60f55942fd9505", part: "edit", hidden: !this.internalEdit }, h("slot", { key: "54a943bc290335181a23b4cfa6055e4acfd8a62b", name: "edit" })));
|
|
98
|
+
}
|
|
99
|
+
static get watchers() {
|
|
100
|
+
return {
|
|
101
|
+
"edit": [{
|
|
102
|
+
"syncFromProp": 0
|
|
103
|
+
}]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
UIEditable.style = uiEditableCss();
|
|
108
|
+
export {
|
|
109
|
+
UIEditable as ui_editable
|
|
110
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Host,
|
|
3
3
|
h,
|
|
4
4
|
registerInstance
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UY423IKN.js";
|
|
6
6
|
|
|
7
7
|
// dist/esm/ui-floating-action-button.entry.js
|
|
8
8
|
var 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:max( var(--ui-floating-action-button-inline-end, var(--ui-space-5, 1.25rem)), env(safe-area-inset-right) );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}}`;
|
|
@@ -14,7 +14,7 @@ var UIFloatingActionButton = class {
|
|
|
14
14
|
mobileOnly = false;
|
|
15
15
|
label = "";
|
|
16
16
|
render() {
|
|
17
|
-
return h(Host, { key: "
|
|
17
|
+
return h(Host, { key: "9e917e07efcef5c0a96b8b09af8934f336a521bd", "data-disabled": this.disabled ? "" : void 0 }, h("button", { key: "940daac4c2ff1144d7e82b36727205f286325a8e", type: "button", "aria-label": this.label || void 0, disabled: this.disabled }, h("slot", { key: "382c70aa4836f6e799f98e1f0e4bc6e3104430fc" })));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
UIFloatingActionButton.style = uiFloatingActionButtonCss();
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createId
|
|
3
|
+
} from "./chunk-OF57X5AR.js";
|
|
4
|
+
import {
|
|
5
|
+
Host,
|
|
6
|
+
getElement,
|
|
7
|
+
h,
|
|
8
|
+
registerInstance
|
|
9
|
+
} from "./chunk-UY423IKN.js";
|
|
10
|
+
|
|
11
|
+
// dist/esm/ui-form-field.entry.js
|
|
12
|
+
var uiFormFieldCss = () => `:host{display:grid;gap:var(--ui-space-2);min-inline-size:0;align-content:start;color:var(--ui-text-primary)}::slotted(label){color:var(--ui-text-secondary);font-size:0.95rem}::slotted([data-slot='help']){min-block-size:var(--ui-form-field-help-min-block-size, 0);color:var(--ui-text-muted);font-size:0.875rem;line-height:var(--ui-line-height-md)}::slotted([data-slot='error']),::slotted([role='alert']){color:var(--ui-accent-active);font-size:0.875rem}`;
|
|
13
|
+
var UIFormField = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
registerInstance(this, hostRef);
|
|
16
|
+
}
|
|
17
|
+
get host() {
|
|
18
|
+
return getElement(this);
|
|
19
|
+
}
|
|
20
|
+
invalid = false;
|
|
21
|
+
disabled = false;
|
|
22
|
+
required = false;
|
|
23
|
+
observer = null;
|
|
24
|
+
activeInput = null;
|
|
25
|
+
ownedDescriptionIds = /* @__PURE__ */ new Set();
|
|
26
|
+
wireQueued = false;
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
this.observer = new MutationObserver(this.scheduleWire);
|
|
29
|
+
this.observer.observe(this.host, {
|
|
30
|
+
childList: true,
|
|
31
|
+
subtree: true,
|
|
32
|
+
attributes: true,
|
|
33
|
+
attributeFilter: ["aria-describedby", "data-slot", "id", "role"]
|
|
34
|
+
});
|
|
35
|
+
this.wire();
|
|
36
|
+
}
|
|
37
|
+
componentDidUpdate() {
|
|
38
|
+
this.scheduleWire();
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.observer?.disconnect();
|
|
42
|
+
this.observer = null;
|
|
43
|
+
this.removeOwnedDescriptions(this.activeInput);
|
|
44
|
+
this.activeInput = null;
|
|
45
|
+
this.ownedDescriptionIds.clear();
|
|
46
|
+
}
|
|
47
|
+
descriptionIds(input) {
|
|
48
|
+
return Array.from(new Set((input.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean)));
|
|
49
|
+
}
|
|
50
|
+
removeOwnedDescriptions(input) {
|
|
51
|
+
if (!input || this.ownedDescriptionIds.size === 0)
|
|
52
|
+
return;
|
|
53
|
+
const remaining = this.descriptionIds(input).filter((id) => !this.ownedDescriptionIds.has(id));
|
|
54
|
+
if (remaining.length > 0)
|
|
55
|
+
input.setAttribute("aria-describedby", remaining.join(" "));
|
|
56
|
+
else
|
|
57
|
+
input.removeAttribute("aria-describedby");
|
|
58
|
+
}
|
|
59
|
+
scheduleWire = () => {
|
|
60
|
+
if (this.wireQueued)
|
|
61
|
+
return;
|
|
62
|
+
this.wireQueued = true;
|
|
63
|
+
queueMicrotask(() => {
|
|
64
|
+
this.wireQueued = false;
|
|
65
|
+
this.wire();
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
wire() {
|
|
69
|
+
const label = this.host.querySelector("label");
|
|
70
|
+
const input = this.host.querySelector("input, textarea, select");
|
|
71
|
+
const help = this.host.querySelector('[data-slot="help"]');
|
|
72
|
+
const error = this.host.querySelector('[data-slot="error"], [role="alert"]');
|
|
73
|
+
if (input !== this.activeInput) {
|
|
74
|
+
this.removeOwnedDescriptions(this.activeInput);
|
|
75
|
+
this.activeInput = input;
|
|
76
|
+
this.ownedDescriptionIds.clear();
|
|
77
|
+
}
|
|
78
|
+
if (!input)
|
|
79
|
+
return;
|
|
80
|
+
if (!input.id) {
|
|
81
|
+
input.id = createId("form-field-input");
|
|
82
|
+
}
|
|
83
|
+
if (label && !label.getAttribute("for")) {
|
|
84
|
+
label.setAttribute("for", input.id);
|
|
85
|
+
}
|
|
86
|
+
const previousOwnedIds = this.ownedDescriptionIds;
|
|
87
|
+
const externalIds = this.descriptionIds(input).filter((id) => !previousOwnedIds.has(id));
|
|
88
|
+
const describedIds = [];
|
|
89
|
+
if (help) {
|
|
90
|
+
if (!help.id)
|
|
91
|
+
help.id = createId("form-field-help");
|
|
92
|
+
describedIds.push(help.id);
|
|
93
|
+
}
|
|
94
|
+
if (error) {
|
|
95
|
+
if (!error.id)
|
|
96
|
+
error.id = createId("form-field-error");
|
|
97
|
+
describedIds.push(error.id);
|
|
98
|
+
}
|
|
99
|
+
const nextOwnedIds = describedIds.filter((id) => !externalIds.includes(id));
|
|
100
|
+
const nextDescribedIds = Array.from(/* @__PURE__ */ new Set([...externalIds, ...describedIds]));
|
|
101
|
+
const nextDescribedBy = nextDescribedIds.join(" ");
|
|
102
|
+
if (input.getAttribute("aria-describedby") !== nextDescribedBy) {
|
|
103
|
+
if (nextDescribedBy)
|
|
104
|
+
input.setAttribute("aria-describedby", nextDescribedBy);
|
|
105
|
+
else
|
|
106
|
+
input.removeAttribute("aria-describedby");
|
|
107
|
+
}
|
|
108
|
+
this.ownedDescriptionIds = new Set(nextOwnedIds);
|
|
109
|
+
input.disabled = this.disabled;
|
|
110
|
+
input.required = this.required;
|
|
111
|
+
input.setAttribute("aria-invalid", this.invalid ? "true" : "false");
|
|
112
|
+
}
|
|
113
|
+
render() {
|
|
114
|
+
return h(Host, { key: "ac01e2be489b9c907169417dc5064061bd74ff7c", "data-invalid": this.invalid ? "" : void 0, "data-disabled": this.disabled ? "" : void 0, "data-required": this.required ? "" : void 0 }, h("slot", { key: "c739f9b2c948bc1d3db4316871c2293bf75cf520", onSlotchange: this.scheduleWire }));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
UIFormField.style = uiFormFieldCss();
|
|
118
|
+
export {
|
|
119
|
+
UIFormField as ui_form_field
|
|
120
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Host,
|
|
3
3
|
h,
|
|
4
4
|
registerInstance
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UY423IKN.js";
|
|
6
6
|
|
|
7
7
|
// dist/esm/ui-icon-button.entry.js
|
|
8
8
|
var uiIconButtonCss = () => `:host{display:inline-flex;color:var(--ui-text-secondary)}:host([anticipatory]){position:relative}:host([anticipatory])::before{content:'';position:absolute;inset:50% auto auto 50%;z-index:1;inline-size:var(--ui-affordance-guide-size, 0.25rem);block-size:var(--ui-affordance-guide-size, 0.25rem);border-radius:var(--ui-radius-round, 999px);background:var(--ui-affordance-guide-color, var(--ui-border-strong));opacity:var(--ui-affordance-guide-opacity, 0.42);transform:translate(-50%, -50%);transition:opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);pointer-events:none}:host([anticipatory]) button{opacity:0;transform:scale(0.72);pointer-events:none}:host([anticipatory][data-ui-proximity='near'])::before,:host([anticipatory]:focus-within)::before,:host([anticipatory]:hover)::before,:host([anticipatory][variant='solid'])::before{opacity:0}:host([anticipatory][data-ui-proximity='near']) button,:host([anticipatory]:focus-within) button,:host([anticipatory]:hover) button,:host([anticipatory][variant='solid']) button{opacity:1;transform:scale(1);pointer-events:auto}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)}@media (hover: none), (pointer: coarse){:host([anticipatory])::before{opacity:0}:host([anticipatory]) button{opacity:1;transform:none;pointer-events:auto}}: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)}`;
|
|
@@ -17,7 +17,7 @@ var UIIconButton = class {
|
|
|
17
17
|
/** Reveals this control through a surrounding ui-affordance-scope. */
|
|
18
18
|
anticipatory = false;
|
|
19
19
|
render() {
|
|
20
|
-
return h(Host, { key: "
|
|
20
|
+
return h(Host, { key: "225e147d184109d39a2e6f9236ba3ba3c5864c31", "data-disabled": this.disabled ? "" : void 0, "data-ui-affordance": this.anticipatory ? "button" : void 0 }, h("button", { key: "7e54fab4520ae6641c974abf19e975e8eec7a3df", type: "button", "aria-label": this.label || void 0, disabled: this.disabled }, h("slot", { key: "54f9ba27c5a2ca896267f07ad1055907e74a64bc" })));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
UIIconButton.style = uiIconButtonCss();
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getElement,
|
|
8
8
|
h,
|
|
9
9
|
registerInstance
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UY423IKN.js";
|
|
11
11
|
|
|
12
12
|
// dist/esm/ui-input.entry.js
|
|
13
13
|
var uiInputCss = () => `:host{display:inline-flex;min-inline-size:0;color:var(--ui-text-primary)}::slotted(input){width:100%;appearance:none;min-block-size:var(--ui-control-min-block-size, 2.75rem);border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, 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-control-border-hover, var(--ui-border-strong))}::slotted(input:focus){border-color:var(--ui-control-focus, var(--ui-focus-ring));box-shadow:0 0 0 3px var(--ui-control-focus-halo, 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-control-surface-disabled, 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}`;
|
|
@@ -83,7 +83,7 @@ var UIInput = class {
|
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
render() {
|
|
86
|
-
return h(Host, { key: "
|
|
86
|
+
return h(Host, { key: "0d8676e8458476681653ef4600dcb0f3b56d1ed1", "data-invalid": this.invalid ? "" : void 0 }, h("slot", { key: "d3585c07b6985d9090002f7a9c0eea1227517e0f", ref: (el) => this.slotRef = el }));
|
|
87
87
|
}
|
|
88
88
|
static get watchers() {
|
|
89
89
|
return {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Host,
|
|
3
|
+
h,
|
|
4
|
+
registerInstance
|
|
5
|
+
} from "./chunk-UY423IKN.js";
|
|
6
|
+
|
|
7
|
+
// dist/esm/ui-menu-item.entry.js
|
|
8
|
+
var uiMenuItemCss = () => `:host{display:block;width:100%}.menu-item__surface{display:block;box-sizing:border-box;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])) .menu-item__surface{background:var(--ui-surface-subtle)}:host([aria-disabled='true']) .menu-item__surface,:host([disabled]) .menu-item__surface{opacity:0.6;cursor:not-allowed}`;
|
|
9
|
+
var UIMenuItem = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
disabled = false;
|
|
14
|
+
value = "";
|
|
15
|
+
render() {
|
|
16
|
+
return h(Host, { key: "711e7f70268d23969e40073cd47b065afadc22c9", role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? "true" : void 0, "data-value": this.value || void 0 }, h("span", { key: "d0c0aff983bdbc48666fcd652b39340bfd92c790", class: "menu-item__surface" }, h("slot", { key: "3fc6111848142b388529a9cdb5f6134bffe8fa42" })));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
UIMenuItem.style = uiMenuItemCss();
|
|
20
|
+
export {
|
|
21
|
+
UIMenuItem as ui_menu_item
|
|
22
|
+
};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dispatchDetail,
|
|
3
|
-
eventToTrigger
|
|
4
|
-
} from "./chunk-UL7UIUJZ.js";
|
|
5
1
|
import {
|
|
6
2
|
closeOverlay,
|
|
7
3
|
openOverlay,
|
|
@@ -10,15 +6,23 @@ import {
|
|
|
10
6
|
import {
|
|
11
7
|
createAnchoredSurface
|
|
12
8
|
} from "./chunk-YHXJC5M5.js";
|
|
9
|
+
import {
|
|
10
|
+
controlledOrDefault,
|
|
11
|
+
isControlled
|
|
12
|
+
} from "./chunk-HNFCGIBP.js";
|
|
13
|
+
import {
|
|
14
|
+
dispatchDetail,
|
|
15
|
+
eventToTrigger
|
|
16
|
+
} from "./chunk-UL7UIUJZ.js";
|
|
13
17
|
import {
|
|
14
18
|
Host,
|
|
15
19
|
getElement,
|
|
16
20
|
h,
|
|
17
21
|
registerInstance
|
|
18
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UY423IKN.js";
|
|
19
23
|
|
|
20
24
|
// dist/esm/ui-menu.entry.js
|
|
21
|
-
var uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)
|
|
25
|
+
var uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;box-sizing:border-box;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:auto;max-block-size:calc(100dvh - (var(--ui-menu-viewport-gap) * 2));opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}::slotted(ui-menu-item){display:block;width:100%}`;
|
|
22
26
|
var UIMenu = class {
|
|
23
27
|
constructor(hostRef) {
|
|
24
28
|
registerInstance(this, hostRef);
|
|
@@ -26,7 +30,8 @@ var UIMenu = class {
|
|
|
26
30
|
get host() {
|
|
27
31
|
return getElement(this);
|
|
28
32
|
}
|
|
29
|
-
open
|
|
33
|
+
/** Controlled open state. Omit it to use defaultOpen and local interaction state. */
|
|
34
|
+
open;
|
|
30
35
|
defaultOpen = false;
|
|
31
36
|
/** Id of the control that anchors this menu in the top layer. */
|
|
32
37
|
for;
|
|
@@ -37,7 +42,8 @@ var UIMenu = class {
|
|
|
37
42
|
anchor = null;
|
|
38
43
|
surface = null;
|
|
39
44
|
syncFromProp() {
|
|
40
|
-
|
|
45
|
+
if (isControlled(this.open))
|
|
46
|
+
this.internalOpen = this.open;
|
|
41
47
|
}
|
|
42
48
|
resetSurface() {
|
|
43
49
|
this.setupSurface();
|
|
@@ -63,8 +69,7 @@ var UIMenu = class {
|
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
componentDidLoad() {
|
|
66
|
-
this.
|
|
67
|
-
this.internalOpen = this.internalOpen || this.defaultOpen;
|
|
72
|
+
this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
|
|
68
73
|
this.host.addEventListener("click", this.onItemClick);
|
|
69
74
|
this.host.addEventListener("keydown", this.onKeydown);
|
|
70
75
|
this.setupSurface();
|
|
@@ -97,7 +102,8 @@ var UIMenu = class {
|
|
|
97
102
|
closeMenu(reason, trigger) {
|
|
98
103
|
if (!this.internalOpen)
|
|
99
104
|
return;
|
|
100
|
-
this.
|
|
105
|
+
if (!isControlled(this.open))
|
|
106
|
+
this.internalOpen = false;
|
|
101
107
|
dispatchDetail(this.host, "close", {
|
|
102
108
|
open: false,
|
|
103
109
|
reason,
|
|
@@ -125,7 +131,8 @@ var UIMenu = class {
|
|
|
125
131
|
reason: "action",
|
|
126
132
|
trigger: eventToTrigger(e)
|
|
127
133
|
});
|
|
128
|
-
this.
|
|
134
|
+
if (!isControlled(this.open))
|
|
135
|
+
this.internalOpen = false;
|
|
129
136
|
};
|
|
130
137
|
onKeydown = (e) => {
|
|
131
138
|
if (e.key === "Escape") {
|
|
@@ -148,7 +155,8 @@ var UIMenu = class {
|
|
|
148
155
|
reason: "action",
|
|
149
156
|
trigger: "keyboard"
|
|
150
157
|
});
|
|
151
|
-
this.
|
|
158
|
+
if (!isControlled(this.open))
|
|
159
|
+
this.internalOpen = false;
|
|
152
160
|
}
|
|
153
161
|
return;
|
|
154
162
|
}
|
|
@@ -159,7 +167,7 @@ var UIMenu = class {
|
|
|
159
167
|
}
|
|
160
168
|
};
|
|
161
169
|
render() {
|
|
162
|
-
return h(Host, { key: "
|
|
170
|
+
return h(Host, { key: "afba5a7f63238afdb6f71a3636c1f294d3e8ac6f", role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? "" : void 0 }, h("div", { key: "50d770efd27dddca436b804f10f1cc40bc604cb5", class: "menu__surface" }, h("slot", { key: "5014fc43a0ee2d66168bbcc1d52b20bd5120acb9" })));
|
|
163
171
|
}
|
|
164
172
|
static get watchers() {
|
|
165
173
|
return {
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Host,
|
|
3
|
+
createEvent,
|
|
4
|
+
getElement,
|
|
5
|
+
h,
|
|
6
|
+
registerInstance
|
|
7
|
+
} from "./chunk-UY423IKN.js";
|
|
8
|
+
|
|
9
|
+
// dist/esm/ui-multi-combobox.entry.js
|
|
10
|
+
var uiMultiComboboxCss = () => `:host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(field){flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}ui-combobox::part(input){flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;max-inline-size:100%;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
|
|
11
|
+
var UIMultiCombobox = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
registerInstance(this, hostRef);
|
|
14
|
+
this.queryChange = createEvent(this, "query-change");
|
|
15
|
+
this.addItem = createEvent(this, "add-item");
|
|
16
|
+
this.removeItem = createEvent(this, "remove-item");
|
|
17
|
+
this.createItem = createEvent(this, "create-item");
|
|
18
|
+
this.optionsChange = createEvent(this, "options-change");
|
|
19
|
+
}
|
|
20
|
+
get host() {
|
|
21
|
+
return getElement(this);
|
|
22
|
+
}
|
|
23
|
+
label = "";
|
|
24
|
+
placeholder = "";
|
|
25
|
+
items = [];
|
|
26
|
+
config = {};
|
|
27
|
+
query;
|
|
28
|
+
defaultQuery = "";
|
|
29
|
+
disabled = false;
|
|
30
|
+
readOnly = false;
|
|
31
|
+
required = false;
|
|
32
|
+
name = "";
|
|
33
|
+
queryChange;
|
|
34
|
+
addItem;
|
|
35
|
+
removeItem;
|
|
36
|
+
createItem;
|
|
37
|
+
optionsChange;
|
|
38
|
+
raw = "";
|
|
39
|
+
rows = [];
|
|
40
|
+
combobox;
|
|
41
|
+
filteredConfig;
|
|
42
|
+
filteredConfigSource;
|
|
43
|
+
filteredSelection = "";
|
|
44
|
+
componentWillLoad() {
|
|
45
|
+
this.raw = this.query ?? this.defaultQuery;
|
|
46
|
+
}
|
|
47
|
+
syncQuery() {
|
|
48
|
+
if (this.query !== void 0)
|
|
49
|
+
this.raw = this.query;
|
|
50
|
+
}
|
|
51
|
+
get selectedValues() {
|
|
52
|
+
return new Set(this.items.map((item) => item.value));
|
|
53
|
+
}
|
|
54
|
+
get comboboxConfig() {
|
|
55
|
+
const selectionKey = this.items.map((item) => item.value).join("\0");
|
|
56
|
+
if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
|
|
57
|
+
return this.filteredConfig;
|
|
58
|
+
}
|
|
59
|
+
const ownerFilter = this.config.filter;
|
|
60
|
+
const selected = this.selectedValues;
|
|
61
|
+
this.filteredConfigSource = this.config;
|
|
62
|
+
this.filteredSelection = selectionKey;
|
|
63
|
+
this.filteredConfig = {
|
|
64
|
+
...this.config,
|
|
65
|
+
filter: (option, query, context) => !selected.has(option.value) && (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()))
|
|
66
|
+
};
|
|
67
|
+
return this.filteredConfig;
|
|
68
|
+
}
|
|
69
|
+
setQuery(query, trigger) {
|
|
70
|
+
if (this.query === void 0)
|
|
71
|
+
this.raw = query;
|
|
72
|
+
this.queryChange.emit({ query, display: query, trigger });
|
|
73
|
+
}
|
|
74
|
+
onQueryChange = (event) => {
|
|
75
|
+
event.stopPropagation();
|
|
76
|
+
this.setQuery(event.detail.query, event.detail.trigger);
|
|
77
|
+
};
|
|
78
|
+
onOptionsChange = (event) => {
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
this.rows = event.detail;
|
|
81
|
+
this.optionsChange.emit(event.detail);
|
|
82
|
+
};
|
|
83
|
+
onValueChange = (event) => {
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
if (event.detail.kind !== "selection" || !event.detail.option)
|
|
86
|
+
return;
|
|
87
|
+
const item = event.detail.option;
|
|
88
|
+
this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
|
|
89
|
+
queueMicrotask(() => this.setQuery("", event.detail.trigger));
|
|
90
|
+
};
|
|
91
|
+
onCreateEntry = (event) => {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
const query = event.detail.query.trim();
|
|
94
|
+
if (!query)
|
|
95
|
+
return;
|
|
96
|
+
this.setQuery("", event.detail.trigger);
|
|
97
|
+
this.createItem.emit({ query, trigger: event.detail.trigger });
|
|
98
|
+
};
|
|
99
|
+
remove(index, trigger) {
|
|
100
|
+
const item = this.items[index];
|
|
101
|
+
if (!item || item.disabled || this.disabled || this.readOnly)
|
|
102
|
+
return;
|
|
103
|
+
this.removeItem.emit({ item, index, trigger });
|
|
104
|
+
requestAnimationFrame(() => {
|
|
105
|
+
const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
|
|
106
|
+
const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
|
|
107
|
+
if (next && next.dataset.value !== item.value)
|
|
108
|
+
next.focus();
|
|
109
|
+
else
|
|
110
|
+
void this.focusInput();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
focusItem(index) {
|
|
114
|
+
this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
|
|
115
|
+
}
|
|
116
|
+
onItemKeyDown = (event, index) => {
|
|
117
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
118
|
+
return;
|
|
119
|
+
if (event.key === "ArrowLeft") {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
event.stopPropagation();
|
|
122
|
+
this.focusItem(Math.max(0, index - 1));
|
|
123
|
+
} else if (event.key === "ArrowRight") {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
event.stopPropagation();
|
|
126
|
+
if (index === this.items.length - 1)
|
|
127
|
+
void this.focusInput();
|
|
128
|
+
else
|
|
129
|
+
this.focusItem(index + 1);
|
|
130
|
+
} else if (event.key === "Backspace" || event.key === "Delete") {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
event.stopPropagation();
|
|
133
|
+
this.remove(index, "keyboard");
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
onKeyDown = (event) => {
|
|
137
|
+
if (event.defaultPrevented || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
138
|
+
return;
|
|
139
|
+
const input = event.composedPath().find((node) => node instanceof HTMLInputElement);
|
|
140
|
+
if (!input || this.raw || (input.selectionStart ?? 0) > 0)
|
|
141
|
+
return;
|
|
142
|
+
if (event.key === "ArrowLeft" && this.items.length) {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
this.focusItem(this.items.length - 1);
|
|
145
|
+
} else if (event.key === "Backspace" && this.items.length) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
this.remove(this.items.length - 1, "keyboard");
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
async focusInput() {
|
|
151
|
+
await this.combobox?.focusInput();
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
return h(Host, { key: "bdb03a28ea25b22340dc56381fa45031f0c47c27", onKeyDown: this.onKeyDown }, h("ui-combobox", { key: "51ba1ab747af9f216223bd71f524db79ef57b8a9", ref: (element) => this.combobox = element, label: this.label, "label-visibility": "sr-only", placeholder: this.placeholder, name: this.name, value: null, query: this.raw, config: this.comboboxConfig, size: "sm", disabled: this.disabled, readOnly: this.readOnly, required: this.required, "onQuery-change": this.onQueryChange, "onValue-change": this.onValueChange, "onCreate-entry": this.onCreateEntry, "onOptions-change": this.onOptionsChange }, h("div", { key: "ebd8fd8e62db3c2e47b1bfc7558c01e7e1abb8ba", slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index) => h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: (event) => this.onItemKeyDown(event, index) }, h("slot", { name: `item-${item.id}` }, h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map((option) => h("span", { slot: `option-${option.id}` }, h("slot", { name: `option-${option.id}` }, option.label))), h("span", { key: "99cd9848130de37e52a4f735c95e3754dbc64691", slot: "create" }, h("slot", { key: "84cc7c14716819bd968bdfcb9213fe3887a5c2b9", name: "create" }, "Create \u201C", this.raw, "\u201D")), h("span", { key: "1660eb03425dea4d36797e416d91b051531a470d", slot: "loading" }, h("slot", { key: "10c979403e89331e8bdf69ff2db3f5bc272b2685", name: "loading" }, "Loading suggestions\u2026")), h("span", { key: "1c862b6c5906aa3ec5fc874de5a5119e13ef9422", slot: "empty" }, h("slot", { key: "1c70a1beb7321d3b2be888b3826a1dba2f6fcc70", name: "empty" }, "No suggestions.")), h("span", { key: "4b4da5cb8b22543b90ff9230191bbb2e81d16408", slot: "error" }, h("slot", { key: "a371a5ce50895562ebc6e55227e4a4834af37f3d", name: "error" }, "Unable to load suggestions.")), h("div", { key: "f82e38165d90bdbfa8413c0a561abf7ab5da0183", slot: "footer" }, h("slot", { key: "6c0bd2b89428832f4cb485f5d2e30a792859ba9e", name: "footer" }))));
|
|
155
|
+
}
|
|
156
|
+
static get watchers() {
|
|
157
|
+
return {
|
|
158
|
+
"query": [{
|
|
159
|
+
"syncQuery": 0
|
|
160
|
+
}]
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
UIMultiCombobox.style = uiMultiComboboxCss();
|
|
165
|
+
export {
|
|
166
|
+
UIMultiCombobox as ui_multi_combobox
|
|
167
|
+
};
|