@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
|
@@ -55,7 +55,7 @@ function createHoverIntent(delay, onIntent) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const uiTreeCss = () => `:host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter
|
|
58
|
+
const uiTreeCss = () => `:host{--ui-tree-indent:16px;--ui-tree-gutter:0px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
|
|
59
59
|
|
|
60
60
|
const UITree = class {
|
|
61
61
|
constructor(hostRef) {
|
|
@@ -73,6 +73,8 @@ const UITree = class {
|
|
|
73
73
|
rejectedPosition = null;
|
|
74
74
|
rejection = null;
|
|
75
75
|
hoverIntent = null;
|
|
76
|
+
structureObserver = null;
|
|
77
|
+
tabStop = null;
|
|
76
78
|
componentDidLoad() {
|
|
77
79
|
this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
|
|
78
80
|
this.host.addEventListener('dragstart', this.onDragStart);
|
|
@@ -83,6 +85,11 @@ const UITree = class {
|
|
|
83
85
|
this.host.addEventListener('drop', this.onDrop);
|
|
84
86
|
this.host.addEventListener('dragend', this.onDragEnd);
|
|
85
87
|
this.host.addEventListener('keydown', this.onKeyDown);
|
|
88
|
+
this.host.addEventListener('focusin', this.onFocusIn);
|
|
89
|
+
this.host.addEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
90
|
+
this.syncStructuralLevels();
|
|
91
|
+
this.structureObserver = new MutationObserver(this.syncStructuralLevels);
|
|
92
|
+
this.structureObserver.observe(this.host, { childList: true, subtree: true });
|
|
86
93
|
}
|
|
87
94
|
disconnectedCallback() {
|
|
88
95
|
this.hoverIntent?.destroy();
|
|
@@ -94,10 +101,44 @@ const UITree = class {
|
|
|
94
101
|
this.host.removeEventListener('drop', this.onDrop);
|
|
95
102
|
this.host.removeEventListener('dragend', this.onDragEnd);
|
|
96
103
|
this.host.removeEventListener('keydown', this.onKeyDown);
|
|
104
|
+
this.host.removeEventListener('focusin', this.onFocusIn);
|
|
105
|
+
this.host.removeEventListener('ui-tree-expansion-change', this.onExpansionChange);
|
|
106
|
+
this.structureObserver?.disconnect();
|
|
107
|
+
this.structureObserver = null;
|
|
108
|
+
}
|
|
109
|
+
syncStructuralLevels = () => {
|
|
110
|
+
for (const item of Array.from(this.host.querySelectorAll('ui-tree-item'))) {
|
|
111
|
+
item.dispatchEvent(new CustomEvent('ui-tree-structure-sync'));
|
|
112
|
+
}
|
|
113
|
+
this.syncTabStop();
|
|
114
|
+
};
|
|
115
|
+
syncTabStop(preferred) {
|
|
116
|
+
const items = this.visibleItems();
|
|
117
|
+
const next = preferred && items.includes(preferred)
|
|
118
|
+
? preferred
|
|
119
|
+
: this.tabStop && items.includes(this.tabStop)
|
|
120
|
+
? this.tabStop
|
|
121
|
+
: items[0] ?? null;
|
|
122
|
+
this.tabStop = next;
|
|
123
|
+
for (const item of items) {
|
|
124
|
+
item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
|
|
125
|
+
detail: { active: item === next },
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
97
128
|
}
|
|
98
129
|
itemFromEvent(event) {
|
|
99
130
|
return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
|
|
100
131
|
}
|
|
132
|
+
eventTargetsInteractiveContent(event) {
|
|
133
|
+
for (const node of event.composedPath()) {
|
|
134
|
+
if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
|
|
135
|
+
break;
|
|
136
|
+
if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
101
142
|
itemId(item) {
|
|
102
143
|
return item.itemId || item.getAttribute('item-id') || '';
|
|
103
144
|
}
|
|
@@ -145,9 +186,23 @@ const UITree = class {
|
|
|
145
186
|
const dropDepth = item.getAttribute('drop-depth');
|
|
146
187
|
if (dropDepth !== null)
|
|
147
188
|
return Number(dropDepth);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
189
|
+
return Number(item.getAttribute('aria-level')) || 1;
|
|
190
|
+
}
|
|
191
|
+
subtreeDepth(item) {
|
|
192
|
+
if (item.subtreeDepth !== undefined)
|
|
193
|
+
return Math.max(0, Math.floor(item.subtreeDepth));
|
|
194
|
+
const override = item.getAttribute('subtree-depth');
|
|
195
|
+
if (override !== null)
|
|
196
|
+
return Math.max(0, Math.floor(Number(override)));
|
|
197
|
+
return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
|
|
198
|
+
let nesting = 0;
|
|
199
|
+
let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
|
|
200
|
+
while (ancestor && ancestor !== item) {
|
|
201
|
+
nesting += 1;
|
|
202
|
+
ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
|
|
203
|
+
}
|
|
204
|
+
return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
|
|
205
|
+
}, 0);
|
|
151
206
|
}
|
|
152
207
|
dropRejection(source, target, position) {
|
|
153
208
|
// A tree item can never move into (or beside) one of its own descendants.
|
|
@@ -167,9 +222,9 @@ const UITree = class {
|
|
|
167
222
|
return { reason: 'incompatible' };
|
|
168
223
|
}
|
|
169
224
|
const maxDepth = Math.max(0, Math.floor(this.maxDepth));
|
|
170
|
-
if (maxDepth > 0
|
|
225
|
+
if (maxDepth > 0) {
|
|
171
226
|
const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
|
|
172
|
-
const subtreeDepth =
|
|
227
|
+
const subtreeDepth = this.subtreeDepth(source);
|
|
173
228
|
const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
|
|
174
229
|
if (resultingDepth > maxDepth)
|
|
175
230
|
return { reason: 'max-depth', maxDepth, resultingDepth };
|
|
@@ -365,7 +420,35 @@ const UITree = class {
|
|
|
365
420
|
return Array.from(this.host.querySelectorAll('ui-tree-item'))
|
|
366
421
|
.filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
|
|
367
422
|
}
|
|
423
|
+
parentItem(item) {
|
|
424
|
+
const parent = item.parentElement?.closest('ui-tree-item') ?? null;
|
|
425
|
+
return parent && this.host.contains(parent) ? parent : null;
|
|
426
|
+
}
|
|
427
|
+
firstVisibleChild(item, items) {
|
|
428
|
+
return items.find(candidate => this.parentItem(candidate) === item) ?? null;
|
|
429
|
+
}
|
|
430
|
+
focusItem(item) {
|
|
431
|
+
this.syncTabStop(item);
|
|
432
|
+
item.focus();
|
|
433
|
+
}
|
|
434
|
+
requestExpansion(item, expanded) {
|
|
435
|
+
item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
|
|
436
|
+
detail: { expanded, trigger: 'keyboard' },
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
onFocusIn = (event) => {
|
|
440
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
441
|
+
return;
|
|
442
|
+
const item = this.itemFromEvent(event);
|
|
443
|
+
if (item)
|
|
444
|
+
this.syncTabStop(item);
|
|
445
|
+
};
|
|
446
|
+
onExpansionChange = () => {
|
|
447
|
+
requestAnimationFrame(() => this.syncTabStop());
|
|
448
|
+
};
|
|
368
449
|
onKeyDown = (event) => {
|
|
450
|
+
if (this.eventTargetsInteractiveContent(event))
|
|
451
|
+
return;
|
|
369
452
|
const current = this.itemFromEvent(event);
|
|
370
453
|
if (!current)
|
|
371
454
|
return;
|
|
@@ -373,14 +456,43 @@ const UITree = class {
|
|
|
373
456
|
const index = items.indexOf(current);
|
|
374
457
|
if (index < 0)
|
|
375
458
|
return;
|
|
376
|
-
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
377
|
-
|
|
459
|
+
const next = event.key === 'ArrowDown' ? items[index + 1]
|
|
460
|
+
: event.key === 'ArrowUp' ? items[index - 1]
|
|
461
|
+
: event.key === 'Home' ? items[0]
|
|
462
|
+
: event.key === 'End' ? items.at(-1)
|
|
463
|
+
: null;
|
|
464
|
+
if (next) {
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
this.focusItem(next);
|
|
378
467
|
return;
|
|
379
|
-
|
|
380
|
-
|
|
468
|
+
}
|
|
469
|
+
if (event.key === 'ArrowLeft') {
|
|
470
|
+
if (current.getAttribute('aria-expanded') === 'true') {
|
|
471
|
+
event.preventDefault();
|
|
472
|
+
this.requestExpansion(current, false);
|
|
473
|
+
}
|
|
474
|
+
else if (this.parentItem(current)) {
|
|
475
|
+
event.preventDefault();
|
|
476
|
+
this.focusItem(this.parentItem(current));
|
|
477
|
+
}
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (event.key === 'ArrowRight') {
|
|
481
|
+
if (current.getAttribute('aria-expanded') === 'false') {
|
|
482
|
+
event.preventDefault();
|
|
483
|
+
this.requestExpansion(current, true);
|
|
484
|
+
}
|
|
485
|
+
else if (current.getAttribute('aria-expanded') === 'true') {
|
|
486
|
+
const child = this.firstVisibleChild(current, items);
|
|
487
|
+
if (child) {
|
|
488
|
+
event.preventDefault();
|
|
489
|
+
this.focusItem(child);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
381
493
|
};
|
|
382
494
|
render() {
|
|
383
|
-
return (index.h(index.Host, { key: '
|
|
495
|
+
return (index.h(index.Host, { key: '7efbf793fe63471006df57f0045a5fe995c81440', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: '1804e391796e7451c93cb58258e0e23ec3ad98c7' })));
|
|
384
496
|
}
|
|
385
497
|
};
|
|
386
498
|
UITree.style = uiTreeCss();
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
"components/ui-callout/ui-callout.js",
|
|
3
4
|
"components/ui-affordance-scope/ui-affordance-scope.js",
|
|
4
5
|
"components/ui-avatar/ui-avatar.js",
|
|
5
6
|
"components/ui-avatar-group/ui-avatar-group.js",
|
|
6
7
|
"components/ui-badge/ui-badge.js",
|
|
7
8
|
"components/ui-button/ui-button.js",
|
|
8
9
|
"components/ui-checkbox/ui-checkbox.js",
|
|
10
|
+
"components/ui-chip/ui-chip.js",
|
|
9
11
|
"components/ui-combobox/ui-combobox.js",
|
|
10
12
|
"components/ui-context-menu/ui-context-menu.js",
|
|
11
13
|
"components/ui-dialog/ui-dialog.js",
|
|
12
14
|
"components/ui-disclosure/ui-disclosure.js",
|
|
15
|
+
"components/ui-editable/ui-editable.js",
|
|
13
16
|
"components/ui-floating-action-button/ui-floating-action-button.js",
|
|
14
17
|
"components/ui-form-field/ui-form-field.js",
|
|
15
18
|
"components/ui-icon-button/ui-icon-button.js",
|
|
16
19
|
"components/ui-input/ui-input.js",
|
|
17
20
|
"components/ui-menu/ui-menu.js",
|
|
18
21
|
"components/ui-menu-item/ui-menu-item.js",
|
|
22
|
+
"components/ui-multi-combobox/ui-multi-combobox.js",
|
|
19
23
|
"components/ui-popover/ui-popover.js",
|
|
20
24
|
"components/ui-radio/ui-radio.js",
|
|
21
25
|
"components/ui-radio-group/ui-radio-group.js",
|
|
@@ -22,7 +22,7 @@ export class UIAffordanceScope {
|
|
|
22
22
|
this.coordinator?.refresh();
|
|
23
23
|
};
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: 'f500fa48554ed6224efd2dbe9632880bf0a15a19' }, h("slot", { key: '37c5c5b7925b260ff8f9edd411ee6c90a12a4909', onSlotchange: this.onSlotChange })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "ui-affordance-scope"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.avatar {
|
|
2
6
|
display: inline-grid;
|
|
3
7
|
place-items: center;
|
|
4
8
|
overflow: hidden;
|
|
@@ -14,10 +18,6 @@
|
|
|
14
18
|
text-transform: uppercase;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
.avatar {
|
|
18
|
-
display: contents;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
21
|
.avatar img {
|
|
22
22
|
grid-area: 1 / 1;
|
|
23
23
|
inline-size: 100%;
|
|
@@ -18,7 +18,7 @@ export class UIAvatar {
|
|
|
18
18
|
render() {
|
|
19
19
|
const fallbackText = this.fallback || toInitials(this.name || this.alt);
|
|
20
20
|
const label = this.alt || this.name || 'Avatar';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'bbe6c3a775702022a19d819a6cc9d81d798cb3e1', role: "img", "aria-label": label, "data-has-image": this.hasImage ? '' : undefined }, h("div", { key: '63402327ba5bde122bf5deaea09baf965ee9b047', class: "avatar" }, h("img", { key: 'e52b86773684b80d76efa459cb03ae40881f959b', src: this.src, alt: label, onLoad: this.onImageLoad, onError: this.onImageError, hidden: !this.hasImage, "aria-hidden": this.hasImage ? 'false' : 'true' }), h("span", { key: '82a6d8f0d0c69ca52f81d092a2292fc80238265b', class: "fallback", hidden: this.hasImage, "aria-hidden": this.hasImage ? 'true' : 'false' }, fallbackText))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "ui-avatar"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
gap: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
::slotted(
|
|
8
|
+
::slotted(*) {
|
|
9
9
|
margin-inline-end: -0.5rem;
|
|
10
10
|
flex-shrink: 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
::slotted(*:last-of-type
|
|
13
|
+
::slotted(*:last-of-type) {
|
|
14
14
|
margin-inline-end: 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
const OVERFLOW_ATTR = 'data-ui-avatar-group-overflow';
|
|
3
2
|
export class UIAvatarGroup {
|
|
4
3
|
host;
|
|
5
4
|
max = 5;
|
|
6
5
|
label = 'People';
|
|
7
6
|
overflowCount = 0;
|
|
8
|
-
slotRef;
|
|
9
7
|
syncOverflow() {
|
|
10
8
|
this.updateOverflow();
|
|
11
9
|
}
|
|
12
10
|
componentDidLoad() {
|
|
13
|
-
this.slotRef?.addEventListener('slotchange', () => this.updateOverflow());
|
|
14
11
|
this.updateOverflow();
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
this.
|
|
13
|
+
visibleLimit() {
|
|
14
|
+
return Number.isFinite(this.max) ? Math.max(0, Math.floor(this.max)) : 0;
|
|
18
15
|
}
|
|
19
16
|
updateOverflow() {
|
|
20
|
-
const
|
|
21
|
-
const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
|
|
22
|
-
const children = nodes.filter((el) => !el.hasAttribute(OVERFLOW_ATTR));
|
|
17
|
+
const children = Array.from(this.host.children);
|
|
23
18
|
const total = children.length;
|
|
24
|
-
const
|
|
25
|
-
const overflowCount = total >
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
el.setAttribute('aria-hidden', String(i >= visibleCount));
|
|
29
|
-
});
|
|
30
|
-
this.overflowCount = overflowCount;
|
|
19
|
+
const visibleLimit = this.visibleLimit();
|
|
20
|
+
const overflowCount = total > visibleLimit ? total - visibleLimit : 0;
|
|
21
|
+
if (this.overflowCount !== overflowCount)
|
|
22
|
+
this.overflowCount = overflowCount;
|
|
31
23
|
}
|
|
32
24
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '9ba6693cabc379bbbe6f5698160481f27fe02f31', role: "group", "aria-label": this.label || undefined }, h("style", { key: 'ed231fe96c16a3cdd5a66d4828664c75c6959a9e' }, `::slotted(:nth-child(n + ${this.visibleLimit() + 1})) { display: none !important; }`), h("slot", { key: '463005a7f3c498c80c768151ab32c873ff1abf86', onSlotchange: () => this.updateOverflow() }), this.overflowCount > 0 && (h("span", { key: 'dc1ba88fd97ca461e6518d223f00a93416e6d0f0', class: "overflow", role: "img", "aria-label": `${this.overflowCount} more ${this.overflowCount === 1 ? 'person' : 'people'}`, "data-ui-avatar-group-overflow": true }, "+", this.overflowCount))));
|
|
34
26
|
}
|
|
35
27
|
static get is() { return "ui-avatar-group"; }
|
|
36
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,74 +1,90 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
--ui-badge-surface: var(--ui-surface-muted);
|
|
3
|
+
--ui-badge-text: var(--ui-text-secondary);
|
|
4
|
+
--ui-badge-border: var(--ui-border-default);
|
|
5
|
+
--ui-badge-font-size: var(--ui-font-size-xs);
|
|
6
|
+
--ui-badge-font-weight: var(--ui-font-normal);
|
|
7
|
+
--ui-badge-line-height: var(--ui-line-height-tight);
|
|
8
|
+
--ui-badge-padding-block: var(--ui-space-0-5);
|
|
9
|
+
--ui-badge-padding-inline: var(--ui-space-2);
|
|
10
|
+
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.badge__surface {
|
|
2
16
|
display: inline-flex;
|
|
3
17
|
align-items: center;
|
|
4
18
|
justify-content: center;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
padding: var(--ui-badge-padding-block) var(--ui-badge-padding-inline);
|
|
21
|
+
border: 1px solid var(--ui-badge-border);
|
|
22
|
+
border-radius: var(--ui-radius-round);
|
|
23
|
+
background: var(--ui-badge-surface);
|
|
24
|
+
color: var(--ui-badge-text);
|
|
25
|
+
font-family: var(--ui-font-family-sans);
|
|
26
|
+
font-size: var(--ui-badge-font-size);
|
|
27
|
+
font-weight: var(--ui-badge-font-weight);
|
|
28
|
+
line-height: var(--ui-badge-line-height);
|
|
13
29
|
white-space: nowrap;
|
|
14
30
|
}
|
|
15
31
|
|
|
16
|
-
:host([data-tone='accent']) {
|
|
17
|
-
|
|
18
|
-
border
|
|
19
|
-
|
|
32
|
+
:host([data-tone='accent']) .badge__surface {
|
|
33
|
+
--ui-badge-surface: var(--ui-accent-solid);
|
|
34
|
+
--ui-badge-border: var(--ui-accent-solid);
|
|
35
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
20
36
|
}
|
|
21
37
|
|
|
22
|
-
:host([data-tone='danger']) {
|
|
23
|
-
|
|
24
|
-
border
|
|
25
|
-
|
|
38
|
+
:host([data-tone='danger']) .badge__surface {
|
|
39
|
+
--ui-badge-surface: var(--ui-danger-solid);
|
|
40
|
+
--ui-badge-border: var(--ui-danger-solid);
|
|
41
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
26
42
|
}
|
|
27
43
|
|
|
28
|
-
:host([data-tone='success']) {
|
|
29
|
-
|
|
30
|
-
border
|
|
31
|
-
|
|
44
|
+
:host([data-tone='success']) .badge__surface {
|
|
45
|
+
--ui-badge-surface: var(--ui-success-solid);
|
|
46
|
+
--ui-badge-border: var(--ui-success-solid);
|
|
47
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
32
48
|
}
|
|
33
49
|
|
|
34
|
-
:host([data-tone='warning']) {
|
|
35
|
-
|
|
36
|
-
border
|
|
37
|
-
|
|
50
|
+
:host([data-tone='warning']) .badge__surface {
|
|
51
|
+
--ui-badge-surface: var(--ui-warning-solid);
|
|
52
|
+
--ui-badge-border: var(--ui-warning-solid);
|
|
53
|
+
--ui-badge-text: var(--ui-text-primary);
|
|
38
54
|
}
|
|
39
55
|
|
|
40
|
-
:host([data-tone='info']) {
|
|
41
|
-
|
|
42
|
-
border
|
|
43
|
-
|
|
56
|
+
:host([data-tone='info']) .badge__surface {
|
|
57
|
+
--ui-badge-surface: var(--ui-info-solid);
|
|
58
|
+
--ui-badge-border: var(--ui-info-solid);
|
|
59
|
+
--ui-badge-text: var(--ui-text-on-accent);
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
:host([data-variant='subtle'][data-tone='accent']) {
|
|
47
|
-
|
|
48
|
-
border
|
|
49
|
-
|
|
62
|
+
:host([data-variant='subtle'][data-tone='accent']) .badge__surface {
|
|
63
|
+
--ui-badge-surface: var(--ui-accent-soft);
|
|
64
|
+
--ui-badge-border: var(--ui-accent-soft);
|
|
65
|
+
--ui-badge-text: var(--ui-accent-solid);
|
|
50
66
|
}
|
|
51
67
|
|
|
52
|
-
:host([data-variant='subtle'][data-tone='danger']) {
|
|
53
|
-
|
|
54
|
-
border
|
|
55
|
-
|
|
68
|
+
:host([data-variant='subtle'][data-tone='danger']) .badge__surface {
|
|
69
|
+
--ui-badge-surface: var(--ui-danger-soft);
|
|
70
|
+
--ui-badge-border: var(--ui-danger-soft);
|
|
71
|
+
--ui-badge-text: var(--ui-danger-solid);
|
|
56
72
|
}
|
|
57
73
|
|
|
58
|
-
:host([data-variant='subtle'][data-tone='success']) {
|
|
59
|
-
|
|
60
|
-
border
|
|
61
|
-
|
|
74
|
+
:host([data-variant='subtle'][data-tone='success']) .badge__surface {
|
|
75
|
+
--ui-badge-surface: var(--ui-success-soft);
|
|
76
|
+
--ui-badge-border: var(--ui-success-soft);
|
|
77
|
+
--ui-badge-text: var(--ui-success-solid);
|
|
62
78
|
}
|
|
63
79
|
|
|
64
|
-
:host([data-variant='subtle'][data-tone='warning']) {
|
|
65
|
-
|
|
66
|
-
border
|
|
67
|
-
|
|
80
|
+
:host([data-variant='subtle'][data-tone='warning']) .badge__surface {
|
|
81
|
+
--ui-badge-surface: var(--ui-warning-soft);
|
|
82
|
+
--ui-badge-border: var(--ui-warning-soft);
|
|
83
|
+
--ui-badge-text: var(--ui-warning-solid);
|
|
68
84
|
}
|
|
69
85
|
|
|
70
|
-
:host([data-variant='subtle'][data-tone='info']) {
|
|
71
|
-
|
|
72
|
-
border
|
|
73
|
-
|
|
86
|
+
:host([data-variant='subtle'][data-tone='info']) .badge__surface {
|
|
87
|
+
--ui-badge-surface: var(--ui-info-soft);
|
|
88
|
+
--ui-badge-border: var(--ui-info-soft);
|
|
89
|
+
--ui-badge-text: var(--ui-info-solid);
|
|
74
90
|
}
|
|
@@ -3,7 +3,7 @@ export class UIBadge {
|
|
|
3
3
|
variant;
|
|
4
4
|
tone;
|
|
5
5
|
render() {
|
|
6
|
-
return (h(Host, { key: '
|
|
6
|
+
return (h(Host, { key: 'ba96ade6d037a7ed9958e7eed540e62782f846f0', "data-variant": this.variant || undefined, "data-tone": this.tone || undefined }, h("span", { key: 'a1e9587f59de479c19b9ea7aec8c8e932b998369', class: "badge__surface" }, h("slot", { key: '5835ddcea5cda472e700557528fd3cbc9d572616' }))));
|
|
7
7
|
}
|
|
8
8
|
static get is() { return "ui-badge"; }
|
|
9
9
|
static get encapsulation() { return "shadow"; }
|
|
@@ -45,7 +45,7 @@ export class UIButton {
|
|
|
45
45
|
this.host.click();
|
|
46
46
|
};
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '58a90293e2ac169c8bc3c6cb3d15428cc73629b7', "data-size": this.size || undefined, "data-variant": this.variant, "data-disabled": this.disabled ? 'true' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '05439bdc2af81bcabe9da11b4baf13f880e0a75f', ref: (el) => (this.slotRef = el) })));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "ui-button"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--ui-callout-surface: var(--ui-info-soft);
|
|
3
|
+
--ui-callout-text: var(--ui-text-primary);
|
|
4
|
+
--ui-callout-border: var(--ui-info-solid);
|
|
5
|
+
--ui-callout-icon: var(--ui-info-solid);
|
|
6
|
+
--ui-callout-padding-block: var(--ui-space-2);
|
|
7
|
+
--ui-callout-padding-inline: var(--ui-space-3);
|
|
8
|
+
--ui-callout-icon-column: 1rem;
|
|
9
|
+
--ui-callout-gap: var(--ui-space-2);
|
|
10
|
+
--ui-callout-icon-size: 1rem;
|
|
11
|
+
--ui-callout-border-width: 1px;
|
|
12
|
+
--ui-callout-leading-border-width: 4px;
|
|
13
|
+
|
|
14
|
+
display: block;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.callout__surface {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: var(--ui-callout-icon-column) minmax(0, 1fr);
|
|
21
|
+
gap: var(--ui-callout-gap);
|
|
22
|
+
align-items: start;
|
|
23
|
+
padding: var(--ui-callout-padding-block) var(--ui-callout-padding-inline);
|
|
24
|
+
border: var(--ui-callout-border-width) solid color-mix(in srgb, var(--ui-callout-border) 35%, transparent);
|
|
25
|
+
border-inline-start: var(--ui-callout-leading-border-width) solid var(--ui-callout-border);
|
|
26
|
+
border-radius: var(--ui-radius-2);
|
|
27
|
+
background: var(--ui-callout-surface);
|
|
28
|
+
color: var(--ui-callout-text);
|
|
29
|
+
font-family: var(--ui-font-family-sans);
|
|
30
|
+
font-size: var(--ui-font-size-sm);
|
|
31
|
+
font-weight: var(--ui-font-normal);
|
|
32
|
+
line-height: var(--ui-line-height-md);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.icon {
|
|
36
|
+
display: grid;
|
|
37
|
+
place-items: center;
|
|
38
|
+
inline-size: var(--ui-callout-icon-column);
|
|
39
|
+
block-size: var(--ui-callout-icon-column);
|
|
40
|
+
color: var(--ui-callout-icon);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.icon svg {
|
|
44
|
+
inline-size: var(--ui-callout-icon-size);
|
|
45
|
+
block-size: var(--ui-callout-icon-size);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.content {
|
|
49
|
+
min-inline-size: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([data-tone='note']) {
|
|
53
|
+
--ui-callout-surface: var(--ui-surface-muted);
|
|
54
|
+
--ui-callout-border: var(--ui-border-strong);
|
|
55
|
+
--ui-callout-icon: var(--ui-text-secondary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([data-tone='warning']) {
|
|
59
|
+
--ui-callout-surface: var(--ui-warning-soft);
|
|
60
|
+
--ui-callout-border: var(--ui-warning-solid);
|
|
61
|
+
--ui-callout-icon: var(--ui-warning-solid);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([data-tone='success']) {
|
|
65
|
+
--ui-callout-surface: var(--ui-success-soft);
|
|
66
|
+
--ui-callout-border: var(--ui-success-solid);
|
|
67
|
+
--ui-callout-icon: var(--ui-success-solid);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([data-tone='error']) {
|
|
71
|
+
--ui-callout-surface: var(--ui-danger-soft);
|
|
72
|
+
--ui-callout-border: var(--ui-danger-solid);
|
|
73
|
+
--ui-callout-icon: var(--ui-danger-solid);
|
|
74
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { loomaIconMarkup } from "../../icons";
|
|
3
|
+
const toneIcons = {
|
|
4
|
+
info: 'info',
|
|
5
|
+
note: 'notebook-pen',
|
|
6
|
+
warning: 'triangle-alert',
|
|
7
|
+
success: 'circle-check',
|
|
8
|
+
error: 'circle-x',
|
|
9
|
+
};
|
|
10
|
+
/** A static semantic message with a tone-specific icon. */
|
|
11
|
+
export class UICallout {
|
|
12
|
+
tone = 'info';
|
|
13
|
+
render() {
|
|
14
|
+
const icon = toneIcons[this.tone] ?? toneIcons.info;
|
|
15
|
+
return (h(Host, { key: '94bae6fbb688e5c8da979a3bebc12c51b8689c8a', role: "note", "data-tone": this.tone }, h("div", { key: '8fe1a3dae5b7cd3679d187cef018fa0cd810fb76', class: "callout__surface" }, h("span", { key: 'ed62ad8e29c30489e075631d83f1732d7a53a378', class: "icon", "aria-hidden": "true", innerHTML: loomaIconMarkup(icon) }), h("div", { key: '97638d28e3979f71913c17b2501a90e3a9251f0f', class: "content" }, h("slot", { key: '6a91a0d3f189eae28aabbe278924ba7f89015f34' })))));
|
|
16
|
+
}
|
|
17
|
+
static get is() { return "ui-callout"; }
|
|
18
|
+
static get encapsulation() { return "shadow"; }
|
|
19
|
+
static get originalStyleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["ui-callout.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get styleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["ui-callout.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
"tone": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"mutable": false,
|
|
34
|
+
"complexType": {
|
|
35
|
+
"original": "CalloutTone",
|
|
36
|
+
"resolved": "\"error\" | \"info\" | \"note\" | \"success\" | \"warning\"",
|
|
37
|
+
"references": {
|
|
38
|
+
"CalloutTone": {
|
|
39
|
+
"location": "local",
|
|
40
|
+
"path": "/home/runner/work/looma/looma/packages/core/src/components/ui-callout/ui-callout.tsx",
|
|
41
|
+
"id": "src/components/ui-callout/ui-callout.tsx::CalloutTone"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": ""
|
|
50
|
+
},
|
|
51
|
+
"getter": false,
|
|
52
|
+
"setter": false,
|
|
53
|
+
"reflect": false,
|
|
54
|
+
"attribute": "tone",
|
|
55
|
+
"defaultValue": "'info'"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|