@viraui/react 1.0.10 → 1.0.11
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/catalog.json +13 -1
- package/dist/components/annotate/annotate.css +1 -0
- package/dist/components/annotate/annotate.d.ts +88 -0
- package/dist/components/annotate/annotate.guide.json +103 -0
- package/dist/components/annotate/annotate.js +31 -0
- package/dist/components/annotate/annotate.module.js +5 -0
- package/dist/components/annotate/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.js +3 -6
- package/dist/components/avatar-group/avatar-group.d.ts +1 -2
- package/dist/components/avatar-group/avatar-group.js +1 -4
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/basic-input.d.ts +7 -0
- package/dist/components/basic-input/basic-input.js +4 -1
- package/dist/components/basic-input/input-control-group.js +2 -2
- package/dist/components/bleed/bleed.d.ts +1 -2
- package/dist/components/bleed/bleed.js +1 -4
- package/dist/components/button/button-link.d.ts +1 -2
- package/dist/components/button/button-link.js +1 -4
- package/dist/components/button/button.d.ts +1 -2
- package/dist/components/button/button.js +2 -6
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/chip/chip.d.ts +1 -2
- package/dist/components/chip/chip.js +3 -6
- package/dist/components/clamp-text/clamp-text.d.ts +1 -2
- package/dist/components/clamp-text/clamp-text.js +1 -4
- package/dist/components/dialog/dialog-sheet.js +1 -1
- package/dist/components/elevator/elevator.d.ts +1 -2
- package/dist/components/elevator/elevator.js +1 -4
- package/dist/components/fieldset/fieldset.d.ts +1 -2
- package/dist/components/fieldset/fieldset.js +16 -21
- package/dist/components/fit-text/fit-text.css +1 -0
- package/dist/components/fit-text/fit-text.d.ts +18 -0
- package/dist/components/fit-text/fit-text.guide.json +39 -0
- package/dist/components/fit-text/fit-text.js +31 -0
- package/dist/components/fit-text/fit-text.module.js +13 -0
- package/dist/components/fit-text/index.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/linear-progress/linear-progress.d.ts +0 -13
- package/dist/components/linear-progress/linear-progress.js +41 -46
- package/dist/components/masonry/index.d.ts +1 -1
- package/dist/components/masonry/masonry-item.d.ts +1 -2
- package/dist/components/masonry/masonry-item.js +10 -15
- package/dist/components/masonry/masonry.d.ts +10 -11
- package/dist/components/masonry/masonry.guide.json +1 -1
- package/dist/components/masonry/masonry.js +9 -18
- package/dist/components/meter/meter.d.ts +0 -13
- package/dist/components/meter/meter.js +40 -45
- package/dist/components/popover/popover-sheet.js +1 -1
- package/dist/components/progressive-blur/progressive-blur.d.ts +1 -2
- package/dist/components/progressive-blur/progressive-blur.js +1 -4
- package/dist/components/progressive-blur/progressive-blur.utils.js +4 -7
- package/dist/components/select/select-indicator-slot.js +3 -3
- package/dist/components/select/select-option.js +2 -2
- package/dist/components/select/select.d.ts +1 -2
- package/dist/components/select/select.js +3 -6
- package/dist/components/separator/separator.d.ts +1 -2
- package/dist/components/separator/separator.js +1 -4
- package/dist/components/shimmer/shimmer.d.ts +1 -2
- package/dist/components/shimmer/shimmer.js +1 -4
- package/dist/components/skeleton/skeleton.d.ts +1 -2
- package/dist/components/skeleton/skeleton.js +1 -4
- package/dist/components/slider/slider.d.ts +0 -13
- package/dist/components/slider/slider.js +1 -4
- package/dist/components/spinner/spinner.d.ts +1 -2
- package/dist/components/spinner/spinner.js +19 -24
- package/dist/components/stack/stack.d.ts +1 -2
- package/dist/components/stack/stack.js +1 -4
- package/dist/components/static-noise/static-noise.d.ts +1 -2
- package/dist/components/static-noise/static-noise.js +1 -4
- package/dist/components/surface/surface.d.ts +1 -2
- package/dist/components/surface/surface.js +1 -4
- package/dist/components/switch/switch.d.ts +0 -13
- package/dist/components/switch/switch.js +1 -4
- package/dist/components/text/text.d.ts +1 -2
- package/dist/components/text/text.js +1 -4
- package/dist/components/textarea/textarea.d.ts +9 -15
- package/dist/components/textarea/textarea.guide.json +7 -1
- package/dist/components/textarea/textarea.js +34 -38
- package/dist/components/textfield/textfield.d.ts +9 -2
- package/dist/components/textfield/textfield.guide.json +5 -0
- package/dist/components/textfield/textfield.js +38 -42
- package/dist/components/title/title.d.ts +1 -2
- package/dist/components/title/title.js +1 -4
- package/dist/components/toast/toast-banner.js +1 -1
- package/dist/components/tooltip/tooltip-content.js +1 -1
- package/dist/components/typewriter/typewriter.d.ts +1 -2
- package/dist/components/typewriter/typewriter.js +1 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -1
- package/dist/preflight-surface.json +19 -20
- package/dist/preflight.css +1 -1
- package/package.json +4 -4
- package/dist/core/props/intrinsic-vira-props.d.ts +0 -30
- package/dist/core/props/intrinsic-vira-props.js +0 -14
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './clamp-text.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
5
4
|
import clamp_text_module_default from "./clamp-text.module.js";
|
|
6
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
7
6
|
import { useMemo } from "react";
|
|
8
7
|
//#region src/components/clamp-text/clamp-text.tsx
|
|
9
8
|
var ClampText = ({ className, inline = false, ref, render, rows = 1, style, ...otherProps }) => {
|
|
10
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
11
9
|
const dynamicStyle = useMemo(() => ({ "--vui-clamp-text-rows": rows }), [rows]);
|
|
12
10
|
return useRender({
|
|
13
11
|
defaultTagName: "span",
|
|
14
12
|
render,
|
|
15
13
|
ref,
|
|
16
14
|
props: {
|
|
17
|
-
...
|
|
18
|
-
...intrinsicAttributes,
|
|
15
|
+
...otherProps,
|
|
19
16
|
"data-clamp-text-inline": inline ? "true" : "false",
|
|
20
17
|
className: clsx(clamp_text_module_default.ClampText, className),
|
|
21
18
|
style: {
|
|
@@ -24,7 +24,7 @@ var DialogSheet = ({ children, description, title, showCloseButton = false, fitC
|
|
|
24
24
|
border: "top",
|
|
25
25
|
render: /* @__PURE__ */ jsx(Stack, { hAlign: "center" }),
|
|
26
26
|
color: 1,
|
|
27
|
-
vibrant:
|
|
27
|
+
"data-vibrant": "",
|
|
28
28
|
radius: "large",
|
|
29
29
|
vPadding: ["medium", 0]
|
|
30
30
|
}),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElevationDirection, ElevationLevel, ElevationShadowColor } from '../../core/elevation/elevation-types';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
export type { ElevationDirection, ElevationLevel, ElevationShadowColor, } from '../../core/elevation/elevation-types';
|
|
5
4
|
export { ELEVATION_DEFAULTS } from '../../core/elevation/elevation-types';
|
|
@@ -11,7 +10,7 @@ export { getElevationProps } from '../../core/elevation/get-elevation-props';
|
|
|
11
10
|
*
|
|
12
11
|
* @default Native child pass-through props are preserved and merged with elevation hooks.
|
|
13
12
|
*/
|
|
14
|
-
export type ElevatorProps =
|
|
13
|
+
export type ElevatorProps = {
|
|
15
14
|
/**
|
|
16
15
|
* Element or elements that receive elevation hooks on their rendered root.
|
|
17
16
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
2
1
|
import { ELEVATION_DEFAULTS } from "../../core/elevation/elevation-types.js";
|
|
3
2
|
import { getElevationProps } from "../../core/elevation/get-elevation-props.js";
|
|
4
3
|
import { Children, cloneElement, isValidElement } from "react";
|
|
@@ -7,8 +6,7 @@ var mergeChildStyle = (childStyle, elevationStyle) => ({
|
|
|
7
6
|
...childStyle ?? {},
|
|
8
7
|
...elevationStyle
|
|
9
8
|
});
|
|
10
|
-
var Elevator = ({ children, resting, hover, direction, shadowColor, extraShadow
|
|
11
|
-
const { intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
9
|
+
var Elevator = ({ children, resting, hover, direction, shadowColor, extraShadow }) => {
|
|
12
10
|
const elevation = getElevationProps({
|
|
13
11
|
resting,
|
|
14
12
|
hover,
|
|
@@ -19,7 +17,6 @@ var Elevator = ({ children, resting, hover, direction, shadowColor, extraShadow,
|
|
|
19
17
|
return Children.map(children, (child) => {
|
|
20
18
|
if (!isValidElement(child)) return child;
|
|
21
19
|
return cloneElement(child, {
|
|
22
|
-
...intrinsicAttributes,
|
|
23
20
|
...elevation.attributes,
|
|
24
21
|
style: mergeChildStyle(child.props.style, elevation.style)
|
|
25
22
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FieldsetRoot } from '@base-ui/react';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public Fieldset props.
|
|
@@ -10,7 +9,7 @@ import type * as React from 'react';
|
|
|
10
9
|
*
|
|
11
10
|
* @default Base UI pass-through props keep upstream defaults.
|
|
12
11
|
*/
|
|
13
|
-
export type FieldsetProps = FieldsetRoot.Props &
|
|
12
|
+
export type FieldsetProps = FieldsetRoot.Props & {
|
|
14
13
|
/**
|
|
15
14
|
* Visible legend copy rendered with shared internal `FieldLabel`.
|
|
16
15
|
*
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
2
1
|
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
3
2
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
4
3
|
import { Stack } from "../stack/stack.js";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { Fieldset } from "@base-ui/react";
|
|
7
6
|
//#region src/components/fieldset/fieldset.tsx
|
|
8
|
-
var Fieldset$1 = ({ children, className, description, disabled, error, label, ...fieldsetRootProps }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}) : null]
|
|
25
|
-
}), children]
|
|
26
|
-
});
|
|
27
|
-
};
|
|
7
|
+
var Fieldset$1 = ({ children, className, description, disabled, error, label, ...fieldsetRootProps }) => /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
8
|
+
...fieldsetRootProps,
|
|
9
|
+
className,
|
|
10
|
+
disabled,
|
|
11
|
+
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
12
|
+
vPadding: [0, "small"],
|
|
13
|
+
rowGap: "small",
|
|
14
|
+
children: [label ? /* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
15
|
+
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
16
|
+
children: label
|
|
17
|
+
}) : null, description || error ? /* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
18
|
+
description,
|
|
19
|
+
error
|
|
20
|
+
}) : null]
|
|
21
|
+
}), children]
|
|
22
|
+
});
|
|
28
23
|
//#endregion
|
|
29
24
|
export { Fieldset$1 as Fieldset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-fit-text-captured-length{syntax:"<length>";inherits:true;initial-value:0}@property --vui-fit-text-max-font-size{syntax:"<length>";inherits:true;initial-value:calc(infinity * 1px)}.viraui__fit-text-module__FitText_CdAvq{--vui-fit-text-captured-length:initial;display:flex;container-type:inline-size;.viraui__fit-text-module__Container_bawpR{--vui-fit-text-captured-length:100cqi;--vui-fit-text-available-space:var(--vui-fit-text-captured-length);flex-grow:1;container-type:inline-size}.viraui__fit-text-module__Display_Hraif{--vui-fit-text-captured-length:100cqi;--vui-fit-text-ratio:tan(atan2(var(--vui-fit-text-available-space),var(--vui-fit-text-available-space) - var(--vui-fit-text-captured-length)));display:block;inline-size:var(--vui-fit-text-available-space);font-size:clamp(0px,1em * var(--vui-fit-text-ratio),var(--vui-fit-text-max-font-size));>*{font-size:1em;max-inline-size:none}}.viraui__fit-text-module__Reference_6wCx7{visibility:hidden;>*{font-size:inherit;max-inline-size:none}}}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Public FitText props.
|
|
4
|
+
*
|
|
5
|
+
* Includes standard `div` attributes such as `children`, `id`, `className`, and event handlers,
|
|
6
|
+
* plus an optional fitted font-size cap.
|
|
7
|
+
*
|
|
8
|
+
* @default Native div pass-through props keep React defaults.
|
|
9
|
+
*/
|
|
10
|
+
export type FitTextProps = React.ComponentPropsWithRef<'div'> & {
|
|
11
|
+
/**
|
|
12
|
+
* Caps the fitted font size using any valid CSS length string.
|
|
13
|
+
*
|
|
14
|
+
* @default No maximum — fitted size may grow without an upper bound.
|
|
15
|
+
*/
|
|
16
|
+
maxFontSize?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const FitText: React.FC<FitTextProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "FitText",
|
|
3
|
+
"summary": "CSS-only fit-to-width wrapper that scales children to fill available inline space.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Headlines or short copy that should fill a constrained inline width",
|
|
6
|
+
"Multi-line display type broken with br (or equivalent) inside Title, Text, or native markup",
|
|
7
|
+
"Resize-friendly marketing/hero type without JS measurement"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Long body copy that should wrap and reflow at a fixed type size",
|
|
11
|
+
"Truncation — use ClampText instead",
|
|
12
|
+
"Cases that need a JS-measured or observer-driven fit"
|
|
13
|
+
],
|
|
14
|
+
"accessibility": [
|
|
15
|
+
"Children render twice; the reference copy is aria-hidden and inert so assistive tech sees one tree",
|
|
16
|
+
"Keep semantic roots on the visible children (Title render, heading elements, paragraphs)",
|
|
17
|
+
"Fitted size still respects user zoom because the ratio multiplies 1em"
|
|
18
|
+
],
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Expecting automatic line breaks without br or block structure in children",
|
|
21
|
+
"Putting interactive controls inside FitText (duplicate trees and inert reference)",
|
|
22
|
+
"Using FitText for truncation or ellipsis"
|
|
23
|
+
],
|
|
24
|
+
"related": ["Title", "Text", "ClampText"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"react": {
|
|
27
|
+
"maxFontSize": {
|
|
28
|
+
"description": "Caps the fitted font size using any valid CSS length string.",
|
|
29
|
+
"refCss": "max-font-size"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"css": {
|
|
33
|
+
"max-font-size": {
|
|
34
|
+
"description": "Upper bound for the fitted font size on the display slot.",
|
|
35
|
+
"refReact": "maxFontSize"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './fit-text.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import fit_text_module_default from "./fit-text.module.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/fit-text/fit-text.tsx
|
|
6
|
+
var FitText = ({ children, className, maxFontSize, ref, style, ...otherProps }) => {
|
|
7
|
+
const dynamicStyle = {
|
|
8
|
+
...maxFontSize && { "--vui-fit-text-max-font-size": maxFontSize },
|
|
9
|
+
...style
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
...otherProps,
|
|
13
|
+
ref,
|
|
14
|
+
className: clsx(fit_text_module_default.FitText, className),
|
|
15
|
+
style: dynamicStyle,
|
|
16
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: fit_text_module_default.Container,
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: fit_text_module_default.Display,
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
className: fit_text_module_default.Reference,
|
|
25
|
+
inert: true,
|
|
26
|
+
children
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { FitText };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/fit-text/fit-text.module.css
|
|
2
|
+
var FitText = "viraui__fit-text-module__FitText_CdAvq";
|
|
3
|
+
var Container = "viraui__fit-text-module__Container_bawpR";
|
|
4
|
+
var Display = "viraui__fit-text-module__Display_Hraif";
|
|
5
|
+
var Reference = "viraui__fit-text-module__Reference_6wCx7";
|
|
6
|
+
var fit_text_module_default = {
|
|
7
|
+
FitText,
|
|
8
|
+
Container,
|
|
9
|
+
Display,
|
|
10
|
+
Reference
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Container, Display, FitText, Reference, fit_text_module_default as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './accordion';
|
|
2
|
+
export * from './annotate';
|
|
2
3
|
export * from './avatar';
|
|
3
4
|
export * from './avatar-group';
|
|
4
5
|
export * from './bleed';
|
|
@@ -9,6 +10,7 @@ export * from './clamp-text';
|
|
|
9
10
|
export * from './dialog';
|
|
10
11
|
export * from './elevator';
|
|
11
12
|
export * from './fieldset';
|
|
13
|
+
export * from './fit-text';
|
|
12
14
|
export * from './icon-button';
|
|
13
15
|
export * from './linear-progress';
|
|
14
16
|
export * from './masonry';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProgressRoot } from '@base-ui/react/progress';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public LinearProgress props.
|
|
@@ -10,18 +9,6 @@ import type * as React from 'react';
|
|
|
10
9
|
* @default Base UI pass-through props keep upstream defaults.
|
|
11
10
|
*/
|
|
12
11
|
export type LinearProgressProps = ProgressRoot.Props & {
|
|
13
|
-
/**
|
|
14
|
-
* Adds `data-grow="false"` to the progress root when false.
|
|
15
|
-
*
|
|
16
|
-
* @default The progress root does not render a grow attribute.
|
|
17
|
-
*/
|
|
18
|
-
grow?: IntrinsicViraProps['grow'];
|
|
19
|
-
/**
|
|
20
|
-
* Adds `data-shrink="false"` to the progress root when false.
|
|
21
|
-
*
|
|
22
|
-
* @default The progress root does not render a shrink attribute.
|
|
23
|
-
*/
|
|
24
|
-
shrink?: IntrinsicViraProps['shrink'];
|
|
25
12
|
/**
|
|
26
13
|
* Visible label rendered through `Progress.Label` with shared internal `FieldLabel`.
|
|
27
14
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './linear-progress.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { Text } from "../text/text.js";
|
|
5
4
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
6
5
|
import { Stack } from "../stack/stack.js";
|
|
@@ -8,53 +7,49 @@ import linear_progress_module_default from "./linear-progress.module.js";
|
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { Progress } from "@base-ui/react/progress";
|
|
10
9
|
//#region src/components/linear-progress/linear-progress.tsx
|
|
11
|
-
var LinearProgress = ({ className, description, label, showValue = false, value, ref, ...progressRootProps }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
var LinearProgress = ({ className, description, label, showValue = false, value, ref, ...progressRootProps }) => /* @__PURE__ */ jsxs(Progress.Root, {
|
|
11
|
+
...progressRootProps,
|
|
12
|
+
ref,
|
|
13
|
+
className: clsx(linear_progress_module_default.LinearProgress, className),
|
|
14
|
+
value,
|
|
15
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
16
|
+
direction: "column",
|
|
17
|
+
fillChildren: false,
|
|
18
|
+
rowGap: "small",
|
|
19
|
+
columnGap: "x-small"
|
|
20
|
+
}),
|
|
21
|
+
children: [
|
|
22
|
+
(label || showValue) && /* @__PURE__ */ jsxs(Stack, {
|
|
23
|
+
direction: "row",
|
|
21
24
|
fillChildren: false,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
columnGap: "small",
|
|
30
|
-
vAlign: "center",
|
|
31
|
-
hAlign: "space-between",
|
|
32
|
-
children: [label && /* @__PURE__ */ jsx(Progress.Label, {
|
|
33
|
-
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
34
|
-
children: label
|
|
35
|
-
}), showValue && /* @__PURE__ */ jsx(Text, {
|
|
36
|
-
size: "small",
|
|
37
|
-
tone: "muted",
|
|
38
|
-
family: "mono",
|
|
39
|
-
whiteSpace: "nowrap",
|
|
40
|
-
selection: false,
|
|
41
|
-
align: "end",
|
|
42
|
-
shrink: false,
|
|
43
|
-
render: /* @__PURE__ */ jsx(Progress.Value, { render: /* @__PURE__ */ jsx("output", {}) })
|
|
44
|
-
})]
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ jsx(Progress.Track, {
|
|
47
|
-
className: linear_progress_module_default.Track,
|
|
48
|
-
children: /* @__PURE__ */ jsx(Progress.Indicator, { className: linear_progress_module_default.Indicator })
|
|
49
|
-
}),
|
|
50
|
-
description && /* @__PURE__ */ jsx(Text, {
|
|
51
|
-
className: linear_progress_module_default.Description,
|
|
25
|
+
columnGap: "small",
|
|
26
|
+
vAlign: "center",
|
|
27
|
+
hAlign: "space-between",
|
|
28
|
+
children: [label && /* @__PURE__ */ jsx(Progress.Label, {
|
|
29
|
+
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
30
|
+
children: label
|
|
31
|
+
}), showValue && /* @__PURE__ */ jsx(Text, {
|
|
52
32
|
size: "small",
|
|
53
33
|
tone: "muted",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
family: "mono",
|
|
35
|
+
whiteSpace: "nowrap",
|
|
36
|
+
selection: false,
|
|
37
|
+
align: "end",
|
|
38
|
+
"data-shrink": "false",
|
|
39
|
+
render: /* @__PURE__ */ jsx(Progress.Value, { render: /* @__PURE__ */ jsx("output", {}) })
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(Progress.Track, {
|
|
43
|
+
className: linear_progress_module_default.Track,
|
|
44
|
+
children: /* @__PURE__ */ jsx(Progress.Indicator, { className: linear_progress_module_default.Indicator })
|
|
45
|
+
}),
|
|
46
|
+
description && /* @__PURE__ */ jsx(Text, {
|
|
47
|
+
className: linear_progress_module_default.Description,
|
|
48
|
+
size: "small",
|
|
49
|
+
tone: "muted",
|
|
50
|
+
children: description
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
59
54
|
//#endregion
|
|
60
55
|
export { LinearProgress };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Masonry } from './masonry';
|
|
2
|
-
export type { MasonryItemProps, MasonryProps } from './masonry';
|
|
2
|
+
export type { MasonryBreakpointCols, MasonryItemProps, MasonryProps } from './masonry';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public Masonry.Item props.
|
|
@@ -9,7 +8,7 @@ import type * as React from 'react';
|
|
|
9
8
|
*
|
|
10
9
|
* @default Native div pass-through props keep React defaults.
|
|
11
10
|
*/
|
|
12
|
-
export type MasonryItemProps = React.ComponentPropsWithRef<'div'> &
|
|
11
|
+
export type MasonryItemProps = React.ComponentPropsWithRef<'div'> & {
|
|
13
12
|
/**
|
|
14
13
|
* Replaces the default `div` root using Base UI render semantics.
|
|
15
14
|
*
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { clsx } from "../../core/clsx.js";
|
|
2
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
3
2
|
import masonry_module_default from "./masonry.module.js";
|
|
4
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
4
|
//#region src/components/masonry/masonry-item.tsx
|
|
6
|
-
var MasonryItem = ({ className, ref, render, style, ...otherProps }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
style: { ...style }
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
5
|
+
var MasonryItem = ({ className, ref, render, style, ...otherProps }) => useRender({
|
|
6
|
+
defaultTagName: "div",
|
|
7
|
+
render,
|
|
8
|
+
ref,
|
|
9
|
+
props: {
|
|
10
|
+
...otherProps,
|
|
11
|
+
className: clsx(masonry_module_default.Item, className),
|
|
12
|
+
style: { ...style }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
20
15
|
//#endregion
|
|
21
16
|
export { MasonryItem };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { StackProps } from '..';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import { MasonryItemProps } from './masonry-item';
|
|
5
4
|
import type * as React from 'react';
|
|
6
5
|
/**
|
|
7
|
-
* Mobile-first Masonry column counts keyed by
|
|
6
|
+
* Mobile-first Masonry column counts keyed by CSS px lengths (unitless numbers).
|
|
8
7
|
*
|
|
9
8
|
* `default` applies before a breakpoint matches. Other keys are `min-width`
|
|
10
|
-
* values against the Masonry root's content-box inline size. Keys may be
|
|
11
|
-
* order; the largest matching breakpoint wins.
|
|
9
|
+
* values in px against the Masonry root's content-box inline size. Keys may be
|
|
10
|
+
* in any order; the largest matching breakpoint wins. Non-finite keys are ignored.
|
|
12
11
|
*/
|
|
13
12
|
export type MasonryBreakpointCols = {
|
|
14
13
|
default: number;
|
|
15
|
-
[
|
|
14
|
+
[minWidthPx: number]: number;
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* Public Masonry props.
|
|
@@ -22,7 +21,7 @@ export type MasonryBreakpointCols = {
|
|
|
22
21
|
*
|
|
23
22
|
* @default Native div pass-through props keep React defaults.
|
|
24
23
|
*/
|
|
25
|
-
export type MasonryProps = React.ComponentPropsWithRef<'div'> &
|
|
24
|
+
export type MasonryProps = React.ComponentPropsWithRef<'div'> & {
|
|
26
25
|
/**
|
|
27
26
|
* Replaces the default `div` root using Base UI render semantics.
|
|
28
27
|
*
|
|
@@ -36,13 +35,13 @@ export type MasonryProps = React.ComponentPropsWithRef<'div'> & IntrinsicViraPro
|
|
|
36
35
|
*/
|
|
37
36
|
gap?: StackProps['columnGap'];
|
|
38
37
|
/**
|
|
39
|
-
* Sets the mobile-first column count at each
|
|
38
|
+
* Sets the mobile-first column count at each CSS px container breakpoint.
|
|
40
39
|
*
|
|
41
|
-
* Each non-`default` key is a `min-width` in
|
|
42
|
-
* content-box inline size. Keys may be in any order; the largest
|
|
43
|
-
* breakpoint wins. Non
|
|
40
|
+
* Each non-`default` key is a unitless `min-width` in px against the Masonry
|
|
41
|
+
* root's content-box inline size. Keys may be in any order; the largest
|
|
42
|
+
* matching breakpoint wins. Non-finite keys are ignored.
|
|
44
43
|
*
|
|
45
|
-
* @default { default: 1,
|
|
44
|
+
* @default { default: 1, 480: 2, 768: 3, 960: 4, 1280: 5, 2560: 6 }
|
|
46
45
|
*/
|
|
47
46
|
breakpointCols?: MasonryBreakpointCols;
|
|
48
47
|
};
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"refCss": "gap"
|
|
29
29
|
},
|
|
30
30
|
"breakpointCols": {
|
|
31
|
-
"description": "Mobile-first column counts keyed by px min-width breakpoints against the Masonry root content-box inline size; keys may be in any order, the largest matching breakpoint wins, and non-
|
|
31
|
+
"description": "Mobile-first column counts keyed by unitless CSS px min-width breakpoints against the Masonry root content-box inline size; keys may be in any order, the largest matching breakpoint wins, and non-finite keys are ignored."
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"css": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './masonry.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
5
4
|
import { resolveThemeValue } from "../../core/theme/resolve-theme-value.js";
|
|
6
5
|
import { Stack } from "../stack/stack.js";
|
|
7
6
|
import masonry_module_default from "./masonry.module.js";
|
|
@@ -12,27 +11,20 @@ import { Children, useEffect, useRef, useState } from "react";
|
|
|
12
11
|
//#region src/components/masonry/masonry.tsx
|
|
13
12
|
var DEFAULT_BREAKPOINT_COLS = {
|
|
14
13
|
default: 1,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
var parseBreakpointPx = (value) => {
|
|
22
|
-
const trimmed = value.trim();
|
|
23
|
-
if (!trimmed.endsWith("px")) return null;
|
|
24
|
-
const px = Number.parseFloat(trimmed);
|
|
25
|
-
return Number.isFinite(px) ? px : null;
|
|
14
|
+
480: 2,
|
|
15
|
+
768: 3,
|
|
16
|
+
960: 4,
|
|
17
|
+
1280: 5,
|
|
18
|
+
2560: 6
|
|
26
19
|
};
|
|
27
20
|
var resolveColumnCount = (widthPx, breakpointCols) => Object.entries(breakpointCols).filter(([breakpoint]) => breakpoint !== "default").flatMap(([breakpoint, nextColumnCount]) => {
|
|
28
|
-
const minWidthPx =
|
|
29
|
-
return minWidthPx
|
|
21
|
+
const minWidthPx = Number(breakpoint);
|
|
22
|
+
return Number.isFinite(minWidthPx) ? [{
|
|
30
23
|
minWidthPx,
|
|
31
24
|
nextColumnCount
|
|
32
|
-
}];
|
|
25
|
+
}] : [];
|
|
33
26
|
}).sort((left, right) => left.minWidthPx - right.minWidthPx).reduce((columnCount, { minWidthPx, nextColumnCount }) => widthPx >= minWidthPx ? nextColumnCount : columnCount, breakpointCols.default);
|
|
34
27
|
var MasonryRoot = ({ children, className, breakpointCols = DEFAULT_BREAKPOINT_COLS, gap = "large", ref, render, style, ...otherProps }) => {
|
|
35
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
36
28
|
const rootRef = useRef(null);
|
|
37
29
|
const consumerRef = ref;
|
|
38
30
|
const [columnCount, setColumnCount] = useState(breakpointCols.default);
|
|
@@ -73,8 +65,7 @@ var MasonryRoot = ({ children, className, breakpointCols = DEFAULT_BREAKPOINT_CO
|
|
|
73
65
|
render,
|
|
74
66
|
ref: setRootRef,
|
|
75
67
|
props: {
|
|
76
|
-
...
|
|
77
|
-
...intrinsicAttributes,
|
|
68
|
+
...otherProps,
|
|
78
69
|
className: clsx(masonry_module_default.Masonry, className),
|
|
79
70
|
style: dynamicStyle,
|
|
80
71
|
children: columns.map((column) => /* @__PURE__ */ jsx(Stack, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MeterRoot } from '@base-ui/react';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public Meter props.
|
|
@@ -10,18 +9,6 @@ import type * as React from 'react';
|
|
|
10
9
|
* @default Base UI pass-through props keep upstream defaults.
|
|
11
10
|
*/
|
|
12
11
|
export type MeterProps = MeterRoot.Props & {
|
|
13
|
-
/**
|
|
14
|
-
* Adds `data-grow="false"` to the meter root when false.
|
|
15
|
-
*
|
|
16
|
-
* @default The meter root does not render a grow attribute.
|
|
17
|
-
*/
|
|
18
|
-
grow?: IntrinsicViraProps['grow'];
|
|
19
|
-
/**
|
|
20
|
-
* Adds `data-shrink="false"` to the meter root when false.
|
|
21
|
-
*
|
|
22
|
-
* @default The meter root does not render a shrink attribute.
|
|
23
|
-
*/
|
|
24
|
-
shrink?: IntrinsicViraProps['shrink'];
|
|
25
12
|
/**
|
|
26
13
|
* Visible label rendered through `Meter.Label` with shared internal `FieldLabel`.
|
|
27
14
|
*
|