sinwan-ui-core 1.5.0 → 1.5.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/CHANGELOG.md +6 -0
- package/dist/chunks/{chunk-n6gs6631.js → chunk-0dsacv44.js} +1 -1
- package/dist/chunks/{chunk-hzq68qq0.js → chunk-6bm550r5.js} +1 -1
- package/dist/chunks/{chunk-dn425n4g.js → chunk-saen52f0.js} +1 -1
- package/dist/chunks/{chunk-vwgz1k38.js → chunk-zmvg5gy1.js} +1 -1
- package/dist/controls.js +2 -2
- package/dist/core.js +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/controlled.d.ts +5 -0
- package/dist/menu-sub.js +2 -2
- package/dist/overlay.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package uses [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [1.5.1]
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **The SW202 warning no longer ships in production bundles.** sinwan-ui-core is one bundle, and Bun inlined this package's own `process.env.NODE_ENV` while building `dist/`, so the SW202 check and its message stayed in every app's production bundle (it never printed, because `devWarn` is a no-op in sinwan's production build). The check is now guarded by `process.env.NODE_ENV !== "production"`, and `build.ts` leaves that expression in `dist/` for the app's bundler to replace (Bun by default, Vite for dependencies). A production build now drops the check, its message and the value read it needed; a development build keeps the warning.
|
|
10
|
+
|
|
5
11
|
## [1.5.0]
|
|
6
12
|
|
|
7
13
|
### Added
|
|
@@ -7,7 +7,7 @@ function currentValue(props, key) {
|
|
|
7
7
|
function isControlledProp(props, key, component) {
|
|
8
8
|
if (!(key in props))
|
|
9
9
|
return false;
|
|
10
|
-
if (currentValue(props, key) === undefined) {
|
|
10
|
+
if (process.env.NODE_ENV !== "production" && currentValue(props, key) === undefined) {
|
|
11
11
|
devWarn("SW202", `<${component}> ${key} is undefined: the control is controlled with no value and ignores input. Omit ${key}, or pass null or "" for an empty controlled value.`);
|
|
12
12
|
}
|
|
13
13
|
return true;
|
package/dist/controls.js
CHANGED
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
ToggleGroupKey2,
|
|
22
22
|
ToggleGroupRoot2,
|
|
23
23
|
ToggleGroupItem2
|
|
24
|
-
} from "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-0dsacv44.js";
|
|
25
25
|
import"./chunks/chunk-f6hw8ash.js";
|
|
26
26
|
import {
|
|
27
27
|
Slot2
|
|
28
28
|
} from "./chunks/chunk-bw9vp0y9.js";
|
|
29
29
|
import"./chunks/chunk-7r6fwdyt.js";
|
|
30
|
-
import"./chunks/chunk-
|
|
30
|
+
import"./chunks/chunk-saen52f0.js";
|
|
31
31
|
import"./chunks/chunk-6r59k5mb.js";
|
|
32
32
|
export {
|
|
33
33
|
AccordionContent2 as AccordionContent,
|
package/dist/core.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useControllableState2,
|
|
14
14
|
getFocusableElements2,
|
|
15
15
|
trapFocus2
|
|
16
|
-
} from "./chunks/chunk-
|
|
16
|
+
} from "./chunks/chunk-saen52f0.js";
|
|
17
17
|
import {
|
|
18
18
|
toFloatingPlacement2,
|
|
19
19
|
basePlacement2,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
ToggleGroupKey2,
|
|
54
54
|
ToggleGroupRoot2,
|
|
55
55
|
ToggleGroupItem2
|
|
56
|
-
} from "./chunks/chunk-
|
|
56
|
+
} from "./chunks/chunk-0dsacv44.js";
|
|
57
57
|
import {
|
|
58
58
|
isDismissExemptPointerTarget2
|
|
59
59
|
} from "./chunks/chunk-9whagkb6.js";
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
createMenuSubTriggerHandlers2,
|
|
63
63
|
isInsideMenuSubContent2,
|
|
64
64
|
MenuSubContentLayer2
|
|
65
|
-
} from "./chunks/chunk-
|
|
65
|
+
} from "./chunks/chunk-zmvg5gy1.js";
|
|
66
66
|
import {
|
|
67
67
|
DialogKey2,
|
|
68
68
|
DialogLabelsKey2,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
TooltipRoot2,
|
|
87
87
|
TooltipTrigger2,
|
|
88
88
|
TooltipContent2
|
|
89
|
-
} from "./chunks/chunk-
|
|
89
|
+
} from "./chunks/chunk-6bm550r5.js";
|
|
90
90
|
import {
|
|
91
91
|
ThemeKey2,
|
|
92
92
|
ThemeProvider2,
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
* Whether a control is controlled through `key`: the prop is present, even
|
|
3
3
|
* when its value is `undefined`. In development, a present prop that is
|
|
4
4
|
* `undefined` warns (SW202): the control would ignore input.
|
|
5
|
+
*
|
|
6
|
+
* sinwan-ui-core ships one bundle, so the check is guarded by
|
|
7
|
+
* `process.env.NODE_ENV`, which `build.ts` leaves as is in `dist/`. The app's
|
|
8
|
+
* bundler replaces it (Bun by default, Vite for dependencies): a production
|
|
9
|
+
* build drops the check and its message; a development build keeps them.
|
|
5
10
|
*/
|
|
6
11
|
export declare function isControlledProp(props: object, key: string, component: string): boolean;
|
package/dist/menu-sub.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createMenuSubTriggerHandlers2,
|
|
4
4
|
isInsideMenuSubContent2,
|
|
5
5
|
MenuSubContentLayer2
|
|
6
|
-
} from "./chunks/chunk-
|
|
7
|
-
import"./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-zmvg5gy1.js";
|
|
7
|
+
import"./chunks/chunk-saen52f0.js";
|
|
8
8
|
import"./chunks/chunk-6r59k5mb.js";
|
|
9
9
|
export {
|
|
10
10
|
MenuSubContentLayer2 as MenuSubContentLayer,
|
package/dist/overlay.js
CHANGED
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
TooltipRoot2,
|
|
22
22
|
TooltipTrigger2,
|
|
23
23
|
TooltipContent2
|
|
24
|
-
} from "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-6bm550r5.js";
|
|
25
25
|
import"./chunks/chunk-bw9vp0y9.js";
|
|
26
26
|
import"./chunks/chunk-7r6fwdyt.js";
|
|
27
27
|
import"./chunks/chunk-9whagkb6.js";
|
|
28
|
-
import"./chunks/chunk-
|
|
28
|
+
import"./chunks/chunk-saen52f0.js";
|
|
29
29
|
import"./chunks/chunk-6r59k5mb.js";
|
|
30
30
|
export {
|
|
31
31
|
CollapsibleContent2 as CollapsibleContent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sinwan-ui-core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Headless behaviour primitives for Sinwan UI components: overlays, floating positioning, dismiss layers, controls, slots, theme and direction.",
|
|
5
5
|
"author": "Mohammed Ben Cheikh",
|
|
6
6
|
"license": "MIT",
|