@arcfusionz/arc-primitive-ui 0.3.5 → 0.3.7
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.
|
@@ -7,10 +7,10 @@ import { Button } from "@base-ui/react/button";
|
|
|
7
7
|
const baseClasses = "relative flex w-full items-start gap-3 rounded-md border border-transparent p-4 font-sans text-sm";
|
|
8
8
|
const appearanceClasses = {
|
|
9
9
|
solid: {
|
|
10
|
-
neutral: "bg-
|
|
10
|
+
neutral: "bg-slate-600 text-background",
|
|
11
11
|
info: "bg-primary text-primary-foreground",
|
|
12
|
-
success: "bg-success
|
|
13
|
-
warning: "bg-warning text-warning-
|
|
12
|
+
success: "bg-success text-success-foreground",
|
|
13
|
+
warning: "bg-warning text-warning-foreground",
|
|
14
14
|
destructive: "bg-destructive text-destructive-foreground"
|
|
15
15
|
},
|
|
16
16
|
soft: {
|
|
@@ -153,6 +153,8 @@ function alertVariants({ variant = "neutral", appearance = "soft", className } =
|
|
|
153
153
|
const Alert = forwardRef(({ variant = "neutral", appearance = "soft", title, icon, action, onClose, closeLabel, role = "alert", render, className, children, ...rest }, ref) => {
|
|
154
154
|
const resolvedIcon = icon === void 0 ? defaultVariantIcons[variant] : icon;
|
|
155
155
|
const solid = appearance === "solid";
|
|
156
|
+
const hasDescription = children != null && children !== false;
|
|
157
|
+
const hasTitleOnlyAction = title != null && action != null && !hasDescription;
|
|
156
158
|
return useRender({
|
|
157
159
|
defaultTagName: "div",
|
|
158
160
|
render,
|
|
@@ -162,7 +164,7 @@ const Alert = forwardRef(({ variant = "neutral", appearance = "soft", title, ico
|
|
|
162
164
|
className: cn(alertVariants({
|
|
163
165
|
variant,
|
|
164
166
|
appearance
|
|
165
|
-
}), className),
|
|
167
|
+
}), hasTitleOnlyAction && "items-center", className),
|
|
166
168
|
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
167
169
|
resolvedIcon != null && typeof resolvedIcon !== "boolean" && /* @__PURE__ */ jsx("span", {
|
|
168
170
|
"aria-hidden": "true",
|
|
@@ -174,7 +176,7 @@ const Alert = forwardRef(({ variant = "neutral", appearance = "soft", title, ico
|
|
|
174
176
|
children: [title != null && /* @__PURE__ */ jsx("div", {
|
|
175
177
|
className: cn(titleClasses, !solid && titleColorClasses[variant]),
|
|
176
178
|
children: title
|
|
177
|
-
}),
|
|
179
|
+
}), hasDescription && /* @__PURE__ */ jsx("div", { children })]
|
|
178
180
|
}),
|
|
179
181
|
action != null && /* @__PURE__ */ jsx("div", {
|
|
180
182
|
className: actionSlotClasses,
|
|
@@ -276,7 +276,7 @@ const ComboboxPopup = forwardRef(({ align = "center", sideOffset = 4, alignOffse
|
|
|
276
276
|
})
|
|
277
277
|
}));
|
|
278
278
|
ComboboxPopup.displayName = "ComboboxPopup";
|
|
279
|
-
const itemClasses = "relative flex cursor-
|
|
279
|
+
const itemClasses = "relative flex cursor-pointer items-center gap-2 rounded-md py-1.5 pr-8 pl-2 font-sans text-sm text-foreground outline-none select-none scroll-my-1 data-highlighted:bg-primary-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
280
280
|
/**
|
|
281
281
|
* One option in the popup. Children render as the option's label; a check
|
|
282
282
|
* mark appears at the item's right edge while selected. Filtering matches
|
|
@@ -114,7 +114,7 @@ const MenuPopup = forwardRef(({ side, align, sideOffset = side === void 0 ? adap
|
|
|
114
114
|
})
|
|
115
115
|
}));
|
|
116
116
|
MenuPopup.displayName = "MenuPopup";
|
|
117
|
-
const itemBaseClasses = "relative flex cursor-
|
|
117
|
+
const itemBaseClasses = "relative flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 font-sans text-sm outline-none select-none scroll-my-1 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
118
118
|
const itemVariantClasses = {
|
|
119
119
|
default: "text-foreground data-highlighted:bg-primary-50 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
120
120
|
destructive: "text-error-700 data-highlighted:bg-error-50"
|
|
@@ -183,7 +183,7 @@ const SelectPopup = forwardRef(({ align = "center", sideOffset = 4, alignOffset
|
|
|
183
183
|
})
|
|
184
184
|
}));
|
|
185
185
|
SelectPopup.displayName = "SelectPopup";
|
|
186
|
-
const itemClasses = "relative flex cursor-
|
|
186
|
+
const itemClasses = "relative flex cursor-pointer items-center gap-2 rounded-md py-1.5 pr-8 pl-2 font-sans text-sm text-foreground outline-none select-none scroll-my-1 data-highlighted:bg-primary-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
187
187
|
/**
|
|
188
188
|
* One option in the popup. Children render as the option's label (wrapped in
|
|
189
189
|
* Base UI's `ItemText`); a check mark appears at the item's right edge while
|