@threadlabs/looma 0.12.3 → 0.12.5
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/shared/icons.js +8 -0
- package/components/ui-icon/ui-icon.html +2 -1
- package/components/ui-nav-item/ui-nav-item.html +151 -0
- package/dist/index.js +1 -1
- package/editor/icons.d.ts +8 -0
- package/editor/index.js +9 -1
- package/package.json +2 -2
- package/styles/ui-nav-item.css +141 -0
- package/vanilla/UiIcon.js +3 -1
- package/vanilla/UiNavItem.d.ts +18 -0
- package/vanilla/UiNavItem.js +69 -0
- package/vanilla/index.js +1 -0
- package/vue/UiIcon.vue +13 -1
- package/vue/UiNavItem.d.ts +27 -0
- package/vue/UiNavItem.js +2 -0
- package/vue/UiNavItem.vue +180 -0
- package/vue/chunks/UiIcon.js +15 -2
- package/vue/chunks/UiNavItem.js +81 -0
- package/vue/components.css +115 -3
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
package/vue/chunks/UiIcon.js
CHANGED
|
@@ -25,6 +25,12 @@ var _hoisted_4 = [
|
|
|
25
25
|
"height",
|
|
26
26
|
"rx"
|
|
27
27
|
];
|
|
28
|
+
var _hoisted_5 = [
|
|
29
|
+
"x1",
|
|
30
|
+
"x2",
|
|
31
|
+
"y1",
|
|
32
|
+
"y2"
|
|
33
|
+
];
|
|
28
34
|
//#endregion
|
|
29
35
|
//#region .build/vue/UiIcon.vue
|
|
30
36
|
var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -68,11 +74,18 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
68
74
|
width: shape.width,
|
|
69
75
|
height: shape.height,
|
|
70
76
|
rx: shape.rx
|
|
71
|
-
}, null, 8, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
77
|
+
}, null, 8, _hoisted_4)) : createCommentVNode("v-if", true),
|
|
78
|
+
shape.tag === "line" ? (openBlock(), createElementBlock("line", {
|
|
79
|
+
key: 3,
|
|
80
|
+
x1: shape.x1,
|
|
81
|
+
x2: shape.x2,
|
|
82
|
+
y1: shape.y1,
|
|
83
|
+
y2: shape.y2
|
|
84
|
+
}, null, 8, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
72
85
|
]);
|
|
73
86
|
}), 128))]))], 16);
|
|
74
87
|
};
|
|
75
88
|
}
|
|
76
|
-
}), [["__scopeId", "data-v-
|
|
89
|
+
}), [["__scopeId", "data-v-6c3d73c1"]]);
|
|
77
90
|
//#endregion
|
|
78
91
|
export { UiIcon_default as t };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
|
+
import { createBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, withCtx } from "vue";
|
|
3
|
+
//#region .build/vue/UiNavItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _hoisted_1 = { class: "leading" };
|
|
5
|
+
var _hoisted_2 = { class: "content" };
|
|
6
|
+
var _hoisted_3 = { class: "label" };
|
|
7
|
+
var _hoisted_4 = { class: "description" };
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region .build/vue/UiNavItem.vue
|
|
10
|
+
var UiNavItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
__name: "UiNavItem",
|
|
13
|
+
props: {
|
|
14
|
+
as: { default: "button" },
|
|
15
|
+
current: {
|
|
16
|
+
type: [Boolean, String],
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
href: {},
|
|
20
|
+
rel: {},
|
|
21
|
+
target: {}
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
function text(value) {
|
|
25
|
+
if (Array.isArray(value)) return value.map(text).join(" ");
|
|
26
|
+
return value === null || value === void 0 || typeof value === "object" ? "" : String(value);
|
|
27
|
+
}
|
|
28
|
+
function attribute(value) {
|
|
29
|
+
if (value === null || value === void 0 || value === false || typeof value === "object" && !Array.isArray(value)) return void 0;
|
|
30
|
+
return value === true ? "" : text(value);
|
|
31
|
+
}
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps({ "data-component": "ui-nav-item" }, _ctx.$attrs, {
|
|
34
|
+
type: attribute({
|
|
35
|
+
true: "button",
|
|
36
|
+
false: null
|
|
37
|
+
}[`${!__props.href}`]),
|
|
38
|
+
href: __props.href,
|
|
39
|
+
target: __props.target,
|
|
40
|
+
rel: __props.rel,
|
|
41
|
+
"aria-current": typeof {
|
|
42
|
+
true: "page",
|
|
43
|
+
false: null,
|
|
44
|
+
page: "page",
|
|
45
|
+
step: "step",
|
|
46
|
+
location: "location"
|
|
47
|
+
}[`${__props.current}`] === "boolean" ? String({
|
|
48
|
+
true: "page",
|
|
49
|
+
false: null,
|
|
50
|
+
page: "page",
|
|
51
|
+
step: "step",
|
|
52
|
+
location: "location"
|
|
53
|
+
}[`${__props.current}`]) : attribute({
|
|
54
|
+
true: "page",
|
|
55
|
+
false: null,
|
|
56
|
+
page: "page",
|
|
57
|
+
step: "step",
|
|
58
|
+
location: "location"
|
|
59
|
+
}[`${__props.current}`])
|
|
60
|
+
}), {
|
|
61
|
+
default: withCtx(() => [
|
|
62
|
+
_cache[0] || (_cache[0] = createElementVNode("span", {
|
|
63
|
+
class: "indicator",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}, null, -1)),
|
|
66
|
+
createElementVNode("span", _hoisted_1, [renderSlot(_ctx.$slots, "leading", {}, void 0, true)]),
|
|
67
|
+
createElementVNode("span", _hoisted_2, [createElementVNode("span", _hoisted_3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]), createElementVNode("span", _hoisted_4, [renderSlot(_ctx.$slots, "description", {}, void 0, true)])])
|
|
68
|
+
]),
|
|
69
|
+
_: 3
|
|
70
|
+
}, 16, [
|
|
71
|
+
"type",
|
|
72
|
+
"href",
|
|
73
|
+
"target",
|
|
74
|
+
"rel",
|
|
75
|
+
"aria-current"
|
|
76
|
+
]);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}), [["__scopeId", "data-v-aa140273"]]);
|
|
80
|
+
//#endregion
|
|
81
|
+
export { UiNavItem_default as t };
|
package/vue/components.css
CHANGED
|
@@ -286,20 +286,20 @@
|
|
|
286
286
|
display: none;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
[data-component~="ui-icon"][data-v-
|
|
289
|
+
[data-component~="ui-icon"][data-v-6c3d73c1] {
|
|
290
290
|
display: inline-flex;
|
|
291
291
|
flex: none;
|
|
292
292
|
inline-size: var(--ui-icon-size, 1em);
|
|
293
293
|
block-size: var(--ui-icon-size, 1em);
|
|
294
294
|
}
|
|
295
|
-
svg[data-v-
|
|
295
|
+
svg[data-v-6c3d73c1] {
|
|
296
296
|
inline-size: 100%;
|
|
297
297
|
block-size: 100%;
|
|
298
298
|
stroke-width: var(--ui-icon-stroke-width, 2);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
302
|
-
[data-component~="ui-icon"][hidden][data-v-
|
|
302
|
+
[data-component~="ui-icon"][hidden][data-v-6c3d73c1] {
|
|
303
303
|
display: none;
|
|
304
304
|
}
|
|
305
305
|
|
|
@@ -3610,6 +3610,118 @@ svg[data-v-c322b7ed-s] {
|
|
|
3610
3610
|
display: none;
|
|
3611
3611
|
}
|
|
3612
3612
|
|
|
3613
|
+
/* One destination in a side or rail navigation: an icon to find it by (leading), its name (the
|
|
3614
|
+
default slot), and an optional line under it (description), such as the record a section
|
|
3615
|
+
belongs to. Label and description are one line each and end in an ellipsis, so every item in a
|
|
3616
|
+
navigation has the same height and the rail never grows sideways. */
|
|
3617
|
+
[data-component~="ui-nav-item"][data-v-aa140273] {
|
|
3618
|
+
--_indicator-width: var(--ui-nav-item-indicator-width, 3px);
|
|
3619
|
+
--_indicator-color: var(--ui-nav-item-indicator-color, var(--ui-accent));
|
|
3620
|
+
position: relative;
|
|
3621
|
+
box-sizing: border-box;
|
|
3622
|
+
display: flex;
|
|
3623
|
+
align-items: center;
|
|
3624
|
+
gap: var(--ui-space-3);
|
|
3625
|
+
inline-size: 100%;
|
|
3626
|
+
min-inline-size: 0;
|
|
3627
|
+
min-block-size: var(--ui-control-size, 2.5rem);
|
|
3628
|
+
margin: 0;
|
|
3629
|
+
padding-block: var(--ui-space-2);
|
|
3630
|
+
padding-inline: var(--ui-space-3);
|
|
3631
|
+
border: 0;
|
|
3632
|
+
border-radius: var(--ui-radius-md);
|
|
3633
|
+
background: transparent;
|
|
3634
|
+
color: var(--ui-text-secondary);
|
|
3635
|
+
font: inherit;
|
|
3636
|
+
font-weight: var(--ui-font-medium);
|
|
3637
|
+
text-align: start;
|
|
3638
|
+
text-decoration: none;
|
|
3639
|
+
cursor: pointer;
|
|
3640
|
+
appearance: none;
|
|
3641
|
+
transition:
|
|
3642
|
+
background-color var(--ui-motion-fast) var(--ui-motion-ease),
|
|
3643
|
+
color var(--ui-motion-fast) var(--ui-motion-ease);
|
|
3644
|
+
}
|
|
3645
|
+
[data-component~="ui-nav-item"][data-v-aa140273]:hover:not([aria-current]) {
|
|
3646
|
+
background: var(--ui-surface-hover);
|
|
3647
|
+
color: var(--ui-text-primary);
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3650
|
+
/* The ring is an outline, drawn inside the item: forced colors keep an outline where they drop a
|
|
3651
|
+
box shadow, and a scrolling rail cannot clip a ring that stays within the item. */
|
|
3652
|
+
[data-component~="ui-nav-item"][data-v-aa140273]:focus-visible {
|
|
3653
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
3654
|
+
outline-offset: -2px;
|
|
3655
|
+
}
|
|
3656
|
+
[data-component~="ui-nav-item"][aria-current][data-v-aa140273] {
|
|
3657
|
+
background: var(--ui-nav-item-current-surface, var(--ui-accent-soft));
|
|
3658
|
+
color: var(--ui-accent-subtle-text, var(--ui-text-primary));
|
|
3659
|
+
font-weight: var(--ui-font-semibold);
|
|
3660
|
+
}
|
|
3661
|
+
|
|
3662
|
+
/* The bar on the start edge is a border, not a fill: forced colors replace backgrounds but keep a
|
|
3663
|
+
border, so the current item stays marked in high contrast. Logical edges mirror it in a
|
|
3664
|
+
right-to-left page. */
|
|
3665
|
+
.indicator[data-v-aa140273] {
|
|
3666
|
+
position: absolute;
|
|
3667
|
+
inset-block: var(--ui-space-2);
|
|
3668
|
+
inset-inline-start: 0;
|
|
3669
|
+
display: none;
|
|
3670
|
+
border-inline-start: var(--_indicator-width) solid var(--_indicator-color);
|
|
3671
|
+
border-radius: var(--ui-radius-round);
|
|
3672
|
+
}
|
|
3673
|
+
[data-component~="ui-nav-item"][aria-current] .indicator[data-v-aa140273] {
|
|
3674
|
+
display: block;
|
|
3675
|
+
}
|
|
3676
|
+
@media (forced-colors: active) {
|
|
3677
|
+
.indicator[data-v-aa140273] {
|
|
3678
|
+
border-inline-start-color: Highlight;
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
.leading[data-v-aa140273] {
|
|
3682
|
+
display: inline-flex;
|
|
3683
|
+
flex: none;
|
|
3684
|
+
align-items: center;
|
|
3685
|
+
color: inherit;
|
|
3686
|
+
font-size: var(--ui-font-size-lg);
|
|
3687
|
+
}
|
|
3688
|
+
.content[data-v-aa140273] {
|
|
3689
|
+
display: flex;
|
|
3690
|
+
flex: 1;
|
|
3691
|
+
flex-direction: column;
|
|
3692
|
+
gap: var(--ui-space-0-5, 2px);
|
|
3693
|
+
min-inline-size: 0;
|
|
3694
|
+
}
|
|
3695
|
+
.label[data-v-aa140273],
|
|
3696
|
+
.description[data-v-aa140273] {
|
|
3697
|
+
display: block;
|
|
3698
|
+
min-inline-size: 0;
|
|
3699
|
+
overflow: hidden;
|
|
3700
|
+
text-overflow: ellipsis;
|
|
3701
|
+
white-space: nowrap;
|
|
3702
|
+
}
|
|
3703
|
+
.label[data-v-aa140273] {
|
|
3704
|
+
font-size: var(--ui-font-size-md);
|
|
3705
|
+
line-height: var(--ui-line-height-tight);
|
|
3706
|
+
}
|
|
3707
|
+
.description[data-v-aa140273] {
|
|
3708
|
+
color: var(--ui-text-muted);
|
|
3709
|
+
font-size: var(--ui-font-size-sm);
|
|
3710
|
+
font-weight: var(--ui-font-normal);
|
|
3711
|
+
line-height: var(--ui-line-height-tight);
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3714
|
+
/* An unused region takes no space. */
|
|
3715
|
+
.leading[data-v-aa140273]:empty,
|
|
3716
|
+
.description[data-v-aa140273]:empty {
|
|
3717
|
+
display: none;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
3721
|
+
[data-component~="ui-nav-item"][hidden][data-v-aa140273] {
|
|
3722
|
+
display: none;
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3613
3725
|
/* The top of a view: its title (the page's one h1), with an optional icon or mark before it, a
|
|
3614
3726
|
short eyebrow above it, a line or two of description under it, and the view's own actions at
|
|
3615
3727
|
the end. Every view titles itself the same way, at the same size. */
|
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 NavItem } from "./UiNavItem.js";
|
|
40
41
|
export { default as PageHeader } from "./UiPageHeader.js";
|
|
41
42
|
export { default as Popover } from "./UiPopover.js";
|
|
42
43
|
export { default as Radio } from "./UiRadio.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 UiNavItem_default } from "./chunks/UiNavItem.js";
|
|
41
42
|
import { t as UiPageHeader_default } from "./chunks/UiPageHeader.js";
|
|
42
43
|
import { t as UiPopover_default } from "./chunks/UiPopover.js";
|
|
43
44
|
import { t as UiRadio_default } from "./chunks/UiRadio.js";
|
|
@@ -63,4 +64,4 @@ import { t as UiTopBar_default } from "./chunks/UiTopBar.js";
|
|
|
63
64
|
import { t as UiTree_default } from "./chunks/UiTree.js";
|
|
64
65
|
import { t as UiTreeItem_default } from "./chunks/UiTreeItem.js";
|
|
65
66
|
import { trackInputModality } from "@threadlabs/looma/components/shared/input-modality.js";
|
|
66
|
-
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, 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, 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 };
|
|
67
|
+
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, 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 };
|