@viraui/react 2026.3.4 → 2026.3.6
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/components/accordion/accordion-item.d.ts +2 -2
- package/dist/components/accordion/accordion.guide.json +1 -1
- package/dist/components/surface/index.d.ts +1 -1
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +5 -2
- package/dist/components/surface/surface.guide.json +1 -1
- package/dist/components/surface/surface.js +2 -1
- package/package.json +2 -2
|
@@ -50,8 +50,8 @@ export type AccordionItemProps = AccordionItem.Props & {
|
|
|
50
50
|
*/
|
|
51
51
|
iconOpen?: React.ReactNode;
|
|
52
52
|
/**
|
|
53
|
-
* Contrast border side
|
|
54
|
-
* Omit for no border.
|
|
53
|
+
* Contrast border side(s) forwarded to the wrapping `Surface` when `useSurface` is `true`.
|
|
54
|
+
* Pass a single side or a list (e.g. `['bottom', 'left']`). Omit for no border.
|
|
55
55
|
*
|
|
56
56
|
* @default No border.
|
|
57
57
|
*/
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"description": "When `true`, open/closed blocks render as separated Surface islands with gap between them. When `false`, blocks stay attached with corner radius only on the first and last items. Applies only to items with `useSurface`."
|
|
29
29
|
},
|
|
30
30
|
"Item.border": {
|
|
31
|
-
"description": "Contrast border side
|
|
31
|
+
"description": "Contrast border side(s) forwarded to the wrapping `Surface` when `useSurface` is `true`. Pass a single side or a list (e.g. `[\"bottom\", \"left\"]`). Omit for no border."
|
|
32
32
|
},
|
|
33
33
|
"Item.children": {
|
|
34
34
|
"description": "Panel content revealed when the item is open."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Surface } from './surface';
|
|
2
|
-
export type { SurfaceProps } from './surface';
|
|
2
|
+
export type { SurfaceBorder, SurfaceProps } from './surface';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
)}&[data-surface-hover-color=primary]{--vui-surface-background-hover:light-dark(
|
|
5
5
|
oklab(from var(--global-primary) l a b / 20%),
|
|
6
6
|
oklab(from var(--global-primary) l a b / 10%)
|
|
7
|
-
)}@container root not style(--effect-vibrancy: initial){&[data-vibrant]{background:oklab(from var(--vui-surface-background) l a b/80%)}}&[data-surface-has-padding=true]{padding:var(--vui-surface-padding-block-start) var(--vui-surface-padding-inline-end) var(--vui-surface-padding-block-end) var(--vui-surface-padding-inline-start)}&[data-surface-border]{border-style:var(--vui-surface-border-style);border-color:var(--global-contrast)
|
|
7
|
+
)}@container root not style(--effect-vibrancy: initial){&[data-vibrant]{background:oklab(from var(--vui-surface-background) l a b/80%)}}&[data-surface-has-padding=true]{padding:var(--vui-surface-padding-block-start) var(--vui-surface-padding-inline-end) var(--vui-surface-padding-block-end) var(--vui-surface-padding-inline-start)}&[data-surface-border]{border-style:var(--vui-surface-border-style);border-color:var(--global-contrast);border-left-width:0;border-bottom-width:0;border-right-width:0;border-top-width:0}&[data-surface-border~=all]{border-width:1px}&[data-surface-border~=top]{border-top-width:1px}&[data-surface-border~=right]{border-right-width:1px}&[data-surface-border~=bottom]{border-bottom-width:1px}&[data-surface-border~=left]{border-left-width:1px}@media (hover:hover) and (pointer:fine){&[data-surface-has-hover-color=true]:hover{background:var(--vui-surface-background-hover)}}&[data-surface-container=true]{container:surface/inline-size}}}
|
|
@@ -6,6 +6,8 @@ type SurfaceBaseLevel = 1 | 2 | 3;
|
|
|
6
6
|
/** Named surface color tokens resolved via `data-surface-color` / `data-surface-hover-color` CSS hooks. */
|
|
7
7
|
type SurfaceColorToken = 'primary';
|
|
8
8
|
type SurfaceColor = string | SurfaceBaseLevel | SurfaceColorToken;
|
|
9
|
+
/** Contrast border sides; pass one side or a list (e.g. `['bottom', 'left']`). */
|
|
10
|
+
export type SurfaceBorder = 'all' | 'top' | 'right' | 'bottom' | 'left';
|
|
9
11
|
/**
|
|
10
12
|
* Public Surface props.
|
|
11
13
|
*
|
|
@@ -42,11 +44,12 @@ export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'>
|
|
|
42
44
|
*/
|
|
43
45
|
hoverColor?: SurfaceColor;
|
|
44
46
|
/**
|
|
45
|
-
* Applies the shared contrast border on
|
|
47
|
+
* Applies the shared contrast border on one or more sides (`'all'`, `'top'`, `'right'`, `'bottom'`, `'left'`).
|
|
48
|
+
* Pass a single side or a list (e.g. `['bottom', 'left']`). Omit for no border.
|
|
46
49
|
*
|
|
47
50
|
* @default No border.
|
|
48
51
|
*/
|
|
49
|
-
border?:
|
|
52
|
+
border?: SurfaceBorder | readonly SurfaceBorder[];
|
|
50
53
|
/**
|
|
51
54
|
* Sets the CSS border style when `border` is set.
|
|
52
55
|
*
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"properties": {
|
|
35
35
|
"react": {
|
|
36
36
|
"border": {
|
|
37
|
-
"description": "Applies the shared contrast border on
|
|
37
|
+
"description": "Applies the shared contrast border on one or more sides (`all`, `top`, `right`, `bottom`, `left`). Pass a single side or a list (e.g. `[\"bottom\", \"left\"]`). Omit for no border."
|
|
38
38
|
},
|
|
39
39
|
"enableContainer": {
|
|
40
40
|
"description": "Opt-in named CSS container query context for this Surface (enables `container: surface / inline-size` on the root). Required for `@container surface (min-width: ...)` rules to react to this Surface inline-size. Warning: inline-size containment can affect nested layout (e.g. cards inside Masonry). Use only when you need container queries against this specific Surface."
|
|
@@ -7,6 +7,7 @@ import surface_module_default from "./surface.module.js";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useRender } from "@base-ui/react/use-render";
|
|
9
9
|
//#region src/components/surface/surface.tsx
|
|
10
|
+
var toSurfaceBorderAttr = (border) => Array.isArray(border) ? border.join(" ") : border;
|
|
10
11
|
var isSurfaceColorToken = (value) => value === "primary";
|
|
11
12
|
var clampSurfaceBaseLevel = (value) => {
|
|
12
13
|
if (value <= 1) return 1;
|
|
@@ -46,7 +47,7 @@ var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hove
|
|
|
46
47
|
ref,
|
|
47
48
|
props: {
|
|
48
49
|
...otherProps,
|
|
49
|
-
...border && { "data-surface-border": border },
|
|
50
|
+
...border && { "data-surface-border": toSurfaceBorderAttr(border) },
|
|
50
51
|
...hasAutoRadius && { "data-surface-radius": "auto" },
|
|
51
52
|
...isSurfaceColorToken(color) && { "data-surface-color": color },
|
|
52
53
|
...isSurfaceColorToken(hoverColor) && { "data-surface-hover-color": hoverColor },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viraui/react",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@base-ui/react": ">=1.7.0",
|
|
31
|
-
"@viraui/foundation": "2026.3.
|
|
31
|
+
"@viraui/foundation": "2026.3.6",
|
|
32
32
|
"@viraui/icons": "2026.0.3",
|
|
33
33
|
"@viraui/postcss-config": "2026.0.0",
|
|
34
34
|
"@viraui/tsconfig": "2026.0.0",
|