@threadlabs/looma 0.37.5 → 0.37.6

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.
@@ -0,0 +1,151 @@
1
+ import { C as useReflectedProp, _ as nativeAttrs, a as checkHydratedRoot, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
2
+ import { h as vuePropInputs, i as checkPropInput, m as vPropValidity, t as BINDING_INPUTS_PROP } from "./props.js";
3
+ import { computed, createElementBlock, defineComponent, mergeProps, openBlock, unref, watchSyncEffect, withDirectives } from "vue";
4
+ //#region .build/vue/UiSkeleton.vue?vue&type=script&setup=true&lang.ts
5
+ var _hoisted_1 = [
6
+ "data-ui-skeleton-prop-animated",
7
+ "data-ui-skeleton-prop-height",
8
+ "data-ui-skeleton-prop-shape",
9
+ "data-ui-skeleton-prop-width",
10
+ "data-ui-skeleton-state"
11
+ ];
12
+ //#endregion
13
+ //#region .build/vue/UiSkeleton.vue
14
+ var UiSkeleton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
15
+ inheritAttrs: false,
16
+ __name: "UiSkeleton",
17
+ props: {
18
+ animated: { type: null },
19
+ height: { type: null },
20
+ shape: { type: null },
21
+ width: { type: null },
22
+ [BINDING_INPUTS_PROP]: { type: null }
23
+ },
24
+ setup(__props) {
25
+ const propValidityContract = { props: {
26
+ animated: {
27
+ type: {
28
+ kind: "terminal",
29
+ name: "boolean"
30
+ },
31
+ required: false,
32
+ target: { attribute: "animated" },
33
+ description: "Gently pulses the placeholder. Off by default, and always still when the reader requests reduced motion.",
34
+ default: false
35
+ },
36
+ height: {
37
+ type: {
38
+ kind: "terminal",
39
+ name: "string"
40
+ },
41
+ required: false,
42
+ target: { attribute: "height" },
43
+ description: "Block size as a CSS length. Empty reserves one line for text, a square for circles, or 8rem for rectangles. Set only width to keep a circle square.",
44
+ default: ""
45
+ },
46
+ shape: {
47
+ type: {
48
+ kind: "terminal",
49
+ name: "keyword"
50
+ },
51
+ required: false,
52
+ target: { attribute: "shape" },
53
+ description: "The content's silhouette. text reserves one inherited line box with a shorter bar inside it; circle matches a medium Avatar; rectangle reserves a media\n area.",
54
+ values: [
55
+ "text",
56
+ "circle",
57
+ "rectangle"
58
+ ],
59
+ default: "text"
60
+ },
61
+ width: {
62
+ type: {
63
+ kind: "terminal",
64
+ name: "string"
65
+ },
66
+ required: false,
67
+ target: { attribute: "width" },
68
+ description: "Inline size as a CSS length or percentage, constrained to the container. Empty fills the available width for text and rectangles, or matches a medium\n Avatar's outer size for circles.",
69
+ default: ""
70
+ }
71
+ } };
72
+ const props = __props;
73
+ const inputTracking = vuePropInputs({
74
+ animated: false,
75
+ height: "",
76
+ shape: "text",
77
+ width: ""
78
+ }, {
79
+ animated: false,
80
+ height: "",
81
+ shape: "text",
82
+ width: ""
83
+ }, (name, value, source, values) => {
84
+ switch (name) {
85
+ case "animated": return checkPropInput(value, {
86
+ kind: "terminal",
87
+ name: "boolean"
88
+ }, true, true);
89
+ case "height": return checkPropInput(value, {
90
+ kind: "terminal",
91
+ name: "string"
92
+ }, true, true);
93
+ case "shape": return checkPropInput(value, {
94
+ kind: "terminal",
95
+ name: "keyword"
96
+ }, true, true);
97
+ case "width": return checkPropInput(value, {
98
+ kind: "terminal",
99
+ name: "string"
100
+ }, true, true);
101
+ default: return { ok: false };
102
+ }
103
+ }, () => {
104
+ checkedProps.value;
105
+ });
106
+ const propInputs = inputTracking.inputs;
107
+ const checkedProps = computed(() => {
108
+ inputTracking.version.value;
109
+ return {
110
+ animated: propInputs.value("animated", props["animated"], props[BINDING_INPUTS_PROP]),
111
+ height: propInputs.value("height", props["height"], props[BINDING_INPUTS_PROP]),
112
+ shape: propInputs.value("shape", props["shape"], props[BINDING_INPUTS_PROP]),
113
+ width: propInputs.value("width", props["width"], props[BINDING_INPUTS_PROP])
114
+ };
115
+ });
116
+ checkedProps.value;
117
+ watchSyncEffect(() => {
118
+ checkedProps.value;
119
+ });
120
+ const reflectedProp = useReflectedProp();
121
+ checkHydratedRoot("span", "ui-skeleton");
122
+ /** The values the styles' :host() and :state() rules test. */
123
+ const hostState = computed(() => [
124
+ checkedProps.value.shape && "shape",
125
+ checkedProps.value.shape != null && `shape=${encodeURIComponent(checkedProps.value.shape)}`,
126
+ checkedProps.value.animated && "animated"
127
+ ].filter(Boolean).join(" "));
128
+ return (_ctx, _cache) => {
129
+ return withDirectives((openBlock(), createElementBlock("span", mergeProps({
130
+ class: "ui-skeleton",
131
+ "aria-hidden": "true"
132
+ }, unref(nativeAttrs)(_ctx.$attrs), {
133
+ "data-hn": "",
134
+ style: {
135
+ "--ui-skeleton-width": checkedProps.value.width ?? void 0,
136
+ "--ui-skeleton-height": checkedProps.value.height ?? void 0
137
+ },
138
+ "data-ui-skeleton-prop-animated": unref(reflectedProp)("animated", "animated", checkedProps.value.animated, void 0, false),
139
+ "data-ui-skeleton-prop-height": unref(reflectedProp)("height", "height", checkedProps.value.height, void 0, false),
140
+ "data-ui-skeleton-prop-shape": unref(reflectedProp)("shape", "shape", checkedProps.value.shape, void 0, false),
141
+ "data-ui-skeleton-prop-width": unref(reflectedProp)("width", "width", checkedProps.value.width, void 0, false),
142
+ "data-ui-skeleton-state": hostState.value || void 0
143
+ }), null, 16, _hoisted_1)), [[unref(vPropValidity), {
144
+ contract: propValidityContract,
145
+ values: { ...props }
146
+ }]]);
147
+ };
148
+ }
149
+ }), [["__scopeId", "data-v-ee40410c"]]);
150
+ //#endregion
151
+ export { UiSkeleton_default as t };
@@ -10401,6 +10401,77 @@ dialog:where([data-hn-ui-search-shell]) {
10401
10401
  }
