@warmio/ui 1.3.0 → 1.4.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/README.md +4 -4
- package/dist/chunks/{chunk-CIYWFBEJ.js → chunk-4RQCHKAW.js} +8 -4
- package/dist/chunks/{chunk-LHHUTDZR.js → chunk-FW2EHGRK.js} +40 -41
- package/dist/chunks/chunk-HDCV4ACN.js +469 -0
- package/dist/chunks/{chunk-IOUIACNV.js → chunk-KN6WVLCR.js} +1 -73
- package/dist/chunks/{chunk-DHZWXYDX.js → chunk-MIMC4M6W.js} +1 -1
- package/dist/chunks/{chunk-BG6USQSY.js → chunk-PBWF6BDE.js} +8 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/index.js +6 -6
- package/dist/logo.js +1 -1
- package/dist/product-header.js +1 -1
- package/dist/product-header.types.d.ts +9 -8
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/text.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +113 -8
- package/types/text.d.ts +1 -0
- package/dist/chunks/chunk-P3AJ2REZ.js +0 -1083
|
@@ -6,76 +6,6 @@ import {
|
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
8
8
|
import { CheckIcon } from "lucide-react";
|
|
9
|
-
|
|
10
|
-
// ../ui/src/lib/interaction-feedback.ts
|
|
11
|
-
import { play, setEnabled } from "cuelume";
|
|
12
|
-
|
|
13
|
-
// ../ui/src/lib/haptic.ts
|
|
14
|
-
var supportsHaptic = globalThis.window?.matchMedia?.("(pointer: coarse)").matches ?? false;
|
|
15
|
-
function getWarmCapacitor(win) {
|
|
16
|
-
return win?.Capacitor;
|
|
17
|
-
}
|
|
18
|
-
function isIosCapacitorApp(win = globalThis.window) {
|
|
19
|
-
const capacitor = getWarmCapacitor(win);
|
|
20
|
-
return capacitor?.getPlatform?.() === "ios" && capacitor?.isNativePlatform?.() === true;
|
|
21
|
-
}
|
|
22
|
-
function hasVibrate(nav) {
|
|
23
|
-
return "vibrate" in nav && typeof nav.vibrate === "function";
|
|
24
|
-
}
|
|
25
|
-
function triggerIosCapacitorHaptic() {
|
|
26
|
-
const haptics = getWarmCapacitor(globalThis.window)?.Plugins?.Haptics;
|
|
27
|
-
void haptics?.impact?.({ style: "LIGHT" }).catch(() => {
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function haptic(pattern = 50) {
|
|
31
|
-
try {
|
|
32
|
-
if (isIosCapacitorApp()) {
|
|
33
|
-
triggerIosCapacitorHaptic();
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (!supportsHaptic) return;
|
|
37
|
-
if (hasVibrate(navigator)) {
|
|
38
|
-
navigator.vibrate(pattern);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const label = document.createElement("label");
|
|
42
|
-
label.ariaHidden = "true";
|
|
43
|
-
label.style.display = "none";
|
|
44
|
-
const input = document.createElement("input");
|
|
45
|
-
input.type = "checkbox";
|
|
46
|
-
input.setAttribute("switch", "");
|
|
47
|
-
label.appendChild(input);
|
|
48
|
-
try {
|
|
49
|
-
document.head.appendChild(label);
|
|
50
|
-
label.click();
|
|
51
|
-
} finally {
|
|
52
|
-
document.head.removeChild(label);
|
|
53
|
-
}
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// ../ui/src/lib/interaction-feedback.ts
|
|
59
|
-
var soundByIntent = {
|
|
60
|
-
press: "press",
|
|
61
|
-
selection: "tick",
|
|
62
|
-
toggle: "toggle"
|
|
63
|
-
};
|
|
64
|
-
var soundsEnabled = false;
|
|
65
|
-
setEnabled(false);
|
|
66
|
-
function triggerInteractionFeedback(intent, options = {}) {
|
|
67
|
-
if (options.haptic) {
|
|
68
|
-
haptic();
|
|
69
|
-
}
|
|
70
|
-
if (!soundsEnabled) return;
|
|
71
|
-
if (globalThis.document?.hidden) return;
|
|
72
|
-
try {
|
|
73
|
-
play(soundByIntent[intent]);
|
|
74
|
-
} catch {
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// ../ui/src/warmio/dropdown-menu.tsx
|
|
79
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
80
10
|
function DropdownMenu(props) {
|
|
81
11
|
return /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...props });
|
|
@@ -132,7 +62,7 @@ function DropdownMenuContent({
|
|
|
132
62
|
dropdownMenuContentSizeClasses[size],
|
|
133
63
|
dropdownMenuContentSpacingClasses[spacing],
|
|
134
64
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
135
|
-
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-
|
|
65
|
+
"data-open:animate-in data-open:fade-in-0 data-open:zoom-in-90 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none"
|
|
136
66
|
),
|
|
137
67
|
...props,
|
|
138
68
|
children
|
|
@@ -203,7 +133,6 @@ function DropdownMenuCheckboxItem({
|
|
|
203
133
|
...props
|
|
204
134
|
}) {
|
|
205
135
|
const handleCheckedChange = (nextChecked, eventDetails) => {
|
|
206
|
-
triggerInteractionFeedback("toggle");
|
|
207
136
|
onCheckedChange?.(nextChecked, eventDetails);
|
|
208
137
|
};
|
|
209
138
|
return /* @__PURE__ */ jsxs(
|
|
@@ -237,7 +166,6 @@ function DropdownMenuRadioGroup({
|
|
|
237
166
|
...props
|
|
238
167
|
}) {
|
|
239
168
|
const handleValueChange = (value, eventDetails) => {
|
|
240
|
-
triggerInteractionFeedback("selection");
|
|
241
169
|
onValueChange?.(value, eventDetails);
|
|
242
170
|
};
|
|
243
171
|
return /* @__PURE__ */ jsx(
|
|
@@ -37,7 +37,7 @@ function SheetContent2({
|
|
|
37
37
|
{
|
|
38
38
|
...props,
|
|
39
39
|
className: contentClassName,
|
|
40
|
-
|
|
40
|
+
...presentation === "navigation" ? { overlayClassName: "duration-200 ease-in-out" } : {}
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
|
@@ -34,6 +34,7 @@ var ProductHeader = memo(function ProductHeader2({
|
|
|
34
34
|
actions,
|
|
35
35
|
actionsTargetRef,
|
|
36
36
|
desktopShell = false,
|
|
37
|
+
hideBreadcrumb = false,
|
|
37
38
|
leading,
|
|
38
39
|
pageTitle,
|
|
39
40
|
productName,
|
|
@@ -57,7 +58,13 @@ var ProductHeader = memo(function ProductHeader2({
|
|
|
57
58
|
className: "flex min-w-0 items-center gap-2 px-4 [&_h1]:text-sm [&_h1]:text-foreground [&:has(>[data-page-chrome-content])>[data-page-chrome-fallback]]:hidden",
|
|
58
59
|
children: [
|
|
59
60
|
leading,
|
|
60
|
-
/* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, className: "contents", children: /* @__PURE__ */ jsx(
|
|
61
|
+
hideBreadcrumb ? null : /* @__PURE__ */ jsx("div", { "data-page-chrome-fallback": true, className: "contents", children: /* @__PURE__ */ jsx(
|
|
62
|
+
ProductHeaderBreadcrumb,
|
|
63
|
+
{
|
|
64
|
+
...pageTitle !== void 0 ? { pageTitle } : {},
|
|
65
|
+
...productName !== void 0 ? { productName } : {}
|
|
66
|
+
}
|
|
67
|
+
) })
|
|
61
68
|
]
|
|
62
69
|
}
|
|
63
70
|
),
|
package/dist/dropdown-menu.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StackedDisplay,
|
|
3
3
|
Text
|
|
4
|
-
} from "./chunks/chunk-
|
|
4
|
+
} from "./chunks/chunk-4RQCHKAW.js";
|
|
5
5
|
import {
|
|
6
6
|
Badge
|
|
7
7
|
} from "./chunks/chunk-ICC7GQXS.js";
|
|
@@ -21,18 +21,18 @@ import {
|
|
|
21
21
|
DropdownMenuRadioItem,
|
|
22
22
|
DropdownMenuSeparator,
|
|
23
23
|
DropdownMenuTrigger
|
|
24
|
-
} from "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-KN6WVLCR.js";
|
|
25
25
|
import {
|
|
26
26
|
Logo,
|
|
27
27
|
WarmBrandedLogoLink,
|
|
28
28
|
WarmBrandedLogoMark,
|
|
29
29
|
WarmBrandedLogoMarkStatic,
|
|
30
30
|
WarmLogoIcon
|
|
31
|
-
} from "./chunks/chunk-
|
|
31
|
+
} from "./chunks/chunk-HDCV4ACN.js";
|
|
32
32
|
import {
|
|
33
33
|
ProductHeader,
|
|
34
34
|
ProductHeaderBreadcrumb
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-PBWF6BDE.js";
|
|
36
36
|
import {
|
|
37
37
|
SheetClose,
|
|
38
38
|
SheetContent,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
SheetHeader,
|
|
42
42
|
SheetTitle,
|
|
43
43
|
SheetTrigger
|
|
44
|
-
} from "./chunks/chunk-
|
|
44
|
+
} from "./chunks/chunk-MIMC4M6W.js";
|
|
45
45
|
import {
|
|
46
46
|
Sidebar,
|
|
47
47
|
SidebarAccountTrigger,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
SidebarProvider,
|
|
61
61
|
SidebarTrigger,
|
|
62
62
|
useSidebar
|
|
63
|
-
} from "./chunks/chunk-
|
|
63
|
+
} from "./chunks/chunk-FW2EHGRK.js";
|
|
64
64
|
import {
|
|
65
65
|
Sheet
|
|
66
66
|
} from "./chunks/chunk-YTDMREDR.js";
|
package/dist/logo.js
CHANGED
package/dist/product-header.js
CHANGED
|
@@ -3,15 +3,16 @@ import type { ReactNode, Ref } from 'react';
|
|
|
3
3
|
export type ProductHeaderVisibility = 'always' | 'container' | 'desktop';
|
|
4
4
|
|
|
5
5
|
export interface ProductHeaderBreadcrumbProps {
|
|
6
|
-
pageTitle?: string;
|
|
7
|
-
productName?: string;
|
|
6
|
+
pageTitle?: string | undefined;
|
|
7
|
+
productName?: string | undefined;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface ProductHeaderProps extends ProductHeaderBreadcrumbProps {
|
|
11
|
-
actions?: ReactNode;
|
|
12
|
-
actionsTargetRef?: Ref<HTMLDivElement
|
|
13
|
-
desktopShell?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
actions?: ReactNode | undefined;
|
|
12
|
+
actionsTargetRef?: Ref<HTMLDivElement> | undefined;
|
|
13
|
+
desktopShell?: boolean | undefined;
|
|
14
|
+
hideBreadcrumb?: boolean | undefined;
|
|
15
|
+
leading?: ReactNode | undefined;
|
|
16
|
+
titleTargetRef?: Ref<HTMLDivElement> | undefined;
|
|
17
|
+
visibility?: ProductHeaderVisibility | undefined;
|
|
17
18
|
}
|
package/dist/sheet.js
CHANGED
package/dist/sidebar.js
CHANGED
package/dist/text.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmio/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Portable, sealed React components for Warm products.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@base-ui/react": ">=1.6.0 <2.0.0",
|
|
71
|
-
"@warmio/design": "1.
|
|
71
|
+
"@warmio/design": "1.6.0",
|
|
72
72
|
"class-variance-authority": "^0.7.1",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"cuelume": "0.1.0",
|
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,113 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { Badge, type BadgeProps, type FeedbackSize, type FeedbackTone } from './badge.js';
|
|
2
|
+
export {
|
|
3
|
+
Button,
|
|
4
|
+
ButtonLink,
|
|
5
|
+
type ButtonLinkProps,
|
|
6
|
+
type ButtonPresentation,
|
|
7
|
+
type ButtonProps,
|
|
8
|
+
type ButtonSize,
|
|
9
|
+
type ButtonVariant,
|
|
10
|
+
} from './button.js';
|
|
11
|
+
export {
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
DropdownMenuCheckboxItem,
|
|
14
|
+
DropdownMenuContent,
|
|
15
|
+
DropdownMenuGroup,
|
|
16
|
+
DropdownMenuItem,
|
|
17
|
+
DropdownMenuLabel,
|
|
18
|
+
DropdownMenuLinkItem,
|
|
19
|
+
DropdownMenuRadioGroup,
|
|
20
|
+
DropdownMenuRadioItem,
|
|
21
|
+
DropdownMenuSeparator,
|
|
22
|
+
DropdownMenuTrigger,
|
|
23
|
+
type DropdownMenuAlign,
|
|
24
|
+
type DropdownMenuCheckboxItemProps,
|
|
25
|
+
type DropdownMenuContentProps,
|
|
26
|
+
type DropdownMenuContentSize,
|
|
27
|
+
type DropdownMenuContentSpacing,
|
|
28
|
+
type DropdownMenuGroupProps,
|
|
29
|
+
type DropdownMenuItemProps,
|
|
30
|
+
type DropdownMenuItemVariant,
|
|
31
|
+
type DropdownMenuLabelProps,
|
|
32
|
+
type DropdownMenuLinkItemProps,
|
|
33
|
+
type DropdownMenuRadioGroupProps,
|
|
34
|
+
type DropdownMenuRadioItemProps,
|
|
35
|
+
type DropdownMenuSeparatorProps,
|
|
36
|
+
type DropdownMenuSide,
|
|
37
|
+
type DropdownMenuTriggerProps,
|
|
38
|
+
} from './dropdown-menu.js';
|
|
39
|
+
export {
|
|
40
|
+
Logo,
|
|
41
|
+
WarmLogoIcon,
|
|
42
|
+
type LogoProps,
|
|
43
|
+
type WarmLogoIconProps,
|
|
44
|
+
type WarmLogoSize,
|
|
45
|
+
type WarmLogoTone,
|
|
46
|
+
} from './logo.js';
|
|
47
|
+
export {
|
|
48
|
+
ProductHeader,
|
|
49
|
+
ProductHeaderBreadcrumb,
|
|
50
|
+
type ProductHeaderBreadcrumbProps,
|
|
51
|
+
type ProductHeaderProps,
|
|
52
|
+
type ProductHeaderVisibility,
|
|
53
|
+
} from './product-header.js';
|
|
54
|
+
export {
|
|
55
|
+
Sheet,
|
|
56
|
+
SheetClose,
|
|
57
|
+
SheetContent,
|
|
58
|
+
SheetDescription,
|
|
59
|
+
SheetFooter,
|
|
60
|
+
SheetHeader,
|
|
61
|
+
SheetTitle,
|
|
62
|
+
SheetTrigger,
|
|
63
|
+
type SheetCloseProps,
|
|
64
|
+
type SheetContentProps,
|
|
65
|
+
type SheetFooterProps,
|
|
66
|
+
type SheetHeaderProps,
|
|
67
|
+
type SheetTitleProps,
|
|
68
|
+
type SheetTriggerProps,
|
|
69
|
+
} from './sheet.js';
|
|
70
|
+
export {
|
|
71
|
+
Sidebar,
|
|
72
|
+
SidebarAccountTrigger,
|
|
73
|
+
SidebarBrand,
|
|
74
|
+
SidebarContent,
|
|
75
|
+
SidebarFooter,
|
|
76
|
+
SidebarGroup,
|
|
77
|
+
SidebarGroupContent,
|
|
78
|
+
SidebarGroupLabel,
|
|
79
|
+
SidebarHeader,
|
|
80
|
+
SidebarInset,
|
|
81
|
+
SidebarMenu,
|
|
82
|
+
SidebarMenuBadge,
|
|
83
|
+
SidebarMenuButton,
|
|
84
|
+
SidebarMenuItem,
|
|
85
|
+
SidebarProvider,
|
|
86
|
+
useSidebar,
|
|
87
|
+
SidebarTrigger,
|
|
88
|
+
type SidebarAccountTriggerProps,
|
|
89
|
+
type SidebarBrandProps,
|
|
90
|
+
type SidebarContentProps,
|
|
91
|
+
type SidebarContextValue,
|
|
92
|
+
type SidebarFooterProps,
|
|
93
|
+
type SidebarGroupContentProps,
|
|
94
|
+
type SidebarGroupLabelProps,
|
|
95
|
+
type SidebarGroupProps,
|
|
96
|
+
type SidebarHeaderProps,
|
|
97
|
+
type SidebarInsetProps,
|
|
98
|
+
type SidebarMenuBadgeProps,
|
|
99
|
+
type SidebarMenuButtonProps,
|
|
100
|
+
type SidebarMenuItemProps,
|
|
101
|
+
type SidebarMenuProps,
|
|
102
|
+
type SidebarProps,
|
|
103
|
+
type SidebarProviderProps,
|
|
104
|
+
} from './sidebar.js';
|
|
105
|
+
export {
|
|
106
|
+
StackedDisplay,
|
|
107
|
+
Text,
|
|
108
|
+
type StackedDisplayProps,
|
|
109
|
+
type TextAlign,
|
|
110
|
+
type TextProps,
|
|
111
|
+
type TextTone,
|
|
112
|
+
type TextVariant,
|
|
113
|
+
} from './text.js';
|