strata-ui-react 0.1.10 → 0.1.12
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/avatar-fallback.cjs +42 -0
- package/dist/avatar-fallback.js +42 -0
- package/dist/avatar-image.cjs +42 -0
- package/dist/avatar-image.js +42 -0
- package/dist/avatar.cjs +47 -0
- package/dist/avatar.js +47 -0
- package/dist/badge.cjs +63 -0
- package/dist/badge.js +63 -0
- package/dist/badge.types.cjs +100 -0
- package/dist/badge.types.js +100 -0
- package/dist/button.cjs +58 -0
- package/dist/button.js +58 -0
- package/dist/button.types.cjs +519 -0
- package/dist/button.types.js +519 -0
- package/dist/checkbox-indicator.cjs +36 -0
- package/dist/checkbox-indicator.js +36 -0
- package/dist/checkbox.cjs +84 -0
- package/dist/checkbox.js +84 -0
- package/dist/cn.cjs +6 -0
- package/dist/cn.js +6 -0
- package/dist/dialog-close.cjs +57 -0
- package/dist/dialog-close.js +57 -0
- package/dist/dialog-description.cjs +46 -0
- package/dist/dialog-description.js +46 -0
- package/dist/dialog-popup.cjs +72 -0
- package/dist/dialog-popup.js +72 -0
- package/dist/dialog-title.cjs +46 -0
- package/dist/dialog-title.js +46 -0
- package/dist/dialog-trigger.cjs +46 -0
- package/dist/dialog-trigger.js +46 -0
- package/dist/dialog.cjs +20 -0
- package/dist/dialog.js +20 -0
- package/dist/field-errors.cjs +63 -0
- package/dist/field-errors.js +63 -0
- package/dist/field-input.cjs +80 -0
- package/dist/field-input.js +80 -0
- package/dist/form-errors.cjs +73 -0
- package/dist/form-errors.js +73 -0
- package/dist/form-submit.cjs +65 -0
- package/dist/form-submit.js +65 -0
- package/dist/form.cjs +19 -0
- package/dist/form.js +19 -0
- package/dist/form.types.cjs +6 -0
- package/dist/form.types.js +3 -0
- package/dist/index.cjs +82 -0
- package/dist/index.d.cts +312 -0
- package/dist/index.d.ts +312 -1
- package/dist/index.js +42 -0
- package/dist/input.cjs +83 -0
- package/dist/input.js +83 -0
- package/dist/label.cjs +46 -0
- package/dist/label.js +46 -0
- package/dist/profile.cjs +127 -0
- package/dist/profile.js +127 -0
- package/dist/scroll-area.cjs +97 -0
- package/dist/scroll-area.js +97 -0
- package/dist/separator.cjs +45 -0
- package/dist/separator.js +45 -0
- package/dist/slider-handle.cjs +34 -0
- package/dist/slider-handle.js +34 -0
- package/dist/slider-segment.cjs +17 -0
- package/dist/slider-segment.js +17 -0
- package/dist/slider-tick-label.cjs +12 -0
- package/dist/slider-tick-label.js +12 -0
- package/dist/slider-tick.cjs +13 -0
- package/dist/slider-tick.js +13 -0
- package/dist/slider-track.cjs +12 -0
- package/dist/slider-track.js +12 -0
- package/dist/slider.cjs +69 -0
- package/dist/slider.js +69 -0
- package/dist/switch.cjs +71 -0
- package/dist/switch.js +71 -0
- package/dist/tabs-indicator.cjs +57 -0
- package/dist/tabs-indicator.js +57 -0
- package/dist/tabs-list.cjs +57 -0
- package/dist/tabs-list.js +57 -0
- package/dist/tabs-panel.cjs +40 -0
- package/dist/tabs-panel.js +40 -0
- package/dist/tabs-tab.cjs +36 -0
- package/dist/tabs-tab.js +36 -0
- package/dist/tabs.cjs +73 -0
- package/dist/tabs.js +73 -0
- package/dist/tabs.types.cjs +4 -0
- package/dist/tabs.types.js +4 -0
- package/dist/toast-provider.cjs +86 -0
- package/dist/toast-provider.js +86 -0
- package/dist/toast.cjs +40 -0
- package/dist/toast.js +40 -0
- package/dist/tooltip-context.cjs +56 -0
- package/dist/tooltip-context.js +56 -0
- package/dist/tooltip-trigger.cjs +29 -0
- package/dist/tooltip-trigger.js +29 -0
- package/dist/tooltip.cjs +29 -0
- package/dist/tooltip.js +29 -0
- package/package.json +18 -10
- package/dist/strata-ui-react.js +0 -13543
- package/dist/strata-ui-react.umd.cjs +0 -24
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { cn } from "./cn.js";
|
|
2
|
+
import { Toast as Toast$1 } from "./toast.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Toast } from "@base-ui/react/toast";
|
|
6
|
+
const ToastProvider = (t0) => {
|
|
7
|
+
const $ = c(24);
|
|
8
|
+
let children;
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
let ref;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({position: t1, className, children, ref, ...props} = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = children;
|
|
17
|
+
$[2] = className;
|
|
18
|
+
$[3] = props;
|
|
19
|
+
$[4] = ref;
|
|
20
|
+
$[5] = t1;
|
|
21
|
+
} else {
|
|
22
|
+
children = $[1];
|
|
23
|
+
className = $[2];
|
|
24
|
+
props = $[3];
|
|
25
|
+
ref = $[4];
|
|
26
|
+
t1 = $[5];
|
|
27
|
+
}
|
|
28
|
+
const position = t1 === void 0 ? "bottom-center" : t1;
|
|
29
|
+
const t2 = position === "top-left";
|
|
30
|
+
const t3 = position === "top-center";
|
|
31
|
+
const t4 = position === "top-right";
|
|
32
|
+
const t5 = position === "bottom-left";
|
|
33
|
+
const t6 = position === "bottom-center";
|
|
34
|
+
const t7 = position === "bottom-right";
|
|
35
|
+
let t8;
|
|
36
|
+
if ($[6] !== className || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5 || $[11] !== t6 || $[12] !== t7) {
|
|
37
|
+
t8 = cn({
|
|
38
|
+
"fixed z-10 top-[1rem] left-[1rem] right-auto bottom-auto mx-0 flex w-1/4": t2,
|
|
39
|
+
"fixed z-10 top-[1rem] left-1/2 right-auto bottom-auto mx-auto flex w-1/4 -translate-x-1/2": t3,
|
|
40
|
+
"fixed z-10 top-[1rem] right-[1rem] left-auto bottom-auto mx-0 flex w-1/4": t4,
|
|
41
|
+
"fixed z-10 bottom-[6rem] left-[1rem] right-auto top-auto mx-0 flex w-1/4": t5,
|
|
42
|
+
"fixed z-10 bottom-[6rem] left-1/2 right-auto top-auto mx-auto flex w-1/4 -translate-x-1/2": t6,
|
|
43
|
+
"fixed z-10 bottom-[6rem] right-[1rem] left-auto top-auto mx-0 flex w-1/4": t7
|
|
44
|
+
}, className);
|
|
45
|
+
$[6] = className;
|
|
46
|
+
$[7] = t2;
|
|
47
|
+
$[8] = t3;
|
|
48
|
+
$[9] = t4;
|
|
49
|
+
$[10] = t5;
|
|
50
|
+
$[11] = t6;
|
|
51
|
+
$[12] = t7;
|
|
52
|
+
$[13] = t8;
|
|
53
|
+
} else t8 = $[13];
|
|
54
|
+
let t9;
|
|
55
|
+
if ($[14] !== position) {
|
|
56
|
+
t9 = /* @__PURE__ */ jsx(Toast$1, { position });
|
|
57
|
+
$[14] = position;
|
|
58
|
+
$[15] = t9;
|
|
59
|
+
} else t9 = $[15];
|
|
60
|
+
let t10;
|
|
61
|
+
if ($[16] !== props || $[17] !== ref || $[18] !== t8 || $[19] !== t9) {
|
|
62
|
+
t10 = /* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
63
|
+
className: t8,
|
|
64
|
+
ref,
|
|
65
|
+
...props,
|
|
66
|
+
children: t9
|
|
67
|
+
}) });
|
|
68
|
+
$[16] = props;
|
|
69
|
+
$[17] = ref;
|
|
70
|
+
$[18] = t8;
|
|
71
|
+
$[19] = t9;
|
|
72
|
+
$[20] = t10;
|
|
73
|
+
} else t10 = $[20];
|
|
74
|
+
let t11;
|
|
75
|
+
if ($[21] !== children || $[22] !== t10) {
|
|
76
|
+
t11 = /* @__PURE__ */ jsxs(Toast.Provider, {
|
|
77
|
+
timeout: 5e3,
|
|
78
|
+
children: [children, t10]
|
|
79
|
+
});
|
|
80
|
+
$[21] = children;
|
|
81
|
+
$[22] = t10;
|
|
82
|
+
$[23] = t11;
|
|
83
|
+
} else t11 = $[23];
|
|
84
|
+
return t11;
|
|
85
|
+
};
|
|
86
|
+
export { ToastProvider };
|
package/dist/toast.cjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const require_cn = require("./cn.cjs");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let __phosphor_icons_react = require("@phosphor-icons/react");
|
|
4
|
+
let __base_ui_react_toast = require("@base-ui/react/toast");
|
|
5
|
+
const Toast = ({ className, children, position = "top-right", ref, ...props }) => {
|
|
6
|
+
const { toasts } = __base_ui_react_toast.Toast.useToastManager();
|
|
7
|
+
const getSwipeDirection = (pos) => {
|
|
8
|
+
switch (pos) {
|
|
9
|
+
case "top-left": return "left";
|
|
10
|
+
case "bottom-left": return "left";
|
|
11
|
+
case "top-right": return "right";
|
|
12
|
+
case "bottom-right": return "right";
|
|
13
|
+
case "top-center": return "up";
|
|
14
|
+
case "bottom-center": return "down";
|
|
15
|
+
default: return "right";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return toasts.map((toast) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__base_ui_react_toast.Toast.Root, {
|
|
19
|
+
toast,
|
|
20
|
+
swipeDirection: getSwipeDirection(position),
|
|
21
|
+
className: require_cn.cn(position === "bottom-right" || position === "bottom-center" || position === "bottom-left" ? "absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*-15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-outline bg-surface-container bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[\"\"] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] flex flex-col gap-3xs" : "absolute top-0 right-0 left-0 z-[calc(1000-var(--toast-index))] mx-auto w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-gray-200 bg-gray-50 bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[''] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(-150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(-150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", className, toast.data.variant === "success" && "border-success bg-success-container", toast.data.variant === "error" && "border-error bg-error-container", toast.data.variant === "warning" && "border-warning bg-warning-container"),
|
|
22
|
+
style: {
|
|
23
|
+
["--gap"]: "1rem",
|
|
24
|
+
["--offset-y"]: "calc(var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y))"
|
|
25
|
+
},
|
|
26
|
+
ref,
|
|
27
|
+
...props,
|
|
28
|
+
children: [
|
|
29
|
+
children,
|
|
30
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_toast.Toast.Title, { className: require_cn.cn("text-sm font-semibold text-on-surface", toast.data.variant === "success" && "text-on-success-container", toast.data.variant === "error" && "text-on-error-container", toast.data.variant === "warning" && "text-on-warning-container") }),
|
|
31
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_toast.Toast.Description, { className: require_cn.cn("text-sm text-on-surface", toast.data.variant === "success" && "text-on-success-container", toast.data.variant === "error" && "text-on-error-container", toast.data.variant === "warning" && "text-on-warning-container") }),
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_toast.Toast.Close, {
|
|
33
|
+
className: "absolute top-xs right-2xs flex size-xs items-center justify-center rounded border-none bg-transparent text-on-surface hover:cursor-pointer",
|
|
34
|
+
"aria-label": "Close",
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__phosphor_icons_react.XIcon, { weight: "bold" })
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
}, toast.id));
|
|
39
|
+
};
|
|
40
|
+
exports.Toast = Toast;
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cn } from "./cn.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { XIcon } from "@phosphor-icons/react";
|
|
4
|
+
import { Toast } from "@base-ui/react/toast";
|
|
5
|
+
const Toast$1 = ({ className, children, position = "top-right", ref, ...props }) => {
|
|
6
|
+
const { toasts } = Toast.useToastManager();
|
|
7
|
+
const getSwipeDirection = (pos) => {
|
|
8
|
+
switch (pos) {
|
|
9
|
+
case "top-left": return "left";
|
|
10
|
+
case "bottom-left": return "left";
|
|
11
|
+
case "top-right": return "right";
|
|
12
|
+
case "bottom-right": return "right";
|
|
13
|
+
case "top-center": return "up";
|
|
14
|
+
case "bottom-center": return "down";
|
|
15
|
+
default: return "right";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return toasts.map((toast) => /* @__PURE__ */ jsxs(Toast.Root, {
|
|
19
|
+
toast,
|
|
20
|
+
swipeDirection: getSwipeDirection(position),
|
|
21
|
+
className: cn(position === "bottom-right" || position === "bottom-center" || position === "bottom-left" ? "absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*-15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-outline bg-surface-container bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[\"\"] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] flex flex-col gap-3xs" : "absolute top-0 right-0 left-0 z-[calc(1000-var(--toast-index))] mx-auto w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-gray-200 bg-gray-50 bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[''] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(-150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(-150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", className, toast.data.variant === "success" && "border-success bg-success-container", toast.data.variant === "error" && "border-error bg-error-container", toast.data.variant === "warning" && "border-warning bg-warning-container"),
|
|
22
|
+
style: {
|
|
23
|
+
["--gap"]: "1rem",
|
|
24
|
+
["--offset-y"]: "calc(var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y))"
|
|
25
|
+
},
|
|
26
|
+
ref,
|
|
27
|
+
...props,
|
|
28
|
+
children: [
|
|
29
|
+
children,
|
|
30
|
+
/* @__PURE__ */ jsx(Toast.Title, { className: cn("text-sm font-semibold text-on-surface", toast.data.variant === "success" && "text-on-success-container", toast.data.variant === "error" && "text-on-error-container", toast.data.variant === "warning" && "text-on-warning-container") }),
|
|
31
|
+
/* @__PURE__ */ jsx(Toast.Description, { className: cn("text-sm text-on-surface", toast.data.variant === "success" && "text-on-success-container", toast.data.variant === "error" && "text-on-error-container", toast.data.variant === "warning" && "text-on-warning-container") }),
|
|
32
|
+
/* @__PURE__ */ jsx(Toast.Close, {
|
|
33
|
+
className: "absolute top-xs right-2xs flex size-xs items-center justify-center rounded border-none bg-transparent text-on-surface hover:cursor-pointer",
|
|
34
|
+
"aria-label": "Close",
|
|
35
|
+
children: /* @__PURE__ */ jsx(XIcon, { weight: "bold" })
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
}, toast.id));
|
|
39
|
+
};
|
|
40
|
+
export { Toast$1 as Toast };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const require_cn = require("./cn.cjs");
|
|
2
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let __phosphor_icons_react = require("@phosphor-icons/react");
|
|
5
|
+
let __base_ui_react_tooltip = require("@base-ui/react/tooltip");
|
|
6
|
+
const TooltipContent = (t0) => {
|
|
7
|
+
const $ = (0, react_compiler_runtime.c)(11);
|
|
8
|
+
let children;
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({className, children, ...props} = t0);
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
$[1] = children;
|
|
15
|
+
$[2] = className;
|
|
16
|
+
$[3] = props;
|
|
17
|
+
} else {
|
|
18
|
+
children = $[1];
|
|
19
|
+
className = $[2];
|
|
20
|
+
props = $[3];
|
|
21
|
+
}
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[4] !== className) {
|
|
24
|
+
t1 = require_cn.cn("bg-surface-container-high origin-(--transform-origin) px-xs py-3xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 z-50 w-fit rounded-md text-sm text-balance", className);
|
|
25
|
+
$[4] = className;
|
|
26
|
+
$[5] = t1;
|
|
27
|
+
} else t1 = $[5];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Arrow, {
|
|
31
|
+
className: "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",
|
|
32
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__phosphor_icons_react.CaretUpIcon, {
|
|
33
|
+
weight: "fill",
|
|
34
|
+
className: "fill-surface-container-high "
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
} else t2 = $[6];
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[7] !== children || $[8] !== props || $[9] !== t1) {
|
|
41
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Positioner, {
|
|
42
|
+
sideOffset: 10,
|
|
43
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__base_ui_react_tooltip.Tooltip.Popup, {
|
|
44
|
+
className: t1,
|
|
45
|
+
...props,
|
|
46
|
+
children: [t2, children]
|
|
47
|
+
})
|
|
48
|
+
}) });
|
|
49
|
+
$[7] = children;
|
|
50
|
+
$[8] = props;
|
|
51
|
+
$[9] = t1;
|
|
52
|
+
$[10] = t3;
|
|
53
|
+
} else t3 = $[10];
|
|
54
|
+
return t3;
|
|
55
|
+
};
|
|
56
|
+
exports.TooltipContent = TooltipContent;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "./cn.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CaretUpIcon } from "@phosphor-icons/react";
|
|
5
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
6
|
+
const TooltipContent = (t0) => {
|
|
7
|
+
const $ = c(11);
|
|
8
|
+
let children;
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({className, children, ...props} = t0);
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
$[1] = children;
|
|
15
|
+
$[2] = className;
|
|
16
|
+
$[3] = props;
|
|
17
|
+
} else {
|
|
18
|
+
children = $[1];
|
|
19
|
+
className = $[2];
|
|
20
|
+
props = $[3];
|
|
21
|
+
}
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[4] !== className) {
|
|
24
|
+
t1 = cn("bg-surface-container-high origin-(--transform-origin) px-xs py-3xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 z-50 w-fit rounded-md text-sm text-balance", className);
|
|
25
|
+
$[4] = className;
|
|
26
|
+
$[5] = t1;
|
|
27
|
+
} else t1 = $[5];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsx(Tooltip.Arrow, {
|
|
31
|
+
className: "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",
|
|
32
|
+
children: /* @__PURE__ */ jsx(CaretUpIcon, {
|
|
33
|
+
weight: "fill",
|
|
34
|
+
className: "fill-surface-container-high "
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
} else t2 = $[6];
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[7] !== children || $[8] !== props || $[9] !== t1) {
|
|
41
|
+
t3 = /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
42
|
+
sideOffset: 10,
|
|
43
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Popup, {
|
|
44
|
+
className: t1,
|
|
45
|
+
...props,
|
|
46
|
+
children: [t2, children]
|
|
47
|
+
})
|
|
48
|
+
}) });
|
|
49
|
+
$[7] = children;
|
|
50
|
+
$[8] = props;
|
|
51
|
+
$[9] = t1;
|
|
52
|
+
$[10] = t3;
|
|
53
|
+
} else t3 = $[10];
|
|
54
|
+
return t3;
|
|
55
|
+
};
|
|
56
|
+
export { TooltipContent };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let __base_ui_react_tooltip = require("@base-ui/react/tooltip");
|
|
4
|
+
const TooltipTrigger = (t0) => {
|
|
5
|
+
const $ = (0, react_compiler_runtime.c)(6);
|
|
6
|
+
let children;
|
|
7
|
+
let props;
|
|
8
|
+
if ($[0] !== t0) {
|
|
9
|
+
({children, ...props} = t0);
|
|
10
|
+
$[0] = t0;
|
|
11
|
+
$[1] = children;
|
|
12
|
+
$[2] = props;
|
|
13
|
+
} else {
|
|
14
|
+
children = $[1];
|
|
15
|
+
props = $[2];
|
|
16
|
+
}
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[3] !== children || $[4] !== props) {
|
|
19
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Trigger, {
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
$[3] = children;
|
|
24
|
+
$[4] = props;
|
|
25
|
+
$[5] = t1;
|
|
26
|
+
} else t1 = $[5];
|
|
27
|
+
return t1;
|
|
28
|
+
};
|
|
29
|
+
exports.TooltipTrigger = TooltipTrigger;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
4
|
+
const TooltipTrigger = (t0) => {
|
|
5
|
+
const $ = c(6);
|
|
6
|
+
let children;
|
|
7
|
+
let props;
|
|
8
|
+
if ($[0] !== t0) {
|
|
9
|
+
({children, ...props} = t0);
|
|
10
|
+
$[0] = t0;
|
|
11
|
+
$[1] = children;
|
|
12
|
+
$[2] = props;
|
|
13
|
+
} else {
|
|
14
|
+
children = $[1];
|
|
15
|
+
props = $[2];
|
|
16
|
+
}
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[3] !== children || $[4] !== props) {
|
|
19
|
+
t1 = /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
$[3] = children;
|
|
24
|
+
$[4] = props;
|
|
25
|
+
$[5] = t1;
|
|
26
|
+
} else t1 = $[5];
|
|
27
|
+
return t1;
|
|
28
|
+
};
|
|
29
|
+
export { TooltipTrigger };
|
package/dist/tooltip.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let __base_ui_react_tooltip = require("@base-ui/react/tooltip");
|
|
4
|
+
const Tooltip = (t0) => {
|
|
5
|
+
const $ = (0, react_compiler_runtime.c)(6);
|
|
6
|
+
let children;
|
|
7
|
+
let props;
|
|
8
|
+
if ($[0] !== t0) {
|
|
9
|
+
({children, ...props} = t0);
|
|
10
|
+
$[0] = t0;
|
|
11
|
+
$[1] = children;
|
|
12
|
+
$[2] = props;
|
|
13
|
+
} else {
|
|
14
|
+
children = $[1];
|
|
15
|
+
props = $[2];
|
|
16
|
+
}
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[3] !== children || $[4] !== props) {
|
|
19
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Provider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__base_ui_react_tooltip.Tooltip.Root, {
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
}) });
|
|
23
|
+
$[3] = children;
|
|
24
|
+
$[4] = props;
|
|
25
|
+
$[5] = t1;
|
|
26
|
+
} else t1 = $[5];
|
|
27
|
+
return t1;
|
|
28
|
+
};
|
|
29
|
+
exports.Tooltip = Tooltip;
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
4
|
+
const Tooltip$1 = (t0) => {
|
|
5
|
+
const $ = c(6);
|
|
6
|
+
let children;
|
|
7
|
+
let props;
|
|
8
|
+
if ($[0] !== t0) {
|
|
9
|
+
({children, ...props} = t0);
|
|
10
|
+
$[0] = t0;
|
|
11
|
+
$[1] = children;
|
|
12
|
+
$[2] = props;
|
|
13
|
+
} else {
|
|
14
|
+
children = $[1];
|
|
15
|
+
props = $[2];
|
|
16
|
+
}
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[3] !== children || $[4] !== props) {
|
|
19
|
+
t1 = /* @__PURE__ */ jsx(Tooltip.Provider, { children: /* @__PURE__ */ jsx(Tooltip.Root, {
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
}) });
|
|
23
|
+
$[3] = children;
|
|
24
|
+
$[4] = props;
|
|
25
|
+
$[5] = t1;
|
|
26
|
+
} else t1 = $[5];
|
|
27
|
+
return t1;
|
|
28
|
+
};
|
|
29
|
+
export { Tooltip$1 as Tooltip };
|
package/package.json
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-ui-react",
|
|
3
|
-
"
|
|
3
|
+
"description": "A set of accessible, customizable, and production-ready React components built with Tailwind CSS.",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "0.1.12",
|
|
4
6
|
"type": "module",
|
|
5
|
-
"main": "./dist/
|
|
6
|
-
"module": "./dist/
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
7
9
|
"types": "./dist/index.d.ts",
|
|
8
10
|
"exports": {
|
|
9
11
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
+
"require": {
|
|
13
|
+
"types": "./dist/index.d.cts",
|
|
14
|
+
"default": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
12
20
|
},
|
|
13
|
-
"./
|
|
21
|
+
"./styles": "./dist/style.css"
|
|
14
22
|
},
|
|
15
23
|
"files": [
|
|
16
24
|
"dist"
|
|
17
25
|
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
18
29
|
"sideEffects": false,
|
|
19
30
|
"dependencies": {
|
|
20
31
|
"@base-ui/react": "^1.0.0",
|
|
@@ -30,10 +41,6 @@
|
|
|
30
41
|
"tailwindcss": "^4.1.18",
|
|
31
42
|
"vite-plugin-dts": "^4.5.4"
|
|
32
43
|
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"react": "^19.2.0",
|
|
35
|
-
"react-dom": "^19.2.0"
|
|
36
|
-
},
|
|
37
44
|
"devDependencies": {
|
|
38
45
|
"@eslint/js": "^9.39.1",
|
|
39
46
|
"@tailwindcss/cli": "^4.1.18",
|
|
@@ -46,6 +53,7 @@
|
|
|
46
53
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
47
54
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
48
55
|
"globals": "^16.5.0",
|
|
56
|
+
"rollup-plugin-node-externals": "^8.1.2",
|
|
49
57
|
"typescript": "~5.9.3",
|
|
50
58
|
"typescript-eslint": "^8.46.4",
|
|
51
59
|
"vite": "npm:rolldown-vite@7.2.5"
|