10402
10402
  }
10403
10403
 
10404
+ /* Dimensions belong to this placeholder, never a nested or neighbouring one. */
10405
+ @property --ui-skeleton-width {
10406
+ syntax: "*";
10407
+ inherits: false;
10408
+ }
10409
+ @property --ui-skeleton-height {
10410
+ syntax: "*";
10411
+ inherits: false;
10412
+ }
10413
+ @keyframes ui-skeleton-pulse-ee40410c {
10414
+ 50% {
10415
+ opacity: 0.45;
10416
+ }
10417
+ }
10418
+ @scope (.ui-skeleton) to ([data-hn]) {
10419
+ :scope {
10420
+ display: block !important;
10421
+ position: relative;
10422
+ box-sizing: border-box !important;
10423
+ flex: none;
10424
+ min-inline-size: 0;
10425
+ max-inline-size: 100%;
10426
+ inline-size: var(--ui-skeleton-width, 100%);
10427
+ block-size: var(--ui-skeleton-height, 1lh);
10428
+ margin: 0 !important;
10429
+ font: inherit;
10430
+ }
10431
+ :scope::before {
10432
+ content: "";
10433
+ position: absolute;
10434
+ inset: 0;
10435
+ border-radius: var(--ui-radius-sm);
10436
+ background: color-mix(in srgb, var(--ui-text-primary) 16%, transparent);
10437
+ }
10438
+ :scope[data-ui-skeleton-state~="shape=text"]::before {
10439
+ inset-block: 22%;
10440
+ }
10441
+ :scope[data-ui-skeleton-state~="shape=circle"] {
10442
+ inline-size: var(--ui-skeleton-width, calc(2.5rem + 2 * var(--ui-border-width)));
10443
+ block-size: var(--ui-skeleton-height, auto);
10444
+ aspect-ratio: 1;
10445
+ }
10446
+ :scope[data-ui-skeleton-state~="shape=circle"]::before {
10447
+ border-radius: var(--ui-radius-round);
10448
+ }
10449
+ :scope[data-ui-skeleton-state~="shape=rectangle"] {
10450
+ block-size: var(--ui-skeleton-height, 8rem);
10451
+ }
10452
+ :scope[data-ui-skeleton-state~="shape=rectangle"]::before {
10453
+ border-radius: var(--ui-radius-md);
10454
+ }
10455
+ :scope[data-ui-skeleton-state~="animated"]::before {
10456
+ animation: ui-skeleton-pulse-ee40410c 1.6s ease-in-out infinite;
10457
+ }
10458
+ @media (prefers-reduced-motion: reduce) {
10459
+ :scope[data-ui-skeleton-state~="animated"]::before {
10460
+ animation: none;
10461
+ }
10462
+ }
10463
+ @media (forced-colors: active) {
10464
+ :scope::before {
10465
+ background: CanvasText;
10466
+ opacity: 0.2;
10467
+ animation: none;
10468
+ }
10469
+ }
10470
+ :scope[hidden] {
10471
+ display: none !important;
10472
+ }
10473
+ }
10474
+
10404
10475
  @scope (.ui-slider) to ([data-hn]) {
10405
10476
  :scope {
10406
10477
  display: grid !important;
package/vue/index.d.ts CHANGED
@@ -71,6 +71,7 @@ export { default as Section } from "./UiSection.js";
71
71
  export { default as Select } from "./UiSelect.js";
72
72
  export { default as Separator } from "./UiSeparator.js";
73
73
  export { default as Sidebar } from "./UiSidebar.js";
74
+ export { default as Skeleton } from "./UiSkeleton.js";
74
75
  export { default as Slider } from "./UiSlider.js";
75
76
  export { default as Spinner } from "./UiSpinner.js";
76
77
  export { default as Stack } from "./UiStack.js";
package/vue/index.js CHANGED
@@ -77,6 +77,7 @@ import { t as UiSection_default } from "./chunks/UiSection.js";
77
77
  import { t as UiSelect_default } from "./chunks/UiSelect.js";
78
78
  import { t as UiSeparator_default } from "./chunks/UiSeparator.js";
79
79
  import { t as UiSidebar_default } from "./chunks/UiSidebar.js";
80
+ import { t as UiSkeleton_default } from "./chunks/UiSkeleton.js";
80
81
  import { t as UiSlider_default } from "./chunks/UiSlider.js";
81
82
  import { t as UiStatusMessage_default } from "./chunks/UiStatusMessage.js";
82
83
  import { t as UiSwitch_default } from "./chunks/UiSwitch.js";
@@ -89,4 +90,4 @@ import { t as UiTopBar_default } from "./chunks/UiTopBar.js";
89
90
  import { t as UiTree_default } from "./chunks/UiTree.js";
90
91
  import { t as UiTreeItem_default } from "./chunks/UiTreeItem.js";
91
92
  import { trackInputModality } from "@threadlabs/looma/components/shared/input-modality.js";
92
- 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, UiColorPicker_default as ColorPicker, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiCurveEditor_default as CurveEditor, UiCycleButton_default as CycleButton, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorBlockActions_default as EditorBlockActions, UiEditorChipEditor_default as EditorChipEditor, UiEditorCodeLanguage_default as EditorCodeLanguage, UiEditorFootnoteEditor_default as EditorFootnoteEditor, UiEditorImageToolbar_default as EditorImageToolbar, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorLinkCard_default as EditorLinkCard, UiEditorLinkForm_default as EditorLinkForm, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorMentionMenuItem_default as EditorMentionMenuItem, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorSlashMenuGroup_default as EditorSlashMenuGroup, UiEditorSlashMenuItem_default as EditorSlashMenuItem, UiEditorSurface_default as EditorSurface, 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, UiImage_default as Image, UiInput_default as Input, UiInputGroup_default as InputGroup, UiLightEditor_default as LightEditor, UiList_default as List, UiListItem_default as ListItem, UiListbox_default as Listbox, UiMenu_default as Menu, UiMenuGroup_default as MenuGroup, UiMenuItem_default as MenuItem, UiMeter_default as Meter, UiNavItem_default as NavItem, UiNumberInput_default as NumberInput, UiPageHeader_default as PageHeader, UiPagination_default as Pagination, 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, UiSlider_default as Slider, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwatch_default as Swatch, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToast_default as Toast, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };
93
+ 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, UiColorPicker_default as ColorPicker, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiCurveEditor_default as CurveEditor, UiCycleButton_default as CycleButton, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorBlockActions_default as EditorBlockActions, UiEditorChipEditor_default as EditorChipEditor, UiEditorCodeLanguage_default as EditorCodeLanguage, UiEditorFootnoteEditor_default as EditorFootnoteEditor, UiEditorImageToolbar_default as EditorImageToolbar, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorLinkCard_default as EditorLinkCard, UiEditorLinkForm_default as EditorLinkForm, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorMentionMenuItem_default as EditorMentionMenuItem, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorSlashMenuGroup_default as EditorSlashMenuGroup, UiEditorSlashMenuItem_default as EditorSlashMenuItem, UiEditorSurface_default as EditorSurface, 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, UiImage_default as Image, UiInput_default as Input, UiInputGroup_default as InputGroup, UiLightEditor_default as LightEditor, UiList_default as List, UiListItem_default as ListItem, UiListbox_default as Listbox, UiMenu_default as Menu, UiMenuGroup_default as MenuGroup, UiMenuItem_default as MenuItem, UiMeter_default as Meter, UiNavItem_default as NavItem, UiNumberInput_default as NumberInput, UiPageHeader_default as PageHeader, UiPagination_default as Pagination, 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, UiSkeleton_default as Skeleton, UiSlider_default as Slider, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwatch_default as Swatch, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToast_default as Toast, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };