@glasshome/ui 1.43.0 → 1.44.1
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/SPEC.md +8 -5
- package/dist/index.js +2 -2
- package/dist/lib/behavior/anchored.d.ts +7 -8
- package/dist/lib/behavior/focus-scope.d.ts +4 -2
- package/dist/lib/behavior/menu.d.ts +3 -0
- package/dist/lib/motion-classes.d.ts +1 -0
- package/dist/solid/data-table.d.ts +4 -2
- package/dist/solid/index.js +3115 -3123
- package/dist/{utils-3Codx-NZ.js → utils-BbIeGt7o.js} +524 -500
- package/package.json +1 -1
- package/src/lib/behavior/anchored.ts +17 -3
- package/src/lib/behavior/collection.ts +9 -18
- package/src/lib/behavior/focus-scope.ts +51 -10
- package/src/lib/behavior/menu.ts +20 -28
- package/src/lib/behavior/modal-root.tsx +2 -2
- package/src/lib/clipboard.ts +2 -2
- package/src/lib/motion-classes.ts +1 -2
- package/src/solid/area-picker.tsx +1 -2
- package/src/solid/bottom-sheet/arbitration.ts +4 -11
- package/src/solid/bottom-sheet/bottom-sheet.tsx +3 -4
- package/src/solid/bottom-sheet/drag-controller.ts +7 -20
- package/src/solid/data-table.tsx +48 -22
- package/src/solid/dialog-parts.tsx +30 -8
- package/src/solid/dock.tsx +41 -41
- package/src/solid/entity-selector.tsx +0 -1
- package/src/solid/icon-picker.tsx +1 -2
- package/src/solid/image-picker.tsx +2 -2
- package/src/solid/menu-parts.tsx +1 -20
- package/src/solid/option-card.tsx +1 -3
- package/src/solid/popover.tsx +10 -12
- package/src/solid/select.tsx +4 -15
- package/src/solid/selection.tsx +28 -13
- package/src/solid/sliding-indicator.tsx +3 -15
- package/src/solid/toggle-group.tsx +5 -2
- package/src/styles/globals.css +0 -43
- package/src/styles/theme.css +11 -2
|
@@ -19,13 +19,6 @@ function samePos(a: Pos, b: Pos): boolean {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function readTranslate(el: HTMLElement): [number, number] {
|
|
23
|
-
const t = getComputedStyle(el).translate;
|
|
24
|
-
if (!t || t === "none") return [0, 0];
|
|
25
|
-
const [x = "0", y = "0"] = t.split(" ");
|
|
26
|
-
return [Number.parseFloat(x) || 0, Number.parseFloat(y) || 0];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
22
|
/**
|
|
30
23
|
* The sliding "moving background": a tinted indicator that measures the active item
|
|
31
24
|
* among its children and animates its position/size behind it. Reusable across
|
|
@@ -185,26 +178,21 @@ export function SlidingIndicator(props: SlidingIndicatorProps) {
|
|
|
185
178
|
// not just a direct child. Add the container's own scroll so the indicator,
|
|
186
179
|
// which scrolls with the content, lands at the content offset; subtract the
|
|
187
180
|
// border so it aligns to the padding box (where the absolute indicator anchors).
|
|
188
|
-
// A row arriving through gh-stagger is still translated: bounding rects
|
|
189
|
-
// include that travel, its resting place does not.
|
|
190
181
|
// An ancestor mid-zoom (a dialog opening) scales every rect and ends without
|
|
191
182
|
// a resize, so rects convert back to layout pixels by the container's ratio.
|
|
192
183
|
const sx = containerRef.offsetWidth > 0 ? cr.width / containerRef.offsetWidth : 1;
|
|
193
184
|
const sy = containerRef.offsetHeight > 0 ? cr.height / containerRef.offsetHeight : 1;
|
|
194
|
-
const [tx, ty] = readTranslate(el);
|
|
195
185
|
place(
|
|
196
186
|
el,
|
|
197
187
|
horizontal()
|
|
198
188
|
? {
|
|
199
|
-
offset:
|
|
200
|
-
(er.left - cr.left) / sx - tx - containerRef.clientLeft + containerRef.scrollLeft,
|
|
189
|
+
offset: (er.left - cr.left) / sx - containerRef.clientLeft + containerRef.scrollLeft,
|
|
201
190
|
size: er.width / sx,
|
|
202
191
|
cross: er.height / sy,
|
|
203
|
-
crossOffset:
|
|
204
|
-
(er.top - cr.top) / sy - ty - containerRef.clientTop + containerRef.scrollTop,
|
|
192
|
+
crossOffset: (er.top - cr.top) / sy - containerRef.clientTop + containerRef.scrollTop,
|
|
205
193
|
}
|
|
206
194
|
: {
|
|
207
|
-
offset: (er.top - cr.top) / sy -
|
|
195
|
+
offset: (er.top - cr.top) / sy - containerRef.clientTop + containerRef.scrollTop,
|
|
208
196
|
size: er.height / sy,
|
|
209
197
|
cross: er.width / sx,
|
|
210
198
|
crossOffset: 0,
|
|
@@ -62,6 +62,9 @@ type ToggleGroupContextValue = VariantProps<typeof toggleVariants> & {
|
|
|
62
62
|
set: ToggleSet;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
// A stacked item keeps its control height: flex-1 in a column would shrink it to its text.
|
|
66
|
+
const STACKED_ITEMS = "[&_[data-slot=toggle-group-item]]:flex-none";
|
|
67
|
+
|
|
65
68
|
const ToggleGroupContext = createContext<ToggleGroupContextValue | null>(null);
|
|
66
69
|
|
|
67
70
|
const useToggleGroup = (): ToggleGroupContextValue => {
|
|
@@ -180,7 +183,7 @@ const ToggleGroup: ParentComponent<ToggleGroupProps> = (props) => {
|
|
|
180
183
|
props.scroll
|
|
181
184
|
? `flex [scrollbar-width:none] flex-nowrap overflow-x-auto ${SCROLL_TRACK_FADE}`
|
|
182
185
|
: vertical()
|
|
183
|
-
?
|
|
186
|
+
? `flex flex-col items-stretch ${STACKED_ITEMS}`
|
|
184
187
|
: sliding()
|
|
185
188
|
? "flex"
|
|
186
189
|
: undefined,
|
|
@@ -203,7 +206,7 @@ const ToggleGroup: ParentComponent<ToggleGroupProps> = (props) => {
|
|
|
203
206
|
props.scroll
|
|
204
207
|
? "flex w-max flex-nowrap items-center"
|
|
205
208
|
: vertical()
|
|
206
|
-
?
|
|
209
|
+
? `flex w-full flex-col items-stretch gap-y-0.5 ${STACKED_ITEMS}`
|
|
207
210
|
: "w-full items-center gap-y-1"
|
|
208
211
|
}
|
|
209
212
|
>
|
package/src/styles/globals.css
CHANGED
|
@@ -783,49 +783,6 @@
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
-
/* Children arrive one after another. Mount-only (a CSS animation runs when
|
|
787
|
-
* the child is inserted), so a live re-render never re-staggers; a child
|
|
788
|
-
* added later takes its own slot, capped so a long list never waits. The
|
|
789
|
-
* travel is `translate`, never `transform`, so a positioned child (the
|
|
790
|
-
* sliding indicator) keeps its own transform. A group is transparent: its
|
|
791
|
-
* rows take slots, it does not. Slots come from --i: nth-child below for a
|
|
792
|
-
* flat list, or written inline by a part that knows its true order. */
|
|
793
|
-
@keyframes stagger-in {
|
|
794
|
-
from {
|
|
795
|
-
opacity: 0;
|
|
796
|
-
/* Upward: a child of a scroll container must not extend its scrollable
|
|
797
|
-
* height mid-animation, and rows trail a downward-growing edge. */
|
|
798
|
-
translate: 0 -8px;
|
|
799
|
-
}
|
|
800
|
-
to {
|
|
801
|
-
opacity: 1;
|
|
802
|
-
translate: 0 0;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
.gh-stagger > :not([role="group"], [data-selection-flyer]),
|
|
806
|
-
.gh-stagger > [role="group"] > * {
|
|
807
|
-
animation: stagger-in calc(var(--duration-morph) * 0.5) var(--ease-emphasis) both;
|
|
808
|
-
animation-delay: calc(var(--stagger-base, 80ms) + var(--i, 0) * var(--stagger-step, 60ms));
|
|
809
|
-
}
|
|
810
|
-
.gh-stagger > :nth-child(2) {
|
|
811
|
-
--i: 1;
|
|
812
|
-
}
|
|
813
|
-
.gh-stagger > :nth-child(3) {
|
|
814
|
-
--i: 2;
|
|
815
|
-
}
|
|
816
|
-
.gh-stagger > :nth-child(4) {
|
|
817
|
-
--i: 3;
|
|
818
|
-
}
|
|
819
|
-
.gh-stagger > :nth-child(5) {
|
|
820
|
-
--i: 4;
|
|
821
|
-
}
|
|
822
|
-
.gh-stagger > :nth-child(6) {
|
|
823
|
-
--i: 5;
|
|
824
|
-
}
|
|
825
|
-
.gh-stagger > :nth-child(n + 7) {
|
|
826
|
-
--i: 6;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
786
|
/* Selection (solid/selection.tsx). Plain CSS on data attributes: a published widget compiles its
|
|
830
787
|
* utilities from the ui source it was built against, so a new utility here would be missing there. */
|
|
831
788
|
[data-selection-highlight],
|
package/src/styles/theme.css
CHANGED
|
@@ -621,14 +621,18 @@ html[data-motion="live"] [data-motion-reader] {
|
|
|
621
621
|
--duration-arrive: 0ms;
|
|
622
622
|
--duration-jiggle: 0ms;
|
|
623
623
|
--duration-slide: 0ms;
|
|
624
|
-
--stagger-base: 0ms;
|
|
625
|
-
--stagger-step: 0ms;
|
|
626
624
|
}
|
|
627
625
|
/* tw-animate enter/exit classes carry their own fallback duration. */
|
|
628
626
|
.animate-in,
|
|
629
627
|
.animate-out {
|
|
630
628
|
--tw-animation-duration: 1ms;
|
|
631
629
|
}
|
|
630
|
+
/* A literal duration-* class bypasses the scale. 0, as the scale is: no transition starts at all. */
|
|
631
|
+
*,
|
|
632
|
+
::before,
|
|
633
|
+
::after {
|
|
634
|
+
transition-duration: 0s !important;
|
|
635
|
+
}
|
|
632
636
|
}
|
|
633
637
|
|
|
634
638
|
/* Performance: disable all backdrop-filter when reduce-blur is active */
|
|
@@ -708,6 +712,11 @@ html[data-motion="live"] [data-motion-reader] {
|
|
|
708
712
|
.bs-content[data-state="closing"] {
|
|
709
713
|
animation: bs-slide-down var(--bs-duration) var(--bs-ease) forwards;
|
|
710
714
|
}
|
|
715
|
+
/* A body at its top leaves a downward swipe to the sheet's drag, since a touchmove listener may be passive.
|
|
716
|
+
Widgets ship this sheet, so it keeps to syntax the sealed realm's CSS scanner accepts. */
|
|
717
|
+
.bs-content [data-slot$="-body"]:not([data-scrolled]) {
|
|
718
|
+
touch-action: pan-down pinch-zoom;
|
|
719
|
+
}
|
|
711
720
|
.bs-content[data-reduced-motion] {
|
|
712
721
|
animation-duration: 0ms !important;
|
|
713
722
|
}
|