@pathscale/ui 2.11.7 → 2.11.8
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/dist/components/dock/Dock.generated.js +1 -1
- package/dist/components/dropdown/Dropdown.css +32 -1
- package/dist/components/dropdown/Dropdown.generated.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.generated.js +44 -39
- package/dist/layouts.manifest.json +1 -1
- package/dist/purge-manifest.json +11 -1
- package/package.json +3 -2
|
@@ -5,7 +5,7 @@ import { For, Show, createSignal, omit, onCleanup, onSettled } from "solid-js";
|
|
|
5
5
|
import { twMerge } from "../../lib/twMerge.js";
|
|
6
6
|
import { CLASSES, componentRecipe } from "./Dock.recipe.js";
|
|
7
7
|
var _tmpl$ = /*#__PURE__*/ template("<div>"), _tmpl$2 = /*#__PURE__*/ template("<div><div>"), _tmpl$3 = /*#__PURE__*/ template("<button>"), _tmpl$4 = /*#__PURE__*/ template("<a>"), _tmpl$5 = /*#__PURE__*/ template("<div><!><!>"), _tmpl$6 = /*#__PURE__*/ template("<div><button>"), _tmpl$7 = /*#__PURE__*/ template('<svg><path d="M4 6h16"></path><path d="M4 12h16"></path><path d="M4 18h16">');
|
|
8
|
-
const prefersReducedMotion = "u" > typeof window && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8
|
+
const prefersReducedMotion = "u" > typeof window && "function" == typeof window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
9
9
|
function createSpring(initial, opts = {}) {
|
|
10
10
|
const mass = opts.mass ?? 1;
|
|
11
11
|
const stiffness = opts.stiffness ?? 150;
|
|
@@ -12,6 +12,20 @@
|
|
|
12
12
|
position: relative;
|
|
13
13
|
isolation: isolate;
|
|
14
14
|
display: inline-flex;
|
|
15
|
+
/*
|
|
16
|
+
* The border is inside the height a consumer asks for.
|
|
17
|
+
*
|
|
18
|
+
* There is no global `box-sizing` reset in this library, so this element
|
|
19
|
+
* was `content-box`: `height: 24px` set the *content* box and the 1px
|
|
20
|
+
* border on each side was added on top. AgencyZero's composer pill asks
|
|
21
|
+
* for `h-[24px]` and rendered at 28, measured on a running app, which is
|
|
22
|
+
* the sort of few-pixel drift that reads as a component quietly breaking
|
|
23
|
+
* its own contract.
|
|
24
|
+
*
|
|
25
|
+
* `border-box` makes an explicit height mean the height that lands on
|
|
26
|
+
* screen, which is what every caller already assumed.
|
|
27
|
+
*/
|
|
28
|
+
box-sizing: border-box;
|
|
15
29
|
min-height: 2.25rem;
|
|
16
30
|
width: fit-content;
|
|
17
31
|
align-items: center;
|
|
@@ -36,9 +50,26 @@
|
|
|
36
50
|
background-color: var(--dropdown-trigger-bg);
|
|
37
51
|
color: var(--dropdown-trigger-fg);
|
|
38
52
|
border-color: var(--dropdown-trigger-border);
|
|
39
|
-
|
|
53
|
+
/*
|
|
54
|
+
* The drop shadow is a variable so a caller can turn it off.
|
|
55
|
+
*
|
|
56
|
+
* `0 1px 2px` paints about 3px below the border box, and a shadow is not
|
|
57
|
+
* part of the box: an element declared `24px` occupies 24px of layout and
|
|
58
|
+
* reports bounds of 27.8. That is correct CSS and still wrong for a pill
|
|
59
|
+
* sized to sit inside a fixed-height composer row, where the visual result
|
|
60
|
+
* reads as the control quietly ignoring its own height. Measured on the
|
|
61
|
+
* running application: border-box 24.1, outer bounds 27.8, with border
|
|
62
|
+
* 0.9 and zero vertical padding - the whole 3.7px difference is this
|
|
63
|
+
* shadow.
|
|
64
|
+
*
|
|
65
|
+
* A variable rather than removal, because a dropdown on an ordinary
|
|
66
|
+
* surface wants the elevation. Set `--dropdown-trigger-shadow: none` on
|
|
67
|
+
* the trigger to opt out.
|
|
68
|
+
*/
|
|
69
|
+
--dropdown-trigger-shadow:
|
|
40
70
|
0 1px 2px rgb(var(--shadow-color, 0 0 0) / 6%),
|
|
41
71
|
0 1px 0 oklch(100% 0 0 / 0.03) inset;
|
|
72
|
+
box-shadow: var(--dropdown-trigger-shadow);
|
|
42
73
|
transition:
|
|
43
74
|
transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
44
75
|
background-color 150ms ease,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component as __LayoutComponent } from "solid-js";
|
|
2
2
|
import "./Dropdown.css";
|
|
3
|
-
import type
|
|
3
|
+
import { type JSX } from "@solidjs/web";
|
|
4
4
|
import { type OverlayPlacement } from "../_shared/overlayPosition";
|
|
5
5
|
type DropdownAlign = "start" | "end";
|
|
6
6
|
type DropdownPlacement = OverlayPlacement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createComponent, insert, mergeProps, ref, spread, template } from "@solidjs/web";
|
|
1
|
+
import { Portal, createComponent, insert, mergeProps, ref, spread, template } from "@solidjs/web";
|
|
2
2
|
import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
3
3
|
import "./Dropdown.css";
|
|
4
|
-
import { Show, createContext, createSignal, createTrackedEffect, createUniqueId, omit, onCleanup, onSettled, useContext } from "solid-js";
|
|
4
|
+
import { Show, createContext, createSignal, createTrackedEffect, createUniqueId, flush, omit, onCleanup, onSettled, useContext } from "solid-js";
|
|
5
5
|
import { twMerge } from "../../lib/twMerge.js";
|
|
6
6
|
import { createOverlayPosition } from "../_shared/overlayPosition.js";
|
|
7
7
|
import { CLASSES, componentRecipe } from "./Dropdown.recipe.js";
|
|
@@ -117,6 +117,7 @@ const __solidLayoutDropdownRoot = (_stable, p)=>{
|
|
|
117
117
|
if (menuRef()?.contains(target)) return;
|
|
118
118
|
if (triggerRef()?.contains(target)) return;
|
|
119
119
|
setOpen(false);
|
|
120
|
+
flush();
|
|
120
121
|
};
|
|
121
122
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
122
123
|
return ()=>{
|
|
@@ -337,44 +338,48 @@ const __solidLayoutDropdownMenu = (_stable, p)=>{
|
|
|
337
338
|
return ctx.open();
|
|
338
339
|
},
|
|
339
340
|
get children () {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
return createComponent(Portal, {
|
|
342
|
+
get children () {
|
|
343
|
+
var _el$6 = _tmpl$3(), _el$7 = _el$6.firstChild;
|
|
344
|
+
var _ref$ = ctx.setMenuRef;
|
|
345
|
+
"function" == typeof _ref$ || Array.isArray(_ref$) ? ref(()=>_ref$, _el$6) : ctx.setMenuRef = _el$6;
|
|
346
|
+
spread(_el$6, mergeProps(others, {
|
|
347
|
+
get id () {
|
|
348
|
+
return ctx.menuId;
|
|
349
|
+
}
|
|
350
|
+
}, ()=>({
|
|
351
|
+
class: twMerge(CLASSES.slot.popover, p.class)
|
|
352
|
+
}), {
|
|
353
|
+
get role () {
|
|
354
|
+
return p.role ?? "menu";
|
|
355
|
+
},
|
|
356
|
+
"data-slot": "dropdown-popover",
|
|
357
|
+
get ["data-open"] () {
|
|
358
|
+
return ctx.open() ? "true" : "false";
|
|
359
|
+
},
|
|
360
|
+
get ["data-align"] () {
|
|
361
|
+
return p.align ?? "start";
|
|
362
|
+
},
|
|
363
|
+
get ["data-placement"] () {
|
|
364
|
+
return overlayPosition.placement();
|
|
365
|
+
},
|
|
366
|
+
get ["aria-hidden"] () {
|
|
367
|
+
return ctx.open() ? "false" : "true";
|
|
368
|
+
},
|
|
369
|
+
get style () {
|
|
370
|
+
return menuStyle();
|
|
371
|
+
},
|
|
372
|
+
onKeyDown: handleKeyDown
|
|
373
|
+
}), true);
|
|
374
|
+
spread(_el$7, mergeProps(()=>({
|
|
375
|
+
class: CLASSES.slot.menu
|
|
376
|
+
}), {
|
|
377
|
+
"data-slot": "dropdown-menu"
|
|
378
|
+
}), true);
|
|
379
|
+
insert(_el$7, ()=>p.children);
|
|
380
|
+
return _el$6;
|
|
346
381
|
}
|
|
347
|
-
}
|
|
348
|
-
class: twMerge(CLASSES.slot.popover, p.class)
|
|
349
|
-
}), {
|
|
350
|
-
get role () {
|
|
351
|
-
return p.role ?? "menu";
|
|
352
|
-
},
|
|
353
|
-
"data-slot": "dropdown-popover",
|
|
354
|
-
get ["data-open"] () {
|
|
355
|
-
return ctx.open() ? "true" : "false";
|
|
356
|
-
},
|
|
357
|
-
get ["data-align"] () {
|
|
358
|
-
return p.align ?? "start";
|
|
359
|
-
},
|
|
360
|
-
get ["data-placement"] () {
|
|
361
|
-
return overlayPosition.placement();
|
|
362
|
-
},
|
|
363
|
-
get ["aria-hidden"] () {
|
|
364
|
-
return ctx.open() ? "false" : "true";
|
|
365
|
-
},
|
|
366
|
-
get style () {
|
|
367
|
-
return menuStyle();
|
|
368
|
-
},
|
|
369
|
-
onKeyDown: handleKeyDown
|
|
370
|
-
}), true);
|
|
371
|
-
spread(_el$7, mergeProps(()=>({
|
|
372
|
-
class: CLASSES.slot.menu
|
|
373
|
-
}), {
|
|
374
|
-
"data-slot": "dropdown-menu"
|
|
375
|
-
}), true);
|
|
376
|
-
insert(_el$7, ()=>p.children);
|
|
377
|
-
return _el$6;
|
|
382
|
+
});
|
|
378
383
|
}
|
|
379
384
|
});
|
|
380
385
|
};
|
package/dist/purge-manifest.json
CHANGED
|
@@ -15226,7 +15226,8 @@
|
|
|
15226
15226
|
"--dropdown-trigger-bg-hover",
|
|
15227
15227
|
"--dropdown-trigger-bg-pressed",
|
|
15228
15228
|
"--dropdown-trigger-border",
|
|
15229
|
-
"--dropdown-trigger-fg"
|
|
15229
|
+
"--dropdown-trigger-fg",
|
|
15230
|
+
"--dropdown-trigger-shadow"
|
|
15230
15231
|
],
|
|
15231
15232
|
"referenced": [
|
|
15232
15233
|
"--border",
|
|
@@ -15239,6 +15240,7 @@
|
|
|
15239
15240
|
"--dropdown-trigger-bg-pressed",
|
|
15240
15241
|
"--dropdown-trigger-border",
|
|
15241
15242
|
"--dropdown-trigger-fg",
|
|
15243
|
+
"--dropdown-trigger-shadow",
|
|
15242
15244
|
"--focus-ring-offset",
|
|
15243
15245
|
"--focus-ring-width",
|
|
15244
15246
|
"--radius-pill",
|
|
@@ -34640,6 +34642,14 @@
|
|
|
34640
34642
|
"Dropdown"
|
|
34641
34643
|
]
|
|
34642
34644
|
},
|
|
34645
|
+
"--dropdown-trigger-shadow": {
|
|
34646
|
+
"declaredBy": [
|
|
34647
|
+
"Dropdown"
|
|
34648
|
+
],
|
|
34649
|
+
"referencedBy": [
|
|
34650
|
+
"Dropdown"
|
|
34651
|
+
]
|
|
34652
|
+
},
|
|
34643
34653
|
"--color-swatch-current": {
|
|
34644
34654
|
"declaredBy": [],
|
|
34645
34655
|
"referencedBy": [
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pathscale/ui",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.8",
|
|
4
4
|
"author": "pathscale",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/pathscale/ui"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"description": "Highly opinionated SolidJS component library
|
|
10
|
+
"description": "Highly opinionated SolidJS component library — batteries and kitchen sink included, but optimized and shiny.",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"types": "./dist/motion/index.d.ts",
|
|
61
61
|
"import": "./dist/motion/index.js"
|
|
62
62
|
},
|
|
63
|
+
"./package.json": "./package.json",
|
|
63
64
|
"./styles/*": "./dist/styles/*",
|
|
64
65
|
"./dist/styles/*": "./dist/styles/*",
|
|
65
66
|
"./index.css": "./dist/index.css"
|