@glasshome/ui 1.41.0 → 1.43.0
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 +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/anchor-placement.d.ts +34 -0
- package/dist/lib/balance-rows.d.ts +10 -4
- package/dist/lib/behavior/anchored.d.ts +26 -0
- package/dist/lib/behavior/button-root.d.ts +7 -0
- package/dist/lib/behavior/collection.d.ts +32 -0
- package/dist/lib/behavior/controllable.d.ts +8 -0
- package/dist/lib/behavior/dismiss.d.ts +13 -0
- package/dist/lib/behavior/focus-scope.d.ts +24 -0
- package/dist/lib/behavior/hide-outside.d.ts +7 -0
- package/dist/lib/behavior/layer-stack.d.ts +34 -0
- package/dist/lib/behavior/menu.d.ts +59 -0
- package/dist/lib/behavior/modal-root.d.ts +68 -0
- package/dist/lib/behavior/polymorphic.d.ts +6 -0
- package/dist/lib/behavior/presence.d.ts +18 -0
- package/dist/lib/behavior/range.d.ts +44 -0
- package/dist/lib/behavior/solid.d.ts +13 -0
- package/dist/lib/color/color.d.ts +41 -0
- package/dist/lib/color/index.d.ts +2 -0
- package/dist/lib/color/intl.d.ts +40 -0
- package/dist/lib/dock-slot-classes.d.ts +2 -0
- package/dist/lib/hold.d.ts +1 -1
- package/dist/lib/locale.d.ts +3 -0
- package/dist/lib/menu-classes.d.ts +2 -0
- package/dist/lib/motion-classes.d.ts +5 -2
- package/dist/lib/overlay-classes.d.ts +4 -0
- package/dist/lib/page-cover.d.ts +8 -0
- package/dist/lib/scroll-track.d.ts +3 -2
- package/dist/lib/section-tokens.d.ts +1 -1
- package/dist/lib/segment-classes.d.ts +2 -0
- package/dist/lib/shadow-layer.d.ts +0 -43
- package/dist/lib/toggle-set.d.ts +44 -0
- package/dist/lib/visually-hidden.d.ts +3 -0
- package/dist/solid/accordion.d.ts +35 -11
- package/dist/solid/alert-dialog.d.ts +5 -8
- package/dist/solid/avatar.d.ts +8 -4
- package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -2
- package/dist/solid/bottom-sheet/constants.d.ts +1 -1
- package/dist/solid/button.d.ts +5 -4
- package/dist/solid/charts.d.ts +1 -1
- package/dist/solid/checkbox.d.ts +14 -4
- package/dist/solid/collapsible.d.ts +33 -5
- package/dist/solid/color-disc.d.ts +1 -1
- package/dist/solid/color-slider.d.ts +1 -1
- package/dist/solid/color-wheel.d.ts +1 -1
- package/dist/solid/context-menu.d.ts +58 -24
- package/dist/solid/dialog-parts.d.ts +53 -16
- package/dist/solid/dialog.d.ts +7 -10
- package/dist/solid/dropdown-menu.d.ts +55 -24
- package/dist/solid/empty.d.ts +1 -1
- package/dist/solid/form.d.ts +5 -6
- package/dist/solid/hover-card.d.ts +65 -9
- package/dist/solid/index.d.ts +5 -2
- package/dist/solid/index.js +8671 -14317
- package/dist/solid/input-group.d.ts +6 -6
- package/dist/solid/item.d.ts +1 -1
- package/dist/solid/menu-parts.d.ts +175 -24
- package/dist/solid/option-card.d.ts +1 -4
- package/dist/solid/picker-row.d.ts +2 -0
- package/dist/solid/popover.d.ts +77 -12
- package/dist/solid/progress.d.ts +11 -3
- package/dist/solid/radio-group.d.ts +31 -6
- package/dist/solid/responsive-dialog.d.ts +3 -1
- package/dist/solid/scroll-area.d.ts +1 -1
- package/dist/solid/section-card.d.ts +2 -3
- package/dist/solid/select.d.ts +107 -10
- package/dist/solid/selection.d.ts +10 -1
- package/dist/solid/sheet.d.ts +6 -9
- package/dist/solid/sliding-indicator.d.ts +1 -1
- package/dist/solid/sonner.d.ts +1 -1
- package/dist/solid/stale-veil.d.ts +7 -0
- package/dist/solid/tabs.d.ts +28 -9
- package/dist/solid/toggle-group.d.ts +30 -5
- package/dist/solid/toggle.d.ts +11 -3
- package/dist/solid/tooltip.d.ts +71 -9
- package/dist/tokens/index.js +54 -51
- package/dist/{utils-CGN4X-2O.js → utils-3Codx-NZ.js} +848 -618
- package/package.json +6 -7
- package/src/index.ts +1 -0
- package/src/lib/anchor-placement.ts +77 -4
- package/src/lib/balance-rows.ts +115 -40
- package/src/lib/behavior/anchored.ts +106 -0
- package/src/lib/behavior/button-root.tsx +103 -0
- package/src/lib/behavior/collection.ts +218 -0
- package/src/lib/behavior/controllable.ts +22 -0
- package/src/lib/behavior/dismiss.ts +185 -0
- package/src/lib/behavior/focus-scope.ts +227 -0
- package/src/lib/behavior/hide-outside.ts +85 -0
- package/src/lib/behavior/layer-stack.ts +150 -0
- package/src/lib/behavior/menu.ts +470 -0
- package/src/lib/behavior/modal-root.tsx +452 -0
- package/src/lib/behavior/polymorphic.tsx +30 -0
- package/src/lib/behavior/presence.ts +89 -0
- package/src/lib/behavior/range.ts +212 -0
- package/src/lib/behavior/solid.ts +30 -0
- package/src/lib/clipboard.ts +4 -4
- package/src/lib/color/color.ts +746 -0
- package/src/lib/color/index.ts +2 -0
- package/src/lib/color/intl.ts +60 -0
- package/src/lib/dock-slot-classes.ts +3 -0
- package/src/lib/hold.ts +1 -1
- package/src/lib/locale.ts +62 -0
- package/src/lib/menu-classes.ts +3 -0
- package/src/lib/motion-classes.ts +33 -8
- package/src/lib/overlay-classes.ts +8 -3
- package/src/lib/page-cover.ts +47 -0
- package/src/lib/scroll-track.ts +11 -6
- package/src/lib/section-tokens.ts +1 -1
- package/src/lib/segment-classes.ts +3 -0
- package/src/lib/shadow-layer.ts +0 -136
- package/src/lib/toggle-set.ts +133 -0
- package/src/lib/visually-hidden.ts +15 -0
- package/src/solid/accordion.tsx +294 -20
- package/src/solid/alert-dialog.tsx +36 -85
- package/src/solid/area-picker.tsx +5 -3
- package/src/solid/avatar.tsx +98 -24
- package/src/solid/badge.tsx +5 -5
- package/src/solid/bottom-sheet/bottom-sheet.tsx +73 -129
- package/src/solid/bottom-sheet/constants.ts +3 -1
- package/src/solid/bottom-sheet/drag-controller.ts +11 -0
- package/src/solid/breadcrumb.tsx +4 -4
- package/src/solid/button-group.tsx +4 -4
- package/src/solid/button.tsx +12 -6
- package/src/solid/card.tsx +5 -4
- package/src/solid/charts.tsx +1 -1
- package/src/solid/checkbox.tsx +167 -44
- package/src/solid/collapsible.tsx +260 -12
- package/src/solid/color-disc.tsx +11 -12
- package/src/solid/color-slider.tsx +114 -47
- package/src/solid/color-wheel.tsx +137 -39
- package/src/solid/context-menu.tsx +287 -86
- package/src/solid/dialog-parts.tsx +135 -46
- package/src/solid/dialog.tsx +44 -76
- package/src/solid/dock-edit.tsx +5 -4
- package/src/solid/dock.tsx +6 -5
- package/src/solid/dropdown-menu.tsx +252 -107
- package/src/solid/empty.tsx +1 -1
- package/src/solid/entity-selector.tsx +5 -3
- package/src/solid/face-toggle.tsx +43 -18
- package/src/solid/form.tsx +9 -9
- package/src/solid/glyph-tile.tsx +48 -21
- package/src/solid/hover-card.tsx +288 -21
- package/src/solid/icon-picker.tsx +2 -1
- package/src/solid/image-picker.tsx +6 -5
- package/src/solid/index.ts +5 -4
- package/src/solid/input-group.tsx +7 -5
- package/src/solid/input-otp.tsx +2 -1
- package/src/solid/item.tsx +5 -5
- package/src/solid/logo.tsx +5 -4
- package/src/solid/menu-parts.tsx +619 -145
- package/src/solid/option-card.tsx +6 -10
- package/src/solid/picker-row.tsx +10 -5
- package/src/solid/picker-search.tsx +2 -1
- package/src/solid/popover.tsx +424 -71
- package/src/solid/preview-tile.tsx +1 -1
- package/src/solid/progress.tsx +84 -15
- package/src/solid/radio-group.tsx +271 -34
- package/src/solid/responsive-dialog.tsx +10 -10
- package/src/solid/schema-form.tsx +1 -6
- package/src/solid/scroll-area.tsx +1 -1
- package/src/solid/section-card.tsx +3 -4
- package/src/solid/select.tsx +950 -95
- package/src/solid/selection.tsx +142 -66
- package/src/solid/sheet.tsx +48 -80
- package/src/solid/slider.tsx +115 -65
- package/src/solid/sliding-indicator.tsx +1 -1
- package/src/solid/sonner.tsx +1 -1
- package/src/solid/spotlight.tsx +23 -11
- package/src/solid/stale-veil.tsx +20 -0
- package/src/solid/switch.tsx +8 -6
- package/src/solid/tabs.tsx +377 -52
- package/src/solid/term.tsx +3 -4
- package/src/solid/toggle-group.tsx +237 -95
- package/src/solid/toggle.tsx +43 -9
- package/src/solid/tooltip.tsx +285 -26
- package/src/styles/globals.css +64 -10
- package/src/styles/theme.css +12 -4
- package/src/tokens/material.ts +11 -2
- package/dist/lib/when-animations-settle.d.ts +0 -4
- package/dist/solid/bottom-sheet/focus-trap.d.ts +0 -6
- package/dist/solid/bottom-sheet/scroll-lock.d.ts +0 -2
- package/dist/solid/bottom-sheet/sheet-motion.d.ts +0 -1
- package/src/lib/when-animations-settle.ts +0 -12
- package/src/solid/bottom-sheet/focus-trap.ts +0 -63
- package/src/solid/bottom-sheet/scroll-lock.ts +0 -66
- package/src/solid/bottom-sheet/sheet-motion.ts +0 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useRadioGroupContext } from "@kobalte/core/radio-group";
|
|
2
1
|
import {
|
|
3
2
|
children,
|
|
4
3
|
createContext,
|
|
@@ -15,10 +14,10 @@ import { cn } from "../lib/utils.js";
|
|
|
15
14
|
import { Icon } from "./icon.js";
|
|
16
15
|
import { Ornament } from "./ornament.js";
|
|
17
16
|
import { PickerRow } from "./picker-row.js";
|
|
18
|
-
import { isItemActivation, RadioGroup, RadioGroupItem } from "./radio-group.js";
|
|
17
|
+
import { isItemActivation, RadioGroup, RadioGroupItem, useRadioGroup } from "./radio-group.js";
|
|
19
18
|
|
|
20
19
|
/* Tone without .glass-tint: the card holds body copy, which must stay foreground-coloured. */
|
|
21
|
-
const OPTION_CARD_CHROME = `${CARD_SURFACE} group/option-card relative cursor-pointer overflow-hidden rounded-xl transition-glass duration-
|
|
20
|
+
const OPTION_CARD_CHROME = `${CARD_SURFACE} group/option-card relative cursor-pointer overflow-hidden rounded-xl transition-glass duration-(--duration-expand) [&:not([style*=--glass-tone])]:[--glass-tone:var(--primary)] [--glass-wash:9%] hover:[--glass-wash:16%] has-[:focus-visible]:[--glass-edge:var(--ring)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50 data-[checked]:[--glass-wash:30%] data-[checked]:[--glass-edge:oklch(from_var(--glass-tone)_l_c_h/0.75)] data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`;
|
|
22
21
|
|
|
23
22
|
/* Sub-options live inside the card: the card grows (a grid row morphing
|
|
24
23
|
* 0fr -> 1fr on the morph token) while it is picked, and the content settles
|
|
@@ -28,7 +27,7 @@ const OPTION_CARD_DRAWER =
|
|
|
28
27
|
/* Flat: hover is a tint, the current row is the check plus full text colour.
|
|
29
28
|
* The rows start under the title text (card pad + icon + gap, less the row's own pad). */
|
|
30
29
|
const OPTION_CHOICE_ROW =
|
|
31
|
-
"rounded-sm text-foreground/75 transition-colors hover:bg-foreground/5 aria-checked:text-foreground";
|
|
30
|
+
"rounded-sm text-foreground/75 transition-colors duration-(--duration-state) hover:bg-foreground/5 aria-checked:text-foreground";
|
|
32
31
|
|
|
33
32
|
const OPTION_CARD_DRAWER_CONTENT =
|
|
34
33
|
"-translate-y-2 flex flex-col gap-0.5 pr-1 pb-2 pl-[calc(var(--spacing)*3.5+54px)] opacity-0 transition-[opacity,translate] duration-(--duration-expand) ease-(--ease-morph) group-data-[checked]/option-card:translate-y-0 group-data-[checked]/option-card:opacity-100 group-data-[checked]/option-card:delay-[var(--stagger-base,80ms)]";
|
|
@@ -86,7 +85,7 @@ export function OptionCardGroup(props: {
|
|
|
86
85
|
return (
|
|
87
86
|
<RadioGroup
|
|
88
87
|
class={cn("gap-2", props.class)}
|
|
89
|
-
value={props.value ??
|
|
88
|
+
value={props.value ?? ""}
|
|
90
89
|
onChange={props.onChange}
|
|
91
90
|
aria-label={props["aria-label"]}
|
|
92
91
|
aria-labelledby={props["aria-labelledby"]}
|
|
@@ -120,7 +119,7 @@ export function OptionCard(props: {
|
|
|
120
119
|
* reveal them while it is picked. */
|
|
121
120
|
children?: JSX.Element;
|
|
122
121
|
}) {
|
|
123
|
-
const group =
|
|
122
|
+
const group = useRadioGroup();
|
|
124
123
|
const checked = () => group.isSelectedValue(props.value);
|
|
125
124
|
const [choices, setChoices] = createSignal<string[]>([]);
|
|
126
125
|
const choice: ChoiceContext = {
|
|
@@ -215,8 +214,5 @@ function OptionIconWell(props: { icon?: string; image?: string }) {
|
|
|
215
214
|
);
|
|
216
215
|
}
|
|
217
216
|
|
|
218
|
-
/**
|
|
219
|
-
* @deprecated OptionCard carries the same props; HeroOption is an alias.
|
|
220
|
-
* @alias
|
|
221
|
-
*/
|
|
217
|
+
/** @deprecated `OptionCard`; removed in 2.0.0. */
|
|
222
218
|
export const HeroOption = OptionCard;
|
package/src/solid/picker-row.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
splitProps,
|
|
7
7
|
type ValidComponent,
|
|
8
8
|
} from "solid-js";
|
|
9
|
-
import {
|
|
9
|
+
import { Polymorphic } from "../lib/behavior/polymorphic.js";
|
|
10
10
|
import { MENU_ITEM } from "../lib/menu-classes.js";
|
|
11
11
|
import { ICON_PILL, ICON_PILL_TINT } from "../lib/pill-classes.js";
|
|
12
12
|
import { cn } from "../lib/utils.js";
|
|
@@ -27,6 +27,8 @@ type PickerRowProps = Omit<ComponentProps<"button">, "title"> & {
|
|
|
27
27
|
subtitle?: JSX.Element;
|
|
28
28
|
meta?: JSX.Element;
|
|
29
29
|
selected: boolean;
|
|
30
|
+
/** The row the keys point at; it carries `data-highlighted` and the selection glass. */
|
|
31
|
+
highlighted?: boolean;
|
|
30
32
|
multi: boolean;
|
|
31
33
|
dimmed?: boolean;
|
|
32
34
|
};
|
|
@@ -39,6 +41,7 @@ export function PickerRow(props: PickerRowProps) {
|
|
|
39
41
|
"subtitle",
|
|
40
42
|
"meta",
|
|
41
43
|
"selected",
|
|
44
|
+
"highlighted",
|
|
42
45
|
"multi",
|
|
43
46
|
"dimmed",
|
|
44
47
|
"class",
|
|
@@ -46,8 +49,9 @@ export function PickerRow(props: PickerRowProps) {
|
|
|
46
49
|
const subtitle = children(() => local.subtitle);
|
|
47
50
|
const meta = children(() => local.meta);
|
|
48
51
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
52
|
+
<Polymorphic
|
|
53
|
+
defaultAs="div"
|
|
54
|
+
as={local.as}
|
|
51
55
|
class={cn(
|
|
52
56
|
MENU_ITEM,
|
|
53
57
|
"w-full cursor-pointer gap-3 py-0 text-left",
|
|
@@ -55,9 +59,10 @@ export function PickerRow(props: PickerRowProps) {
|
|
|
55
59
|
local.class,
|
|
56
60
|
)}
|
|
57
61
|
style={{ "min-height": `${PICKER_ROW_HEIGHT}px` }}
|
|
62
|
+
data-highlighted={local.highlighted ? "" : undefined}
|
|
58
63
|
{...rest}
|
|
59
64
|
>
|
|
60
|
-
<SelectionHighlight />
|
|
65
|
+
<SelectionHighlight active={local.highlighted} />
|
|
61
66
|
<Show when={local.icon}>
|
|
62
67
|
{(icon) => (
|
|
63
68
|
<div
|
|
@@ -108,6 +113,6 @@ export function PickerRow(props: PickerRowProps) {
|
|
|
108
113
|
/>
|
|
109
114
|
</div>
|
|
110
115
|
</Show>
|
|
111
|
-
</
|
|
116
|
+
</Polymorphic>
|
|
112
117
|
);
|
|
113
118
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX, Show, splitProps } from "solid-js";
|
|
2
|
+
import { focusWithoutTracking } from "../lib/behavior/focus-scope.js";
|
|
2
3
|
import { CONTROL_H, FIELD_TEXT } from "../lib/input-classes.js";
|
|
3
4
|
import { CONTROL_H_TOUCH } from "../lib/picker-classes.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
@@ -76,7 +77,7 @@ export function PickerSearch(props: PickerSearchProps) {
|
|
|
76
77
|
class="text-muted-foreground hover:text-foreground shrink-0 rounded-sm p-1 transition-colors"
|
|
77
78
|
onClick={() => {
|
|
78
79
|
local.onValueChange?.("");
|
|
79
|
-
input
|
|
80
|
+
focusWithoutTracking(input, { preventScroll: false });
|
|
80
81
|
}}
|
|
81
82
|
>
|
|
82
83
|
<Icon icon="mdi:close-circle" width={16} height={16} />
|