@threadlabs/looma 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/chunk-G53JEAQK.js +94 -0
- package/dist/chunk-OF57X5AR.js +10 -0
- package/dist/chunk-UL7UIUJZ.js +20 -0
- package/dist/chunk-YK4MTZGJ.js +1580 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/events-TcQIzpNv.js +19 -0
- package/dist/cjs/id-CYbKpaYr.js +9 -0
- package/dist/cjs/index-D07f6BOw.js +1569 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/looma.cjs.js +25 -0
- package/dist/cjs/manager-BOpVXb92.js +93 -0
- package/dist/cjs/ui-avatar-group.cjs.entry.js +51 -0
- package/dist/cjs/ui-avatar.cjs.entry.js +50 -0
- package/dist/cjs/ui-badge.cjs.entry.js +19 -0
- package/dist/cjs/ui-button.cjs.entry.js +62 -0
- package/dist/cjs/ui-checkbox.cjs.entry.js +91 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +201 -0
- package/dist/cjs/ui-dialog.cjs.entry.js +93 -0
- package/dist/cjs/ui-disclosure.cjs.entry.js +109 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +20 -0
- package/dist/cjs/ui-form-field.cjs.entry.js +59 -0
- package/dist/cjs/ui-icon-button.cjs.entry.js +21 -0
- package/dist/cjs/ui-input.cjs.entry.js +101 -0
- package/dist/cjs/ui-menu-item.cjs.entry.js +19 -0
- package/dist/cjs/ui-menu.cjs.entry.js +96 -0
- package/dist/cjs/ui-popover.cjs.entry.js +92 -0
- package/dist/cjs/ui-radio-group.cjs.entry.js +134 -0
- package/dist/cjs/ui-radio.cjs.entry.js +85 -0
- package/dist/cjs/ui-search-result-row.cjs.entry.js +47 -0
- package/dist/cjs/ui-search-shell.cjs.entry.js +39 -0
- package/dist/cjs/ui-select.cjs.entry.js +100 -0
- package/dist/cjs/ui-switch.cjs.entry.js +65 -0
- package/dist/cjs/ui-tabs.cjs.entry.js +117 -0
- package/dist/cjs/ui-textarea.cjs.entry.js +106 -0
- package/dist/cjs/ui-toast-region.cjs.entry.js +67 -0
- package/dist/cjs/ui-tooltip.cjs.entry.js +133 -0
- package/dist/cjs/ui-top-bar.cjs.entry.js +43 -0
- package/dist/collection/collection-manifest.json +38 -0
- package/dist/collection/components/ui-avatar/ui-avatar.css +35 -0
- package/dist/collection/components/ui-avatar/ui-avatar.js +130 -0
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +32 -0
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +103 -0
- package/dist/collection/components/ui-badge/ui-badge.css +74 -0
- package/dist/collection/components/ui-badge/ui-badge.js +62 -0
- package/dist/collection/components/ui-button/ui-button.css +101 -0
- package/dist/collection/components/ui-button/ui-button.js +127 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.css +24 -0
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +223 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.css +17 -0
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +272 -0
- package/dist/collection/components/ui-dialog/ui-dialog.css +65 -0
- package/dist/collection/components/ui-dialog/ui-dialog.js +185 -0
- package/dist/collection/components/ui-disclosure/ui-disclosure.css +7 -0
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +182 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +70 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +85 -0
- package/dist/collection/components/ui-form-field/ui-form-field.css +21 -0
- package/dist/collection/components/ui-form-field/ui-form-field.js +125 -0
- package/dist/collection/components/ui-icon-button/ui-icon-button.css +92 -0
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +106 -0
- package/dist/collection/components/ui-input/ui-input.css +46 -0
- package/dist/collection/components/ui-input/ui-input.js +213 -0
- package/dist/collection/components/ui-menu/ui-menu.css +37 -0
- package/dist/collection/components/ui-menu/ui-menu.js +149 -0
- package/dist/collection/components/ui-menu-item/ui-menu-item.css +26 -0
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +64 -0
- package/dist/collection/components/ui-popover/ui-popover.css +8 -0
- package/dist/collection/components/ui-popover/ui-popover.js +144 -0
- package/dist/collection/components/ui-radio/ui-radio.css +22 -0
- package/dist/collection/components/ui-radio/ui-radio.js +213 -0
- package/dist/collection/components/ui-radio-group/ui-radio-group.css +10 -0
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +247 -0
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +80 -0
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +100 -0
- package/dist/collection/components/ui-search-shell/ui-search-shell.css +61 -0
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +46 -0
- package/dist/collection/components/ui-select/ui-select.css +62 -0
- package/dist/collection/components/ui-select/ui-select.js +212 -0
- package/dist/collection/components/ui-switch/ui-switch.css +63 -0
- package/dist/collection/components/ui-switch/ui-switch.js +177 -0
- package/dist/collection/components/ui-tabs/ui-tabs.css +65 -0
- package/dist/collection/components/ui-tabs/ui-tabs.js +190 -0
- package/dist/collection/components/ui-textarea/ui-textarea.css +48 -0
- package/dist/collection/components/ui-textarea/ui-textarea.js +238 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.css +52 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +100 -0
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +14 -0
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +205 -0
- package/dist/collection/components/ui-top-bar/ui-top-bar.css +43 -0
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +52 -0
- package/dist/collection/overlay/manager.js +90 -0
- package/dist/collection/utils/events.js +13 -0
- package/dist/collection/utils/id.js +5 -0
- package/dist/collection/utils/initials.js +11 -0
- package/dist/components/index.d.ts +88 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CIA4RyEp.js +1 -0
- package/dist/components/p-CR7f2MQC.js +1 -0
- package/dist/components/p-JwSoedEO.js +1 -0
- package/dist/components/p-WvL4iAhX.js +1 -0
- package/dist/components/p-hgBUJRDa.js +1 -0
- package/dist/components/ui-avatar-group.d.ts +11 -0
- package/dist/components/ui-avatar-group.js +1 -0
- package/dist/components/ui-avatar.d.ts +11 -0
- package/dist/components/ui-avatar.js +1 -0
- package/dist/components/ui-badge.d.ts +11 -0
- package/dist/components/ui-badge.js +1 -0
- package/dist/components/ui-button.d.ts +11 -0
- package/dist/components/ui-button.js +1 -0
- package/dist/components/ui-checkbox.d.ts +11 -0
- package/dist/components/ui-checkbox.js +1 -0
- package/dist/components/ui-context-menu.d.ts +11 -0
- package/dist/components/ui-context-menu.js +1 -0
- package/dist/components/ui-dialog.d.ts +11 -0
- package/dist/components/ui-dialog.js +1 -0
- package/dist/components/ui-disclosure.d.ts +11 -0
- package/dist/components/ui-disclosure.js +1 -0
- package/dist/components/ui-floating-action-button.d.ts +11 -0
- package/dist/components/ui-floating-action-button.js +1 -0
- package/dist/components/ui-form-field.d.ts +11 -0
- package/dist/components/ui-form-field.js +1 -0
- package/dist/components/ui-icon-button.d.ts +11 -0
- package/dist/components/ui-icon-button.js +1 -0
- package/dist/components/ui-input.d.ts +11 -0
- package/dist/components/ui-input.js +1 -0
- package/dist/components/ui-menu-item.d.ts +11 -0
- package/dist/components/ui-menu-item.js +1 -0
- package/dist/components/ui-menu.d.ts +11 -0
- package/dist/components/ui-menu.js +1 -0
- package/dist/components/ui-popover.d.ts +11 -0
- package/dist/components/ui-popover.js +1 -0
- package/dist/components/ui-radio-group.d.ts +11 -0
- package/dist/components/ui-radio-group.js +1 -0
- package/dist/components/ui-radio.d.ts +11 -0
- package/dist/components/ui-radio.js +1 -0
- package/dist/components/ui-search-result-row.d.ts +11 -0
- package/dist/components/ui-search-result-row.js +1 -0
- package/dist/components/ui-search-shell.d.ts +11 -0
- package/dist/components/ui-search-shell.js +1 -0
- package/dist/components/ui-select.d.ts +11 -0
- package/dist/components/ui-select.js +1 -0
- package/dist/components/ui-switch.d.ts +11 -0
- package/dist/components/ui-switch.js +1 -0
- package/dist/components/ui-tabs.d.ts +11 -0
- package/dist/components/ui-tabs.js +1 -0
- package/dist/components/ui-textarea.d.ts +11 -0
- package/dist/components/ui-textarea.js +1 -0
- package/dist/components/ui-toast-region.d.ts +11 -0
- package/dist/components/ui-toast-region.js +1 -0
- package/dist/components/ui-tooltip.d.ts +11 -0
- package/dist/components/ui-tooltip.js +1 -0
- package/dist/components/ui-top-bar.d.ts +11 -0
- package/dist/components/ui-top-bar.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/events-JwSoedEO.js +15 -0
- package/dist/esm/id-hgBUJRDa.js +7 -0
- package/dist/esm/index-CEeiinfk.js +1561 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/looma.js +21 -0
- package/dist/esm/manager-CR7f2MQC.js +89 -0
- package/dist/esm/ui-avatar-group.entry.js +49 -0
- package/dist/esm/ui-avatar.entry.js +48 -0
- package/dist/esm/ui-badge.entry.js +17 -0
- package/dist/esm/ui-button.entry.js +60 -0
- package/dist/esm/ui-checkbox.entry.js +89 -0
- package/dist/esm/ui-context-menu.entry.js +199 -0
- package/dist/esm/ui-dialog.entry.js +91 -0
- package/dist/esm/ui-disclosure.entry.js +107 -0
- package/dist/esm/ui-floating-action-button.entry.js +18 -0
- package/dist/esm/ui-form-field.entry.js +57 -0
- package/dist/esm/ui-icon-button.entry.js +19 -0
- package/dist/esm/ui-input.entry.js +99 -0
- package/dist/esm/ui-menu-item.entry.js +17 -0
- package/dist/esm/ui-menu.entry.js +94 -0
- package/dist/esm/ui-popover.entry.js +90 -0
- package/dist/esm/ui-radio-group.entry.js +132 -0
- package/dist/esm/ui-radio.entry.js +83 -0
- package/dist/esm/ui-search-result-row.entry.js +45 -0
- package/dist/esm/ui-search-shell.entry.js +37 -0
- package/dist/esm/ui-select.entry.js +98 -0
- package/dist/esm/ui-switch.entry.js +63 -0
- package/dist/esm/ui-tabs.entry.js +115 -0
- package/dist/esm/ui-textarea.entry.js +104 -0
- package/dist/esm/ui-toast-region.entry.js +65 -0
- package/dist/esm/ui-tooltip.entry.js +131 -0
- package/dist/esm/ui-top-bar.entry.js +41 -0
- package/dist/index.cjs +4062 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +129 -0
- package/dist/looma/index.esm.js +0 -0
- package/dist/looma/looma.esm.js +1 -0
- package/dist/looma/p-03f0594b.entry.js +1 -0
- package/dist/looma/p-15e619fd.entry.js +1 -0
- package/dist/looma/p-201243dc.entry.js +1 -0
- package/dist/looma/p-24d7aa5b.entry.js +1 -0
- package/dist/looma/p-341ba64a.entry.js +1 -0
- package/dist/looma/p-41d62a83.entry.js +1 -0
- package/dist/looma/p-4742e6b4.entry.js +1 -0
- package/dist/looma/p-4c54d489.entry.js +1 -0
- package/dist/looma/p-52c537fa.entry.js +1 -0
- package/dist/looma/p-5a645647.entry.js +1 -0
- package/dist/looma/p-610b2eca.entry.js +1 -0
- package/dist/looma/p-649dad92.entry.js +1 -0
- package/dist/looma/p-66a203a1.entry.js +1 -0
- package/dist/looma/p-754cfff3.entry.js +1 -0
- package/dist/looma/p-93ce1c62.entry.js +1 -0
- package/dist/looma/p-955fb814.entry.js +1 -0
- package/dist/looma/p-96de71ad.entry.js +1 -0
- package/dist/looma/p-CEeiinfk.js +2 -0
- package/dist/looma/p-CR7f2MQC.js +1 -0
- package/dist/looma/p-DQuL1Twl.js +1 -0
- package/dist/looma/p-JwSoedEO.js +1 -0
- package/dist/looma/p-ab4151d5.entry.js +1 -0
- package/dist/looma/p-c14233bc.entry.js +1 -0
- package/dist/looma/p-dc857ed4.entry.js +1 -0
- package/dist/looma/p-dfcb2cca.entry.js +1 -0
- package/dist/looma/p-dff144bd.entry.js +1 -0
- package/dist/looma/p-ebb74106.entry.js +1 -0
- package/dist/looma/p-ecb5739b.entry.js +1 -0
- package/dist/looma/p-ee31c7b4.entry.js +1 -0
- package/dist/looma/p-fa4659c4.entry.js +1 -0
- package/dist/looma/p-hgBUJRDa.js +1 -0
- package/dist/types/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +12 -0
- package/dist/types/components/ui-badge/ui-badge.d.ts +5 -0
- package/dist/types/components/ui-button/ui-button.d.ts +13 -0
- package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +19 -0
- package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +37 -0
- package/dist/types/components/ui-dialog/ui-dialog.d.ts +19 -0
- package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +20 -0
- package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +6 -0
- package/dist/types/components/ui-form-field/ui-form-field.d.ts +10 -0
- package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +7 -0
- package/dist/types/components/ui-input/ui-input.d.ts +19 -0
- package/dist/types/components/ui-menu/ui-menu.d.ts +14 -0
- package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +5 -0
- package/dist/types/components/ui-popover/ui-popover.d.ts +16 -0
- package/dist/types/components/ui-radio/ui-radio.d.ts +17 -0
- package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +21 -0
- package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +15 -0
- package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +9 -0
- package/dist/types/components/ui-select/ui-select.d.ts +19 -0
- package/dist/types/components/ui-switch/ui-switch.d.ts +15 -0
- package/dist/types/components/ui-tabs/ui-tabs.d.ts +17 -0
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +20 -0
- package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +12 -0
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +24 -0
- package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +12 -0
- package/dist/types/components.d.ts +1148 -0
- package/dist/types/overlay/manager.d.ts +14 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/events.d.ts +4 -0
- package/dist/types/utils/id.d.ts +1 -0
- package/dist/types/utils/initials.d.ts +1 -0
- package/dist/ui-avatar-group.entry-BZGXBOSE.js +59 -0
- package/dist/ui-avatar.entry-S2O2W5SA.js +51 -0
- package/dist/ui-badge.entry-CVJDISCR.js +22 -0
- package/dist/ui-button.entry-LNJBEJFE.js +72 -0
- package/dist/ui-checkbox.entry-5RA2CB43.js +102 -0
- package/dist/ui-context-menu.entry-UUOCT75F.js +211 -0
- package/dist/ui-dialog.entry-OEPJTEES.js +106 -0
- package/dist/ui-disclosure.entry-LRRISGUD.js +120 -0
- package/dist/ui-floating-action-button.entry-7TSAZRXP.js +23 -0
- package/dist/ui-form-field.entry-73YOVICF.js +67 -0
- package/dist/ui-icon-button.entry-MNXGPG36.js +24 -0
- package/dist/ui-input.entry-UWRVAOSW.js +112 -0
- package/dist/ui-menu-item.entry-5AOJO5MP.js +22 -0
- package/dist/ui-menu.entry-YDS6UMB5.js +98 -0
- package/dist/ui-popover.entry-PGWDCQIX.js +104 -0
- package/dist/ui-radio-group.entry-RHP5GNWU.js +142 -0
- package/dist/ui-radio.entry-5WRWPSTK.js +96 -0
- package/dist/ui-search-result-row.entry-IKJB2SJJ.js +50 -0
- package/dist/ui-search-shell.entry-ZIWF4ZHH.js +41 -0
- package/dist/ui-select.entry-N5TIKHR7.js +111 -0
- package/dist/ui-switch.entry-WUSZTXIR.js +75 -0
- package/dist/ui-tabs.entry-UFAVAQIF.js +124 -0
- package/dist/ui-textarea.entry-BYT47RAQ.js +117 -0
- package/dist/ui-toast-region.entry-6UYR3ZU2.js +78 -0
- package/dist/ui-tooltip.entry-YS7UX4FS.js +145 -0
- package/dist/ui-top-bar.entry-V27H6NFO.js +49 -0
- package/editor/chunk-JKRA4D4W.js +435 -0
- package/editor/chunk-NOOV344H.js +783 -0
- package/editor/extensions/index.d.ts +78 -0
- package/editor/extensions/index.js +28 -0
- package/editor/index.d.ts +7 -0
- package/editor/index.js +29 -0
- package/editor/table-overlay-DTr3KC9e.d.ts +12 -0
- package/editor/ui.d.ts +48 -0
- package/editor/ui.js +1 -0
- package/editor.css +662 -0
- package/layout/index.cjs +207 -0
- package/layout/index.css +166 -0
- package/layout/index.d.cts +3 -0
- package/layout/index.d.ts +3 -0
- package/layout/index.js +182 -0
- package/layout.css +124 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +244 -0
- package/styles.css +899 -0
- package/theme-dark.css +59 -0
- package/theme-high-contrast.css +21 -0
- package/theme-light.css +30 -0
- package/tokens.css +148 -0
- package/vue/chunk-J4UBEIIL.js +83 -0
- package/vue/editor/index.d.ts +89 -0
- package/vue/editor/index.js +125 -0
- package/vue/index.d.ts +167 -0
- package/vue/index.js +113 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
const OVERFLOW_ATTR = 'data-ui-avatar-group-overflow';
|
|
3
|
+
export class UIAvatarGroup {
|
|
4
|
+
host;
|
|
5
|
+
max = 5;
|
|
6
|
+
label = 'People';
|
|
7
|
+
overflowCount = 0;
|
|
8
|
+
slotRef;
|
|
9
|
+
syncOverflow() {
|
|
10
|
+
this.updateOverflow();
|
|
11
|
+
}
|
|
12
|
+
componentDidLoad() {
|
|
13
|
+
this.slotRef?.addEventListener('slotchange', () => this.updateOverflow());
|
|
14
|
+
this.updateOverflow();
|
|
15
|
+
}
|
|
16
|
+
componentDidUpdate() {
|
|
17
|
+
this.updateOverflow();
|
|
18
|
+
}
|
|
19
|
+
updateOverflow() {
|
|
20
|
+
const slot = this.host.shadowRoot?.querySelector('slot');
|
|
21
|
+
const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
|
|
22
|
+
const children = nodes.filter((el) => !el.hasAttribute(OVERFLOW_ATTR));
|
|
23
|
+
const total = children.length;
|
|
24
|
+
const visibleCount = Math.min(this.max, total);
|
|
25
|
+
const overflowCount = total > this.max ? total - this.max : 0;
|
|
26
|
+
children.forEach((el, i) => {
|
|
27
|
+
el.hidden = i >= visibleCount;
|
|
28
|
+
el.setAttribute('aria-hidden', String(i >= visibleCount));
|
|
29
|
+
});
|
|
30
|
+
this.overflowCount = overflowCount;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (h(Host, { key: '9c8fbeb6e8c87ef4d86778a70a52f48b62717728', role: "list", "aria-label": this.label || undefined }, h("slot", { key: '432877b335f2a75f6b17a14b4be768c68ba04bfa' }), this.overflowCount > 0 && (h("span", { key: 'ccf8007947e5d97edcdf42b7f4740db33560956b', class: "overflow", role: "listitem", "aria-label": `${this.overflowCount} more`, "data-ui-avatar-group-overflow": true }, "+", this.overflowCount))));
|
|
34
|
+
}
|
|
35
|
+
static get is() { return "ui-avatar-group"; }
|
|
36
|
+
static get encapsulation() { return "shadow"; }
|
|
37
|
+
static get originalStyleUrls() {
|
|
38
|
+
return {
|
|
39
|
+
"$": ["ui-avatar-group.css"]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static get styleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["ui-avatar-group.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get properties() {
|
|
48
|
+
return {
|
|
49
|
+
"max": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "number",
|
|
54
|
+
"resolved": "number",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": ""
|
|
62
|
+
},
|
|
63
|
+
"getter": false,
|
|
64
|
+
"setter": false,
|
|
65
|
+
"reflect": false,
|
|
66
|
+
"attribute": "max",
|
|
67
|
+
"defaultValue": "5"
|
|
68
|
+
},
|
|
69
|
+
"label": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": ""
|
|
82
|
+
},
|
|
83
|
+
"getter": false,
|
|
84
|
+
"setter": false,
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"attribute": "label",
|
|
87
|
+
"defaultValue": "'People'"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get states() {
|
|
92
|
+
return {
|
|
93
|
+
"overflowCount": {}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
static get elementRef() { return "host"; }
|
|
97
|
+
static get watchers() {
|
|
98
|
+
return [{
|
|
99
|
+
"propName": "max",
|
|
100
|
+
"methodName": "syncOverflow"
|
|
101
|
+
}];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
border: 1px solid var(--ui-border-default);
|
|
6
|
+
border-radius: 999px;
|
|
7
|
+
background: var(--ui-surface-muted);
|
|
8
|
+
color: var(--ui-text-secondary);
|
|
9
|
+
font: inherit;
|
|
10
|
+
font-size: 0.75rem;
|
|
11
|
+
line-height: 1;
|
|
12
|
+
padding: 0.25em 0.6em;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([data-tone='accent']) {
|
|
17
|
+
background: var(--ui-accent-solid);
|
|
18
|
+
border-color: var(--ui-accent-solid);
|
|
19
|
+
color: var(--ui-text-on-accent);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([data-tone='danger']) {
|
|
23
|
+
background: var(--ui-danger-solid);
|
|
24
|
+
border-color: var(--ui-danger-solid);
|
|
25
|
+
color: var(--ui-text-on-accent);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([data-tone='success']) {
|
|
29
|
+
background: var(--ui-success-solid);
|
|
30
|
+
border-color: var(--ui-success-solid);
|
|
31
|
+
color: var(--ui-text-on-accent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([data-tone='warning']) {
|
|
35
|
+
background: var(--ui-warning-solid);
|
|
36
|
+
border-color: var(--ui-warning-solid);
|
|
37
|
+
color: var(--ui-text-primary);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([data-tone='info']) {
|
|
41
|
+
background: var(--ui-info-solid);
|
|
42
|
+
border-color: var(--ui-info-solid);
|
|
43
|
+
color: var(--ui-text-on-accent);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([data-variant='subtle'][data-tone='accent']) {
|
|
47
|
+
background: var(--ui-accent-soft);
|
|
48
|
+
border-color: var(--ui-accent-soft);
|
|
49
|
+
color: var(--ui-accent-solid);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([data-variant='subtle'][data-tone='danger']) {
|
|
53
|
+
background: var(--ui-danger-soft);
|
|
54
|
+
border-color: var(--ui-danger-soft);
|
|
55
|
+
color: var(--ui-danger-solid);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([data-variant='subtle'][data-tone='success']) {
|
|
59
|
+
background: var(--ui-success-soft);
|
|
60
|
+
border-color: var(--ui-success-soft);
|
|
61
|
+
color: var(--ui-success-solid);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([data-variant='subtle'][data-tone='warning']) {
|
|
65
|
+
background: var(--ui-warning-soft);
|
|
66
|
+
border-color: var(--ui-warning-soft);
|
|
67
|
+
color: var(--ui-warning-solid);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([data-variant='subtle'][data-tone='info']) {
|
|
71
|
+
background: var(--ui-info-soft);
|
|
72
|
+
border-color: var(--ui-info-soft);
|
|
73
|
+
color: var(--ui-info-solid);
|
|
74
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class UIBadge {
|
|
3
|
+
variant;
|
|
4
|
+
tone;
|
|
5
|
+
render() {
|
|
6
|
+
return (h(Host, { key: '53eba0640816bc09ae198de29f9a1ac97c1d5f1d', "data-variant": this.variant || undefined, "data-tone": this.tone || undefined }, h("slot", { key: 'abc8a9e09c2001f222f9aa8f164da76ff8343e01' })));
|
|
7
|
+
}
|
|
8
|
+
static get is() { return "ui-badge"; }
|
|
9
|
+
static get encapsulation() { return "shadow"; }
|
|
10
|
+
static get originalStyleUrls() {
|
|
11
|
+
return {
|
|
12
|
+
"$": ["ui-badge.css"]
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
static get styleUrls() {
|
|
16
|
+
return {
|
|
17
|
+
"$": ["ui-badge.css"]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static get properties() {
|
|
21
|
+
return {
|
|
22
|
+
"variant": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"mutable": false,
|
|
25
|
+
"complexType": {
|
|
26
|
+
"original": "string",
|
|
27
|
+
"resolved": "string",
|
|
28
|
+
"references": {}
|
|
29
|
+
},
|
|
30
|
+
"required": false,
|
|
31
|
+
"optional": true,
|
|
32
|
+
"docs": {
|
|
33
|
+
"tags": [],
|
|
34
|
+
"text": ""
|
|
35
|
+
},
|
|
36
|
+
"getter": false,
|
|
37
|
+
"setter": false,
|
|
38
|
+
"reflect": false,
|
|
39
|
+
"attribute": "variant"
|
|
40
|
+
},
|
|
41
|
+
"tone": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": false,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": true,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": ""
|
|
54
|
+
},
|
|
55
|
+
"getter": false,
|
|
56
|
+
"setter": false,
|
|
57
|
+
"reflect": false,
|
|
58
|
+
"attribute": "tone"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
vertical-align: middle;
|
|
4
|
+
color: var(--ui-text-primary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
::slotted(button) {
|
|
8
|
+
appearance: none;
|
|
9
|
+
border: 1px solid var(--ui-border-default);
|
|
10
|
+
border-radius: var(--ui-radius-2);
|
|
11
|
+
background: var(--ui-surface-default);
|
|
12
|
+
color: inherit;
|
|
13
|
+
font: inherit;
|
|
14
|
+
font-weight: var(--ui-font-medium, 500);
|
|
15
|
+
line-height: var(--ui-line-height-tight);
|
|
16
|
+
padding: var(--ui-space-2) var(--ui-space-3);
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition:
|
|
19
|
+
background-color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
20
|
+
border-color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
21
|
+
color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
22
|
+
box-shadow var(--ui-motion-fast) var(--ui-motion-ease);
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([data-size='sm'])::slotted(button) {
|
|
27
|
+
padding: var(--ui-space-1) var(--ui-space-2);
|
|
28
|
+
font-size: 0.875rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([data-size='lg'])::slotted(button) {
|
|
32
|
+
padding: var(--ui-space-3) var(--ui-space-4);
|
|
33
|
+
font-size: 1rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
::slotted(button:hover:enabled) {
|
|
37
|
+
background: var(--ui-surface-muted);
|
|
38
|
+
border-color: var(--ui-border-strong);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::slotted(button:active:enabled) {
|
|
42
|
+
background: var(--ui-surface-subtle);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([data-variant='solid'])::slotted(button) {
|
|
46
|
+
border-color: var(--ui-accent-solid);
|
|
47
|
+
background: var(--ui-accent-solid);
|
|
48
|
+
color: var(--ui-text-on-accent);
|
|
49
|
+
box-shadow: var(--ui-shadow-xs);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([data-variant='solid'])::slotted(button:hover:enabled) {
|
|
53
|
+
background: var(--ui-accent-hover);
|
|
54
|
+
border-color: var(--ui-accent-hover);
|
|
55
|
+
box-shadow: var(--ui-shadow-sm);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([data-variant='solid'])::slotted(button:active:enabled) {
|
|
59
|
+
background: var(--ui-accent-active);
|
|
60
|
+
border-color: var(--ui-accent-active);
|
|
61
|
+
box-shadow: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([data-variant='destructive'])::slotted(button) {
|
|
65
|
+
border-color: var(--ui-danger-solid);
|
|
66
|
+
background: var(--ui-danger-solid);
|
|
67
|
+
color: var(--ui-text-on-accent);
|
|
68
|
+
box-shadow: var(--ui-shadow-xs);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([data-variant='destructive'])::slotted(button:hover:enabled) {
|
|
72
|
+
background: var(--ui-danger-hover);
|
|
73
|
+
border-color: var(--ui-danger-hover);
|
|
74
|
+
box-shadow: var(--ui-shadow-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([data-variant='ghost'])::slotted(button) {
|
|
78
|
+
border-color: transparent;
|
|
79
|
+
background: transparent;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([data-variant='ghost'])::slotted(button:hover:enabled) {
|
|
83
|
+
background: var(--ui-surface-muted);
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([data-variant='ghost'])::slotted(button:active:enabled) {
|
|
88
|
+
background: var(--ui-surface-subtle);
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
::slotted(button:focus-visible) {
|
|
93
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
::slotted(button:disabled),
|
|
98
|
+
:host([data-disabled]) {
|
|
99
|
+
opacity: 0.6;
|
|
100
|
+
cursor: not-allowed;
|
|
101
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { isActivationKey } from "../../utils/events";
|
|
3
|
+
export class UIButton {
|
|
4
|
+
host;
|
|
5
|
+
variant;
|
|
6
|
+
size;
|
|
7
|
+
disabled = false;
|
|
8
|
+
slotRef;
|
|
9
|
+
syncToButton() {
|
|
10
|
+
const btn = this.getButton();
|
|
11
|
+
if (!btn)
|
|
12
|
+
return;
|
|
13
|
+
this.host.dataset.variant = this.variant || '';
|
|
14
|
+
this.host.dataset.size = this.size || '';
|
|
15
|
+
this.host.dataset.disabled = this.disabled ? 'true' : '';
|
|
16
|
+
btn.disabled = this.disabled;
|
|
17
|
+
}
|
|
18
|
+
componentDidLoad() {
|
|
19
|
+
this.slotRef?.addEventListener('slotchange', () => this.syncToButton());
|
|
20
|
+
this.syncToButton();
|
|
21
|
+
}
|
|
22
|
+
componentDidUpdate() {
|
|
23
|
+
this.syncToButton();
|
|
24
|
+
}
|
|
25
|
+
getButton() {
|
|
26
|
+
const slot = this.host.shadowRoot?.querySelector('slot');
|
|
27
|
+
const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
|
|
28
|
+
return nodes.find((el) => el.tagName === 'BUTTON') ?? null;
|
|
29
|
+
}
|
|
30
|
+
onKeydown = (e) => {
|
|
31
|
+
const btn = this.getButton();
|
|
32
|
+
if (btn || this.disabled || !isActivationKey(e))
|
|
33
|
+
return;
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
this.host.click();
|
|
36
|
+
};
|
|
37
|
+
render() {
|
|
38
|
+
return (h(Host, { key: '01011aa13228b9e8d10ed11b99c95ef1df91326d', "data-variant": this.variant || undefined, "data-size": this.size || undefined, "data-disabled": this.disabled ? '' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '2bf0274d2732ea46fdf016a46d85bbe6e0d96bba', ref: (el) => (this.slotRef = el) })));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "ui-button"; }
|
|
41
|
+
static get encapsulation() { return "shadow"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["ui-button.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["ui-button.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"variant": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": true,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": ""
|
|
67
|
+
},
|
|
68
|
+
"getter": false,
|
|
69
|
+
"setter": false,
|
|
70
|
+
"reflect": false,
|
|
71
|
+
"attribute": "variant"
|
|
72
|
+
},
|
|
73
|
+
"size": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "string",
|
|
78
|
+
"resolved": "string",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": true,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": ""
|
|
86
|
+
},
|
|
87
|
+
"getter": false,
|
|
88
|
+
"setter": false,
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"attribute": "size"
|
|
91
|
+
},
|
|
92
|
+
"disabled": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "boolean",
|
|
97
|
+
"resolved": "boolean",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
},
|
|
106
|
+
"getter": false,
|
|
107
|
+
"setter": false,
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"attribute": "disabled",
|
|
110
|
+
"defaultValue": "false"
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get elementRef() { return "host"; }
|
|
115
|
+
static get watchers() {
|
|
116
|
+
return [{
|
|
117
|
+
"propName": "variant",
|
|
118
|
+
"methodName": "syncToButton"
|
|
119
|
+
}, {
|
|
120
|
+
"propName": "size",
|
|
121
|
+
"methodName": "syncToButton"
|
|
122
|
+
}, {
|
|
123
|
+
"propName": "disabled",
|
|
124
|
+
"methodName": "syncToButton"
|
|
125
|
+
}];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--ui-space-2);
|
|
5
|
+
color: var(--ui-text-primary);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host([aria-disabled='true']),
|
|
9
|
+
:host([data-disabled='true']) {
|
|
10
|
+
opacity: 0.6;
|
|
11
|
+
cursor: not-allowed;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::slotted(input[type='checkbox']) {
|
|
15
|
+
accent-color: var(--ui-accent-solid);
|
|
16
|
+
width: 1.125em;
|
|
17
|
+
height: 1.125em;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
::slotted(input[type='checkbox']:focus-visible) {
|
|
22
|
+
outline: 2px solid var(--ui-accent-solid);
|
|
23
|
+
outline-offset: 2px;
|
|
24
|
+
}
|