@arcfusionz/arc-primitive-ui 0.3.7 → 0.3.9
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.
|
@@ -3,14 +3,14 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
3
3
|
//#region src/components/Box/Box.d.ts
|
|
4
4
|
type BoxBackground = "background" | "surface" | "muted" | "transparent" | "primary" | "secondary" | "hero";
|
|
5
5
|
type BoxShadow = "none" | "sm" | "md" | "lg";
|
|
6
|
-
type BoxRadius = "none" | "md" | "full";
|
|
6
|
+
type BoxRadius = "none" | "md" | "lg" | "full";
|
|
7
7
|
type BoxPadding = "none" | "sm" | "md" | "lg";
|
|
8
8
|
interface BoxVariantsOptions {
|
|
9
9
|
/** Semantic fill and its contrast-safe foreground color. */
|
|
10
10
|
background?: BoxBackground;
|
|
11
11
|
/** Elevation depth with a soft, diffused blur. All levels use Slate 400 at no more than 30% opacity. */
|
|
12
12
|
shadow?: BoxShadow;
|
|
13
|
-
/** Corner treatment.
|
|
13
|
+
/** Corner treatment. Defaults to the 12px `lg` container radius. */
|
|
14
14
|
radius?: BoxRadius;
|
|
15
15
|
/** Inset spacing around the content. */
|
|
16
16
|
padding?: BoxPadding;
|
|
@@ -26,7 +26,7 @@ interface BoxProps extends Omit<ComponentPropsWithoutRef<"div">, "className"> {
|
|
|
26
26
|
background?: BoxBackground;
|
|
27
27
|
/** Elevation depth with a soft, diffused blur. Levels `sm`/`md`/`lg` use Slate 400 at 10%/20%/30% opacity and 8px/14px/22px blur; use `none` for flat layout containers. */
|
|
28
28
|
shadow?: BoxShadow;
|
|
29
|
-
/** Corner treatment. `
|
|
29
|
+
/** Corner treatment. `lg` (default) is the ArcFusion 12px container radius; `md` is the 6px control radius. */
|
|
30
30
|
radius?: BoxRadius;
|
|
31
31
|
/** Inset spacing around the content: `none` (0), `sm` (12px), `md` (16px), or `lg` (24px). */
|
|
32
32
|
padding?: BoxPadding;
|
|
@@ -21,6 +21,7 @@ const shadowClasses = {
|
|
|
21
21
|
const radiusClasses = {
|
|
22
22
|
none: "rounded-none",
|
|
23
23
|
md: "rounded-md",
|
|
24
|
+
lg: "rounded-lg",
|
|
24
25
|
full: "rounded-full"
|
|
25
26
|
};
|
|
26
27
|
const paddingClasses = {
|
|
@@ -30,10 +31,10 @@ const paddingClasses = {
|
|
|
30
31
|
lg: "p-6"
|
|
31
32
|
};
|
|
32
33
|
/** Class list for an element styled as an ArcFusion Box frame. */
|
|
33
|
-
function boxVariants({ background = "background", shadow = "md", radius = "
|
|
34
|
+
function boxVariants({ background = "background", shadow = "md", radius = "lg", padding = "md", border = true, className } = {}) {
|
|
34
35
|
return cn(baseClasses, backgroundClasses[background], shadowClasses[shadow], radiusClasses[radius], paddingClasses[padding], border && "border border-slate-200", className);
|
|
35
36
|
}
|
|
36
|
-
const Box = forwardRef(({ background = "background", shadow = "md", radius = "
|
|
37
|
+
const Box = forwardRef(({ background = "background", shadow = "md", radius = "lg", padding = "md", border = true, render, className, ...rest }, ref) => useRender({
|
|
37
38
|
defaultTagName: "div",
|
|
38
39
|
render,
|
|
39
40
|
ref,
|
package/package.json
CHANGED
package/src/styles/theme.css
CHANGED
|
@@ -38,12 +38,14 @@
|
|
|
38
38
|
|
|
39
39
|
/* ---------------------------------------------------------------------
|
|
40
40
|
* Radius
|
|
41
|
-
* The system uses a
|
|
42
|
-
*
|
|
43
|
-
* and `rounded-full` stay
|
|
41
|
+
* The system uses a 6px control radius and a 12px container radius.
|
|
42
|
+
* Tailwind's default radius scale is removed so only `rounded-md` and
|
|
43
|
+
* `rounded-lg` are sized options (`rounded-none` and `rounded-full` stay
|
|
44
|
+
* available for structural cases).
|
|
44
45
|
* ------------------------------------------------------------------- */
|
|
45
46
|
--radius-*: initial;
|
|
46
47
|
--radius-md: 6px;
|
|
48
|
+
--radius-lg: 12px;
|
|
47
49
|
|
|
48
50
|
/* ---------------------------------------------------------------------
|
|
49
51
|
* Motion
|
|
@@ -309,6 +311,8 @@
|
|
|
309
311
|
--color-background: #ffffff; /* [brand] the "Clean Slate" */
|
|
310
312
|
--color-foreground: var(--color-slate-900);
|
|
311
313
|
|
|
314
|
+
--color-canvas: #f9fafc;
|
|
315
|
+
|
|
312
316
|
--color-surface: var(--color-slate-50);
|
|
313
317
|
--color-surface-foreground: var(--color-slate-900);
|
|
314
318
|
|