@threadlabs/looma 0.14.1 → 0.14.3
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/components/ui-meter/ui-meter.html +186 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-meter.css +171 -0
- package/vanilla/UiMeter.d.ts +20 -0
- package/vanilla/UiMeter.js +28 -0
- package/vanilla/index.js +1 -0
- package/vue/UiMeter.d.ts +20 -0
- package/vue/UiMeter.js +2 -0
- package/vue/UiMeter.vue +279 -0
- package/vue/chunks/UiMeter.js +88 -0
- package/vue/components.css +130 -0
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
package/vue/components.css
CHANGED
|
@@ -4436,6 +4436,136 @@ svg[data-v-006fa1b2-s] {
|
|
|
4436
4436
|
display: none;
|
|
4437
4437
|
}
|
|
4438
4438
|
|
|
4439
|
+
/* How far along something is: a track, filled from the start in the tone's colour. The track is a
|
|
4440
|
+
quiet border colour, so an empty meter still shows; every tone's fill keeps 3:1 against the
|
|
4441
|
+
track and the page. */
|
|
4442
|
+
@property --ui-meter-inline-size {
|
|
4443
|
+
syntax: "*";
|
|
4444
|
+
inherits: false;
|
|
4445
|
+
}
|
|
4446
|
+
[data-component~="ui-meter"][data-v-c0b7936e] {
|
|
4447
|
+
--_meter-fill: var(--ui-text-muted);
|
|
4448
|
+
|
|
4449
|
+
display: inline-block;
|
|
4450
|
+
flex: none;
|
|
4451
|
+
vertical-align: middle;
|
|
4452
|
+
inline-size: var(--ui-meter-inline-size, 8rem);
|
|
4453
|
+
max-inline-size: 100%;
|
|
4454
|
+
block-size: var(--ui-space-2);
|
|
4455
|
+
overflow: hidden;
|
|
4456
|
+
border-radius: var(--ui-radius-round);
|
|
4457
|
+
background: var(--ui-border);
|
|
4458
|
+
/* Unseen until forced colours draw it, where the track's own colour is gone. */
|
|
4459
|
+
outline: 1px solid transparent;
|
|
4460
|
+
}
|
|
4461
|
+
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-v-c0b7936e] {
|
|
4462
|
+
inline-size: var(--ui-meter-inline-size, 5rem);
|
|
4463
|
+
block-size: var(--ui-space-1);
|
|
4464
|
+
}
|
|
4465
|
+
.fill[data-v-c0b7936e] {
|
|
4466
|
+
display: block;
|
|
4467
|
+
block-size: 100%;
|
|
4468
|
+
background: var(--_meter-fill);
|
|
4469
|
+
}
|
|
4470
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=accent"][data-v-c0b7936e] {
|
|
4471
|
+
--_meter-fill: var(--ui-accent-solid);
|
|
4472
|
+
}
|
|
4473
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=info"][data-v-c0b7936e] {
|
|
4474
|
+
--_meter-fill: var(--ui-info-solid);
|
|
4475
|
+
}
|
|
4476
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=success"][data-v-c0b7936e] {
|
|
4477
|
+
--_meter-fill: var(--ui-success-solid);
|
|
4478
|
+
}
|
|
4479
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=warning"][data-v-c0b7936e] {
|
|
4480
|
+
--_meter-fill: var(--ui-warning-solid);
|
|
4481
|
+
}
|
|
4482
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=danger"][data-v-c0b7936e] {
|
|
4483
|
+
--_meter-fill: var(--ui-danger-solid);
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
/* Segments: the track and its fill show through a mask of equal segments with a gap between them.
|
|
4487
|
+
A mask over the whole meter, rather than one element per segment, because the expression
|
|
4488
|
+
language has no range to render N elements from, and one mask lines the fill up with the track
|
|
4489
|
+
for free. Each period is a segment and the gap after it; N periods span the track plus one
|
|
4490
|
+
trailing gap, so the segments sit symmetrically and right to left needs nothing of its own.
|
|
4491
|
+
The count arrives as an attribute, not an inline custom property (which would add a style
|
|
4492
|
+
attribute to every meter), so a continuous meter renders exactly as before, and the rules below
|
|
4493
|
+
turn it into a number. That caps it at 12, until attr() with a type reads any count in every engine. */
|
|
4494
|
+
[data-component~="ui-meter"][data-ui-meter-segments="2"][data-v-c0b7936e] {
|
|
4495
|
+
--_segments: 2;
|
|
4496
|
+
}
|
|
4497
|
+
[data-component~="ui-meter"][data-ui-meter-segments="3"][data-v-c0b7936e] {
|
|
4498
|
+
--_segments: 3;
|
|
4499
|
+
}
|
|
4500
|
+
[data-component~="ui-meter"][data-ui-meter-segments="4"][data-v-c0b7936e] {
|
|
4501
|
+
--_segments: 4;
|
|
4502
|
+
}
|
|
4503
|
+
[data-component~="ui-meter"][data-ui-meter-segments="5"][data-v-c0b7936e] {
|
|
4504
|
+
--_segments: 5;
|
|
4505
|
+
}
|
|
4506
|
+
[data-component~="ui-meter"][data-ui-meter-segments="6"][data-v-c0b7936e] {
|
|
4507
|
+
--_segments: 6;
|
|
4508
|
+
}
|
|
4509
|
+
[data-component~="ui-meter"][data-ui-meter-segments="7"][data-v-c0b7936e] {
|
|
4510
|
+
--_segments: 7;
|
|
4511
|
+
}
|
|
4512
|
+
[data-component~="ui-meter"][data-ui-meter-segments="8"][data-v-c0b7936e] {
|
|
4513
|
+
--_segments: 8;
|
|
4514
|
+
}
|
|
4515
|
+
[data-component~="ui-meter"][data-ui-meter-segments="9"][data-v-c0b7936e] {
|
|
4516
|
+
--_segments: 9;
|
|
4517
|
+
}
|
|
4518
|
+
[data-component~="ui-meter"][data-ui-meter-segments="10"][data-v-c0b7936e] {
|
|
4519
|
+
--_segments: 10;
|
|
4520
|
+
}
|
|
4521
|
+
[data-component~="ui-meter"][data-ui-meter-segments="11"][data-v-c0b7936e] {
|
|
4522
|
+
--_segments: 11;
|
|
4523
|
+
}
|
|
4524
|
+
[data-component~="ui-meter"][data-ui-meter-segments="12"][data-v-c0b7936e] {
|
|
4525
|
+
--_segments: 12;
|
|
4526
|
+
}
|
|
4527
|
+
[data-component~="ui-meter"][data-ui-meter-segments][data-v-c0b7936e] {
|
|
4528
|
+
--_meter-gap: var(--ui-space-1);
|
|
4529
|
+
--_meter-period: calc((100% + var(--_meter-gap)) / var(--_segments));
|
|
4530
|
+
--_meter-segment: calc(var(--_meter-period) - var(--_meter-gap));
|
|
4531
|
+
|
|
4532
|
+
mask-image: repeating-linear-gradient(
|
|
4533
|
+
to right,
|
|
4534
|
+
#000 0 var(--_meter-segment),
|
|
4535
|
+
transparent 0 var(--_meter-period)
|
|
4536
|
+
);
|
|
4537
|
+
}
|
|
4538
|
+
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-ui-meter-segments][data-v-c0b7936e] {
|
|
4539
|
+
--_meter-gap: var(--ui-space-0-5);
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
/* Forced colours drop backgrounds: draw the fill in the text colour inside the outlined track. */
|
|
4543
|
+
@media (forced-colors: active) {
|
|
4544
|
+
.fill[data-v-c0b7936e] {
|
|
4545
|
+
forced-color-adjust: none;
|
|
4546
|
+
background: CanvasText;
|
|
4547
|
+
}
|
|
4548
|
+
|
|
4549
|
+
/* The mask clips the track's outline, so each segment draws its own: the inset shadow draws the
|
|
4550
|
+
top and bottom edges and the gradient the ends. */
|
|
4551
|
+
[data-component~="ui-meter"][data-ui-meter-segments][data-v-c0b7936e] {
|
|
4552
|
+
forced-color-adjust: none;
|
|
4553
|
+
background: repeating-linear-gradient(
|
|
4554
|
+
to right,
|
|
4555
|
+
CanvasText 0 1px,
|
|
4556
|
+
Canvas 0 calc(var(--_meter-segment) - 1px),
|
|
4557
|
+
CanvasText 0 var(--_meter-segment),
|
|
4558
|
+
transparent 0 var(--_meter-period)
|
|
4559
|
+
);
|
|
4560
|
+
box-shadow: inset 0 0 0 1px CanvasText;
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
|
|
4564
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
4565
|
+
[data-component~="ui-meter"][hidden][data-v-c0b7936e] {
|
|
4566
|
+
display: none;
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4439
4569
|
/* This component's hooks style the element they are set on, and never a nested one. */
|
|
4440
4570
|
@property --ui-nav-item-current-surface {
|
|
4441
4571
|
syntax: "*";
|
package/vue/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export { default as List } from "./UiList.js";
|
|
|
37
37
|
export { default as ListItem } from "./UiListItem.js";
|
|
38
38
|
export { default as Menu } from "./UiMenu.js";
|
|
39
39
|
export { default as MenuItem } from "./UiMenuItem.js";
|
|
40
|
+
export { default as Meter } from "./UiMeter.js";
|
|
40
41
|
export { default as NavItem } from "./UiNavItem.js";
|
|
41
42
|
export { default as PageHeader } from "./UiPageHeader.js";
|
|
42
43
|
export { default as Popover } from "./UiPopover.js";
|
package/vue/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { t as UiList_default } from "./chunks/UiList.js";
|
|
|
38
38
|
import { t as UiListItem_default } from "./chunks/UiListItem.js";
|
|
39
39
|
import { t as UiMenu_default } from "./chunks/UiMenu.js";
|
|
40
40
|
import { t as UiMenuItem_default } from "./chunks/UiMenuItem.js";
|
|
41
|
+
import { t as UiMeter_default } from "./chunks/UiMeter.js";
|
|
41
42
|
import { t as UiNavItem_default } from "./chunks/UiNavItem.js";
|
|
42
43
|
import { t as UiPageHeader_default } from "./chunks/UiPageHeader.js";
|
|
43
44
|
import { t as UiPopover_default } from "./chunks/UiPopover.js";
|
|
@@ -65,4 +66,4 @@ import { t as UiTopBar_default } from "./chunks/UiTopBar.js";
|
|
|
65
66
|
import { t as UiTree_default } from "./chunks/UiTree.js";
|
|
66
67
|
import { t as UiTreeItem_default } from "./chunks/UiTreeItem.js";
|
|
67
68
|
import { trackInputModality } from "@threadlabs/looma/components/shared/input-modality.js";
|
|
68
|
-
export { UiActionBar_default as ActionBar, UiAffordanceScope_default as AffordanceScope, UiAvatar_default as Avatar, UiAvatarGroup_default as AvatarGroup, UiBadge_default as Badge, UiBreadcrumbItem_default as BreadcrumbItem, UiBreadcrumbs_default as Breadcrumbs, UiButton_default as Button, UiCallout_default as Callout, UiCard_default as Card, UiCheckbox_default as Checkbox, UiCluster_default as Cluster, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorTableContextMenu_default as EditorTableContextMenu, UiEditorTableOverlay_default as EditorTableOverlay, UiEditorTableToolbar_default as EditorTableToolbar, UiEditorToolbar_default as EditorToolbar, UiFloatingActionButton_default as FloatingActionButton, UiFormField_default as FormField, UiGrid_default as Grid, UiIcon_default as Icon, UiIconButton_default as IconButton, UiInput_default as Input, UiInputGroup_default as InputGroup, UiList_default as List, UiListItem_default as ListItem, UiMenu_default as Menu, UiMenuItem_default as MenuItem, UiNavItem_default as NavItem, UiPageHeader_default as PageHeader, UiPopover_default as Popover, UiRadio_default as Radio, UiRadioGroup_default as RadioGroup, UiReel_default as Reel, UiScrollArea_default as ScrollArea, UiSearchResultRow_default as SearchResultRow, UiSearchShell_default as SearchShell, UiSection_default as Section, UiSelect_default as Select, UiSeparator_default as Separator, UiSidebar_default as Sidebar, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };
|
|
69
|
+
export { UiActionBar_default as ActionBar, UiAffordanceScope_default as AffordanceScope, UiAvatar_default as Avatar, UiAvatarGroup_default as AvatarGroup, UiBadge_default as Badge, UiBreadcrumbItem_default as BreadcrumbItem, UiBreadcrumbs_default as Breadcrumbs, UiButton_default as Button, UiCallout_default as Callout, UiCard_default as Card, UiCheckbox_default as Checkbox, UiCluster_default as Cluster, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorTableContextMenu_default as EditorTableContextMenu, UiEditorTableOverlay_default as EditorTableOverlay, UiEditorTableToolbar_default as EditorTableToolbar, UiEditorToolbar_default as EditorToolbar, UiFloatingActionButton_default as FloatingActionButton, UiFormField_default as FormField, UiGrid_default as Grid, UiIcon_default as Icon, UiIconButton_default as IconButton, UiInput_default as Input, UiInputGroup_default as InputGroup, UiList_default as List, UiListItem_default as ListItem, UiMenu_default as Menu, UiMenuItem_default as MenuItem, UiMeter_default as Meter, UiNavItem_default as NavItem, UiPageHeader_default as PageHeader, UiPopover_default as Popover, UiRadio_default as Radio, UiRadioGroup_default as RadioGroup, UiReel_default as Reel, UiScrollArea_default as ScrollArea, UiSearchResultRow_default as SearchResultRow, UiSearchShell_default as SearchShell, UiSection_default as Section, UiSelect_default as Select, UiSeparator_default as Separator, UiSidebar_default as Sidebar, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };
|