@wow-two-beta/fe 0.0.26 → 0.0.27
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/README.md +15 -3
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-TuNWahLw.js → MasonryLayout.vue_vue_type_script_setup_true_lang-2CWeHWdV.js} +19 -4
- package/dist/chunks/MasonryLayout.vue_vue_type_script_setup_true_lang-2CWeHWdV.js.map +1 -0
- package/dist/chunks/UseScrollActivity-D8MC5xgH.js +37 -0
- package/dist/chunks/UseScrollActivity-D8MC5xgH.js.map +1 -0
- package/dist/chunks/{index-rh4HVTr5.js → index-COgbQxBT.js} +5 -1
- package/dist/chunks/{index-rh4HVTr5.js.map → index-COgbQxBT.js.map} +1 -1
- package/dist/chunks/{index-CuiXILXc.js → index-Dp6L9sX7.js} +6 -2
- package/dist/chunks/index-Dp6L9sX7.js.map +1 -0
- package/dist/foundation/dom/hooks/UseScrollActivity.d.ts +15 -0
- package/dist/foundation/dom/index.d.ts +1 -0
- package/dist/foundation/dom/index.js +7 -3
- package/dist/foundation/dom/index.js.map +1 -1
- package/dist/foundation/primitives/index.js +1 -1
- package/dist/foundation/primitives/scrollViewport/ScrollViewport.vue.d.ts +9 -0
- package/dist/index.css +83 -36
- package/dist/index.js +3 -3
- package/dist/presentation/layout/appShell/AppShellMain.vue.d.ts +14 -5
- package/dist/presentation/layout/index.js +1 -1
- package/dist/presentation/layout/scrollArea/ScrollArea.vue.d.ts +7 -0
- package/dist/presentation/layout/virtualScrollArea/VirtualScrollArea.vue.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/MasonryLayout.vue_vue_type_script_setup_true_lang-TuNWahLw.js.map +0 -1
- package/dist/chunks/index-CuiXILXc.js.map +0 -1
package/README.md
CHANGED
|
@@ -40,13 +40,25 @@ It registers the package's own utility classes, which Tailwind otherwise exclude
|
|
|
40
40
|
`themes.css` contains generated theme tokens and `themes.json` their manifest.
|
|
41
41
|
Load the theme stylesheet when using a generated theme class.
|
|
42
42
|
|
|
43
|
-
`styles.css` also themes every scrollbar on
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
`styles.css` also themes every scrollbar, on every device, and keeps it visible. Chromium and Safari draw a slim bar
|
|
44
|
+
with a rounded, inset thumb that follows the theme tokens (`--color-border-strong`, hover `--color-muted-foreground`)
|
|
45
|
+
in light and dark; Firefox draws a thin bar in the same colours. A styled bar is a classic one: its track takes its own
|
|
46
|
+
width beside the content (`AppShellMain` and `ScrollViewport` also reserve it with `scrollbar-gutter: stable`), so
|
|
47
|
+
content never sits under it, on phones as on desktops. A browser that keeps a system overlay scrollbar and ignores the
|
|
48
|
+
styling keeps that overlay, which fades on its own and floats over the content; the SDK does not fake a bar there
|
|
49
|
+
(iOS Safari and Firefox for Android are the two to confirm on a device). Opt one element out
|
|
46
50
|
with `class="scrollbar-native"`, or tune a subtree with `--scrollbar-size`, `--scrollbar-inset`, `--scrollbar-track`,
|
|
47
51
|
`--scrollbar-thumb` and `--scrollbar-thumb-hover`. The rules sit in `@layer base`, so an application's own scrollbar
|
|
48
52
|
CSS wins. Setting `scrollbar-width` or `scrollbar-color` on an element makes Chromium ignore the rounded style there.
|
|
49
53
|
|
|
54
|
+
Fading the thumb while idle is opt-in and off by default. `AppShellMain`, `ScrollArea`, `ScrollViewport` and
|
|
55
|
+
`VirtualScrollArea` take `hasAutoHideScrollbar`; a plain element takes `class="scrollbar-auto-hide"`. The thumb
|
|
56
|
+
fades out when nothing scrolls and returns while the pointer is over the element and while it carries `data-scrolling`.
|
|
57
|
+
The components set that attribute while their content scrolls; on a plain element, call `useScrollActivity(target)`
|
|
58
|
+
from `@wow-two-beta/fe/foundation/dom`, or set the attribute yourself, to bring the thumb back on touch devices, where
|
|
59
|
+
no pointer hovers. The track keeps its space, so the layout never shifts. The fade needs the styled bar, so it applies
|
|
60
|
+
wherever the bar does; `prefers-reduced-motion` makes it instant.
|
|
61
|
+
|
|
50
62
|
`platform` is the validated theme every wow-two platform app shares (Wheelhouse's chalk and forest palette).
|
|
51
63
|
A platform app imports `themes.css` after `styles.css` and sets `class="theme-platform"` on its root, plus `dark`
|
|
52
64
|
for dark mode and `surface-ambient` on the page for the backdrop; the `glass` variants of `Navbar`,
|
|
@@ -3,6 +3,7 @@ import { c as cn } from "./Cn-C7De6POU.js";
|
|
|
3
3
|
import { a as _sfc_main$E } from "./StackLayout.vue_vue_type_script_setup_true_lang-DuAFfjSc.js";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
5
|
import { O as Orientation } from "./Orientation-u-sYunuG.js";
|
|
6
|
+
import { u as useScrollActivity } from "./UseScrollActivity-D8MC5xgH.js";
|
|
6
7
|
import { Minus, Plus, Maximize, ChevronLeft } from "lucide-vue-next";
|
|
7
8
|
import { _ as _sfc_main$F } from "./Icon.vue_vue_type_script_setup_true_lang-Ca4wsJw9.js";
|
|
8
9
|
import { A as Align } from "./Align-DqFtCY3a.js";
|
|
@@ -552,18 +553,21 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
552
553
|
...{ name: "ScrollArea", inheritAttrs: false },
|
|
553
554
|
__name: "ScrollArea",
|
|
554
555
|
props: {
|
|
555
|
-
axis: { default: ScrollAxis.Vertical }
|
|
556
|
+
axis: { default: ScrollAxis.Vertical },
|
|
557
|
+
hasAutoHideScrollbar: { type: Boolean, default: false }
|
|
556
558
|
},
|
|
557
559
|
setup(__props, { expose: __expose }) {
|
|
558
560
|
const props = __props;
|
|
559
561
|
const attrs = useAttrs();
|
|
560
562
|
const el = useTemplateRef("el");
|
|
563
|
+
useScrollActivity(el, () => props.hasAutoHideScrollbar);
|
|
561
564
|
const classes = computed(
|
|
562
565
|
() => cn(
|
|
563
566
|
"relative",
|
|
564
567
|
props.axis === ScrollAxis.Vertical && "overflow-y-auto overflow-x-hidden",
|
|
565
568
|
props.axis === ScrollAxis.Horizontal && "overflow-x-auto overflow-y-hidden",
|
|
566
569
|
props.axis === ScrollAxis.Both && "overflow-auto",
|
|
570
|
+
props.hasAutoHideScrollbar && "scrollbar-auto-hide",
|
|
567
571
|
attrs.class
|
|
568
572
|
)
|
|
569
573
|
);
|
|
@@ -2176,16 +2180,23 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
2176
2180
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2177
2181
|
...{ name: "AppShellMain", inheritAttrs: false },
|
|
2178
2182
|
__name: "AppShellMain",
|
|
2183
|
+
props: {
|
|
2184
|
+
hasAutoHideScrollbar: { type: Boolean, default: false }
|
|
2185
|
+
},
|
|
2179
2186
|
setup(__props, { expose: __expose }) {
|
|
2187
|
+
const props = __props;
|
|
2180
2188
|
const attrs = useAttrs();
|
|
2181
2189
|
const el = useTemplateRef("el");
|
|
2182
2190
|
const context = inject(appShellContextKey, null);
|
|
2183
2191
|
const isRegion = computed(() => context?.scroll.value === AppShellScroll.Region);
|
|
2192
|
+
const isAutoHiding = computed(() => isRegion.value && props.hasAutoHideScrollbar);
|
|
2193
|
+
useScrollActivity(el, isAutoHiding);
|
|
2184
2194
|
const regionAttrs = computed(() => isRegion.value ? { [ScrollRegionAttribute]: "" } : {});
|
|
2185
2195
|
const classes = computed(
|
|
2186
2196
|
() => cn(
|
|
2187
2197
|
"flex flex-col [grid-area:main] focus:outline-hidden",
|
|
2188
2198
|
isRegion.value && "min-h-0 overflow-y-auto [scrollbar-gutter:stable]",
|
|
2199
|
+
isAutoHiding.value && "scrollbar-auto-hide",
|
|
2189
2200
|
attrs.class
|
|
2190
2201
|
)
|
|
2191
2202
|
);
|
|
@@ -3304,7 +3315,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3304
3315
|
overscan: { default: void 0 },
|
|
3305
3316
|
isHorizontal: { type: Boolean, default: false },
|
|
3306
3317
|
getKey: { type: Function, default: void 0 },
|
|
3307
|
-
endThreshold: { default: 5 }
|
|
3318
|
+
endThreshold: { default: 5 },
|
|
3319
|
+
hasAutoHideScrollbar: { type: Boolean, default: false }
|
|
3308
3320
|
},
|
|
3309
3321
|
emits: ["end-reached"],
|
|
3310
3322
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -3312,6 +3324,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3312
3324
|
const emit = __emit;
|
|
3313
3325
|
const attrs = useAttrs();
|
|
3314
3326
|
const viewport = useTemplateRef("viewport");
|
|
3327
|
+
useScrollActivity(viewport, () => props.hasAutoHideScrollbar);
|
|
3315
3328
|
const list = useVirtualList({
|
|
3316
3329
|
count: () => props.items.length,
|
|
3317
3330
|
estimateSize: (index) => typeof props.itemSize === "function" ? props.itemSize(index) : props.itemSize,
|
|
@@ -3331,7 +3344,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3331
3344
|
const { class: _class, ...others } = attrs;
|
|
3332
3345
|
return others;
|
|
3333
3346
|
});
|
|
3334
|
-
const viewportClass = computed(
|
|
3347
|
+
const viewportClass = computed(
|
|
3348
|
+
() => cn("relative overflow-auto", props.hasAutoHideScrollbar && "scrollbar-auto-hide", attrs.class)
|
|
3349
|
+
);
|
|
3335
3350
|
watch(
|
|
3336
3351
|
() => [list.range.value.endIndex, props.items.length],
|
|
3337
3352
|
([endIndex, length]) => {
|
|
@@ -3526,4 +3541,4 @@ export {
|
|
|
3526
3541
|
_sfc_main$A as y,
|
|
3527
3542
|
_sfc_main$C as z
|
|
3528
3543
|
};
|
|
3529
|
-
//# sourceMappingURL=MasonryLayout.vue_vue_type_script_setup_true_lang-
|
|
3544
|
+
//# sourceMappingURL=MasonryLayout.vue_vue_type_script_setup_true_lang-2CWeHWdV.js.map
|