@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
package/dist/catalog.json
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
"summary": "Collapsible sections grouped into open/closed blocks with optional Surface wrapping, shared corner radius, and background on open items.",
|
|
9
9
|
"guidePath": "./components/accordion/accordion.guide.json"
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
"id": "annotate",
|
|
13
|
+
"name": "Annotate",
|
|
14
|
+
"summary": "Decorative CSS-only arrow and handwritten label that wraps inline content with optional highlighter mark.",
|
|
15
|
+
"guidePath": "./components/annotate/annotate.guide.json"
|
|
16
|
+
},
|
|
11
17
|
{
|
|
12
18
|
"id": "avatar",
|
|
13
19
|
"name": "Avatar",
|
|
@@ -68,6 +74,12 @@
|
|
|
68
74
|
"summary": "Semantic field grouping with shared legend and optional group helper copy.",
|
|
69
75
|
"guidePath": "./components/fieldset/fieldset.guide.json"
|
|
70
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"id": "fit-text",
|
|
79
|
+
"name": "FitText",
|
|
80
|
+
"summary": "CSS-only fit-to-width wrapper that scales children to fill available inline space.",
|
|
81
|
+
"guidePath": "./components/fit-text/fit-text.guide.json"
|
|
82
|
+
},
|
|
71
83
|
{
|
|
72
84
|
"id": "icon-button",
|
|
73
85
|
"name": "IconButton",
|
|
@@ -185,7 +197,7 @@
|
|
|
185
197
|
{
|
|
186
198
|
"id": "textarea",
|
|
187
199
|
"name": "Textarea",
|
|
188
|
-
"summary": "Multi-line field control with shared field copy and optional
|
|
200
|
+
"summary": "Multi-line field control with shared field copy, optional resize, and optional content sizing.",
|
|
189
201
|
"guidePath": "./components/textarea/textarea.guide.json"
|
|
190
202
|
},
|
|
191
203
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-annotate-color{syntax:"<color>";inherits:true;initial-value:#d16500}@property --vui-annotate-arrow-x{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-arrow-y{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-text-x{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-text-y{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-rotate{syntax:"<angle>";inherits:true;initial-value:-4deg}@property --vui-annotate-target-gap{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-label-gap{syntax:"<length>";inherits:true;initial-value:0}@property --vui-annotate-label-max-width{syntax:"<length>";inherits:true;initial-value:150px}.viraui__annotate-module__Annotate_7C36U{--vui-annotate-color:var(--highlight-yellow);--vui-annotate-target-gap:var(--space-small);--vui-annotate-label-gap:var(--space-x-small);position:relative;display:inline-block;overflow:visible;border-radius:var(--radius-x-small);&:before{content:"";z-index:3;width:46px;height:38px;transform-origin:50% 50%;mask:var(--_annotate-arrow-mask) center /contain no-repeat;background:var(--vui-annotate-color)}&:after,&:before{position:absolute;pointer-events:none}&:after{content:attr(data-note);z-index:4;width:max-content;max-width:var(--vui-annotate-label-max-width);transform:rotate(var(--vui-annotate-rotate));font-family:Segoe Print,Chalkboard,cursive,system-ui;font-size:.95rem;line-height:1.05;color:var(--vui-annotate-color);white-space:normal}&:not([data-note]):after,&:not([data-note]):before,&[data-note=""]:after,&[data-note=""]:before{display:none}&[data-mark=true]{background:oklab(from var(--vui-annotate-color) l a b/30%);box-shadow:-.3em 0 0 0 oklab(from var(--vui-annotate-color) l a b/30%),.3em 0 0 0 oklab(from var(--vui-annotate-color) l a b/30%)}&[data-side=top]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M23 4c-1 9-1 20 0 31'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m17 29 6 7 6-7'/%3E%3C/svg%3E");left:calc(50% - 23px + var(--vui-annotate-arrow-x));top:calc(-1 * var(--vui-annotate-target-gap) - 35px + var(--vui-annotate-arrow-y))}&[data-side=top]:after{left:calc(50% + var(--vui-annotate-text-x));bottom:calc(100% + var(--vui-annotate-target-gap) + 31px + var(--vui-annotate-label-gap) - var(--vui-annotate-text-y));transform:translateX(-50%) rotate(var(--vui-annotate-rotate))}&[data-side=top-start]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M6 6c10 2 22 14 34 26'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m36 22 4 10-10-4'/%3E%3C/svg%3E");left:calc(50% - 40px + var(--vui-annotate-arrow-x));top:calc(-1 * var(--vui-annotate-target-gap) - 32px + var(--vui-annotate-arrow-y));transform:translateX(-10%)}&[data-side=top-start]:after{left:calc(50% - 34px + var(--vui-annotate-text-x));bottom:calc(100% + var(--vui-annotate-target-gap) + 26px + var(--vui-annotate-label-gap) - var(--vui-annotate-text-y));transform:translateX(-60%) rotate(var(--vui-annotate-rotate))}&[data-side=start]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M4 19c11-1 27-1 39 0'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m36 13 7 6-7 6'/%3E%3C/svg%3E");left:calc(-1 * var(--vui-annotate-target-gap) - 43px + var(--vui-annotate-arrow-x));top:calc(50% - 19px + var(--vui-annotate-arrow-y))}&[data-side=start]:after{right:calc(100% + var(--vui-annotate-target-gap) + 39px + var(--vui-annotate-label-gap) - var(--vui-annotate-text-x));top:calc(50% - 5px + var(--vui-annotate-text-y));transform:translateY(-50%) rotate(var(--vui-annotate-rotate))}&[data-side=bottom-start]:before{left:calc(50% - 40px + var(--vui-annotate-arrow-x));--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M6 32c10-2 22-14 34-26'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m30 10 10-4-4 10'/%3E%3C/svg%3E");top:calc(100% + var(--vui-annotate-target-gap) - 6px + var(--vui-annotate-arrow-y));transform:translateX(-10%)}&[data-side=bottom-start]:after{left:calc(50% - 34px + var(--vui-annotate-text-x));top:calc(100% + var(--vui-annotate-target-gap) + 26px + var(--vui-annotate-label-gap) + var(--vui-annotate-text-y));transform:translateX(-60%) rotate(var(--vui-annotate-rotate))}&[data-side=bottom]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M23 35c-1-9-1-20 0-31'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m17 10 6-7 6 7'/%3E%3C/svg%3E");left:calc(50% - 23px + var(--vui-annotate-arrow-x));top:calc(100% + var(--vui-annotate-target-gap) - 4px + var(--vui-annotate-arrow-y))}&[data-side=bottom]:after{left:calc(50% + var(--vui-annotate-text-x));top:calc(100% + var(--vui-annotate-target-gap) + 31px + var(--vui-annotate-label-gap) + var(--vui-annotate-text-y));transform:translateX(-50%) rotate(var(--vui-annotate-rotate))}&[data-side=bottom-end]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M40 32C30 30 18 18 6 6'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16 10 6 6l4 10'/%3E%3C/svg%3E");left:calc(50% - 6px + var(--vui-annotate-arrow-x));top:calc(100% + var(--vui-annotate-target-gap) - 6px + var(--vui-annotate-arrow-y));transform:translateX(10%)}&[data-side=bottom-end]:after{left:calc(50% + 34px + var(--vui-annotate-text-x));top:calc(100% + var(--vui-annotate-target-gap) + 26px + var(--vui-annotate-label-gap) + var(--vui-annotate-text-y));transform:translateX(-40%) rotate(var(--vui-annotate-rotate))}&[data-side=end]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M43 19c-11-1-28-1-40 0'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m10 13-7 6 7 6'/%3E%3C/svg%3E");left:calc(100% + var(--vui-annotate-target-gap) - 3px + var(--vui-annotate-arrow-x));top:calc(50% - 19px + var(--vui-annotate-arrow-y))}&[data-side=end]:after{left:calc(100% + var(--vui-annotate-target-gap) + 40px + var(--vui-annotate-label-gap) + var(--vui-annotate-text-x));top:calc(50% - 5px + var(--vui-annotate-text-y));transform:translateY(-50%) rotate(var(--vui-annotate-rotate))}&[data-side=top-end]:before{--_annotate-arrow-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='38' viewBox='0 0 46 38'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-width='1.5' d='M40 6C30 8 18 20 6 32'/%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M10 22 6 32l10-4'/%3E%3C/svg%3E");left:calc(50% - 6px + var(--vui-annotate-arrow-x));top:calc(-1 * var(--vui-annotate-target-gap) - 32px + var(--vui-annotate-arrow-y));transform:translateX(10%)}&[data-side=top-end]:after{left:calc(50% + 34px + var(--vui-annotate-text-x));bottom:calc(100% + var(--vui-annotate-target-gap) + 26px + var(--vui-annotate-label-gap) - var(--vui-annotate-text-y));transform:translateX(-40%) rotate(var(--vui-annotate-rotate))}}}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
export type AnnotateSide = 'top-start' | 'top' | 'top-end' | 'end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'start';
|
|
4
|
+
/**
|
|
5
|
+
* Public Annotate props.
|
|
6
|
+
*
|
|
7
|
+
* Includes standard `span` attributes such as `children`, `id`, `className`, and event handlers,
|
|
8
|
+
* plus Vira-owned decorative annotation controls.
|
|
9
|
+
*
|
|
10
|
+
* @default Native span pass-through props keep React defaults.
|
|
11
|
+
*/
|
|
12
|
+
export type AnnotateProps = React.ComponentPropsWithRef<'span'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Decorative label rendered via `::after` from `attr(data-note)`.
|
|
15
|
+
*
|
|
16
|
+
* Do not put critical information here — assistive tech does not announce the pseudo label.
|
|
17
|
+
*
|
|
18
|
+
* @default No note; arrow and label pseudos stay hidden.
|
|
19
|
+
*/
|
|
20
|
+
note?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Places the decorative arrow and label relative to the wrapped content.
|
|
23
|
+
*
|
|
24
|
+
* @default 'top'
|
|
25
|
+
*/
|
|
26
|
+
side?: AnnotateSide;
|
|
27
|
+
/**
|
|
28
|
+
* Highlight token driving arrow, label, and optional mark color via `--vui-annotate-color`.
|
|
29
|
+
*
|
|
30
|
+
* @default 'yellow'
|
|
31
|
+
*/
|
|
32
|
+
color?: ThemeTypes['highlight'];
|
|
33
|
+
/**
|
|
34
|
+
* When true, applies a highlighter mark behind the wrapped content.
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
mark?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Horizontal offset for the arrow pseudo (`--vui-annotate-arrow-x`).
|
|
41
|
+
*
|
|
42
|
+
* @default `0px`
|
|
43
|
+
*/
|
|
44
|
+
arrowOffsetX?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Vertical offset for the arrow pseudo (`--vui-annotate-arrow-y`).
|
|
47
|
+
*
|
|
48
|
+
* @default `0px`
|
|
49
|
+
*/
|
|
50
|
+
arrowOffsetY?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Horizontal offset for the label pseudo (`--vui-annotate-text-x`).
|
|
53
|
+
*
|
|
54
|
+
* @default `0px`
|
|
55
|
+
*/
|
|
56
|
+
textOffsetX?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Vertical offset for the label pseudo (`--vui-annotate-text-y`).
|
|
59
|
+
*
|
|
60
|
+
* @default `0px`
|
|
61
|
+
*/
|
|
62
|
+
textOffsetY?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Rotation for the label (and composed transforms) via `--vui-annotate-rotate`.
|
|
65
|
+
*
|
|
66
|
+
* @default `-4deg`
|
|
67
|
+
*/
|
|
68
|
+
rotate?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Gap between the target and the arrow via `--vui-annotate-target-gap`.
|
|
71
|
+
*
|
|
72
|
+
* @default `var(--space-small)`
|
|
73
|
+
*/
|
|
74
|
+
targetGap?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Gap between arrow and label on all sides via `--vui-annotate-label-gap`.
|
|
77
|
+
*
|
|
78
|
+
* @default `var(--space-x-small)`
|
|
79
|
+
*/
|
|
80
|
+
labelGap?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Max width for the label pseudo via `--vui-annotate-label-max-width`.
|
|
83
|
+
*
|
|
84
|
+
* @default `300px`
|
|
85
|
+
*/
|
|
86
|
+
labelMaxWidth?: string;
|
|
87
|
+
};
|
|
88
|
+
export declare const Annotate: React.FC<AnnotateProps>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Annotate",
|
|
3
|
+
"summary": "Decorative CSS-only arrow and handwritten label that wraps inline content with optional highlighter mark.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Call out a word or phrase in marketing, docs, or onboarding copy",
|
|
6
|
+
"Add a playful visual annotation without extra DOM nodes",
|
|
7
|
+
"Highlight a target with an optional mark while keeping children as the real content"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Conveying critical instructions, status, or validation that assistive tech must announce",
|
|
11
|
+
"Interactive tooltips or popovers that need focus and keyboard behavior",
|
|
12
|
+
"Layouts that clip overflow and cannot leave room for the arrow and label"
|
|
13
|
+
],
|
|
14
|
+
"accessibility": [
|
|
15
|
+
"Arrow and label are CSS pseudos — decorative only and not exposed to assistive tech",
|
|
16
|
+
"Do not put critical information in note; keep real meaning in children or aria-describedby content",
|
|
17
|
+
"Children retain native semantics; Annotate itself is a presentational span wrap"
|
|
18
|
+
],
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Using note as the only source of instructions or status",
|
|
21
|
+
"Nesting Annotate inside overflow-hidden parents without padding for the arrow",
|
|
22
|
+
"Expecting the label to participate in hit-testing or selection"
|
|
23
|
+
],
|
|
24
|
+
"related": ["Text", "Title", "Tooltip", "Chip"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"react": {
|
|
27
|
+
"color": {
|
|
28
|
+
"description": "Highlight token driving arrow, label, and optional mark color via --vui-annotate-color.",
|
|
29
|
+
"refCss": "color"
|
|
30
|
+
},
|
|
31
|
+
"arrowOffsetX": {
|
|
32
|
+
"description": "Horizontal offset for the arrow pseudo.",
|
|
33
|
+
"refCss": "arrow-x"
|
|
34
|
+
},
|
|
35
|
+
"arrowOffsetY": {
|
|
36
|
+
"description": "Vertical offset for the arrow pseudo.",
|
|
37
|
+
"refCss": "arrow-y"
|
|
38
|
+
},
|
|
39
|
+
"textOffsetX": {
|
|
40
|
+
"description": "Horizontal offset for the label pseudo.",
|
|
41
|
+
"refCss": "text-x"
|
|
42
|
+
},
|
|
43
|
+
"textOffsetY": {
|
|
44
|
+
"description": "Vertical offset for the label pseudo.",
|
|
45
|
+
"refCss": "text-y"
|
|
46
|
+
},
|
|
47
|
+
"rotate": {
|
|
48
|
+
"description": "Rotation for the label via --vui-annotate-rotate.",
|
|
49
|
+
"refCss": "rotate"
|
|
50
|
+
},
|
|
51
|
+
"targetGap": {
|
|
52
|
+
"description": "Gap between the target and the arrow.",
|
|
53
|
+
"refCss": "target-gap"
|
|
54
|
+
},
|
|
55
|
+
"labelGap": {
|
|
56
|
+
"description": "Gap between arrow and label on all sides.",
|
|
57
|
+
"refCss": "label-gap"
|
|
58
|
+
},
|
|
59
|
+
"labelMaxWidth": {
|
|
60
|
+
"description": "Max width for the label pseudo.",
|
|
61
|
+
"refCss": "label-max-width"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"css": {
|
|
65
|
+
"color": {
|
|
66
|
+
"description": "Arrow, label, and mark accent color.",
|
|
67
|
+
"refReact": "color"
|
|
68
|
+
},
|
|
69
|
+
"arrow-x": {
|
|
70
|
+
"description": "Horizontal arrow offset.",
|
|
71
|
+
"refReact": "arrowOffsetX"
|
|
72
|
+
},
|
|
73
|
+
"arrow-y": {
|
|
74
|
+
"description": "Vertical arrow offset.",
|
|
75
|
+
"refReact": "arrowOffsetY"
|
|
76
|
+
},
|
|
77
|
+
"text-x": {
|
|
78
|
+
"description": "Horizontal label offset.",
|
|
79
|
+
"refReact": "textOffsetX"
|
|
80
|
+
},
|
|
81
|
+
"text-y": {
|
|
82
|
+
"description": "Vertical label offset.",
|
|
83
|
+
"refReact": "textOffsetY"
|
|
84
|
+
},
|
|
85
|
+
"rotate": {
|
|
86
|
+
"description": "Label rotation angle.",
|
|
87
|
+
"refReact": "rotate"
|
|
88
|
+
},
|
|
89
|
+
"target-gap": {
|
|
90
|
+
"description": "Gap between the target and the arrow.",
|
|
91
|
+
"refReact": "targetGap"
|
|
92
|
+
},
|
|
93
|
+
"label-gap": {
|
|
94
|
+
"description": "Gap between arrow and label on all sides.",
|
|
95
|
+
"refReact": "labelGap"
|
|
96
|
+
},
|
|
97
|
+
"label-max-width": {
|
|
98
|
+
"description": "Max width for the label pseudo.",
|
|
99
|
+
"refReact": "labelMaxWidth"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './annotate.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import annotate_module_default from "./annotate.module.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/annotate/annotate.tsx
|
|
6
|
+
var Annotate = ({ arrowOffsetX, arrowOffsetY, children, className, color = "yellow", labelGap, labelMaxWidth = "300px", mark = false, note, ref, rotate, side = "top", style, targetGap, textOffsetX, textOffsetY, ...otherProps }) => {
|
|
7
|
+
const dynamicStyle = {
|
|
8
|
+
...color && { "--vui-annotate-color": `var(--highlight-${color})` },
|
|
9
|
+
...arrowOffsetX && { "--vui-annotate-arrow-x": arrowOffsetX },
|
|
10
|
+
...arrowOffsetY && { "--vui-annotate-arrow-y": arrowOffsetY },
|
|
11
|
+
...textOffsetX && { "--vui-annotate-text-x": textOffsetX },
|
|
12
|
+
...textOffsetY && { "--vui-annotate-text-y": textOffsetY },
|
|
13
|
+
...rotate && { "--vui-annotate-rotate": rotate },
|
|
14
|
+
...targetGap && { "--vui-annotate-target-gap": targetGap },
|
|
15
|
+
...labelGap && { "--vui-annotate-label-gap": labelGap },
|
|
16
|
+
...labelMaxWidth && { "--vui-annotate-label-max-width": labelMaxWidth },
|
|
17
|
+
...style
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ jsx("span", {
|
|
20
|
+
...otherProps,
|
|
21
|
+
ref,
|
|
22
|
+
className: clsx(annotate_module_default.Annotate, className),
|
|
23
|
+
"data-mark": mark ? "true" : void 0,
|
|
24
|
+
"data-note": note,
|
|
25
|
+
"data-side": side,
|
|
26
|
+
style: dynamicStyle,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Annotate };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
1
|
import type * as React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Public Avatar props.
|
|
@@ -8,7 +7,7 @@ import type * as React from 'react';
|
|
|
8
7
|
*
|
|
9
8
|
* @default Native span pass-through props keep React defaults.
|
|
10
9
|
*/
|
|
11
|
-
export type AvatarProps = React.ComponentPropsWithRef<'span'> &
|
|
10
|
+
export type AvatarProps = React.ComponentPropsWithRef<'span'> & {
|
|
12
11
|
/**
|
|
13
12
|
* Supplies the avatar image source URL.
|
|
14
13
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './avatar.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import avatar_module_default from "./avatar.module.js";
|
|
5
4
|
import { Text } from "../text/text.js";
|
|
6
5
|
import { Skeleton } from "../skeleton/skeleton.js";
|
|
@@ -14,19 +13,17 @@ var fallbackTextSizeByAvatarSize = {
|
|
|
14
13
|
big: "large"
|
|
15
14
|
};
|
|
16
15
|
var Avatar$1 = ({ alt = "", className, fallback, loading = false, ref, size = "small", src, ...otherProps }) => {
|
|
17
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
18
16
|
const hasImage = Boolean(src);
|
|
19
17
|
return /* @__PURE__ */ jsx(Avatar.Root, {
|
|
20
|
-
...
|
|
21
|
-
...intrinsicAttributes,
|
|
18
|
+
...otherProps,
|
|
22
19
|
ref,
|
|
23
20
|
"aria-busy": loading || void 0,
|
|
24
21
|
className: clsx(avatar_module_default.Avatar, className),
|
|
25
22
|
"data-has-image": hasImage ? "true" : "false",
|
|
26
23
|
"data-loading": loading ? "true" : "false",
|
|
27
24
|
"data-size": size,
|
|
28
|
-
"data-grow": false,
|
|
29
|
-
"data-shrink": false,
|
|
25
|
+
"data-grow": "false",
|
|
26
|
+
"data-shrink": "false",
|
|
30
27
|
children: loading ? /* @__PURE__ */ jsx(Skeleton, {
|
|
31
28
|
className: avatar_module_default.AvatarSkeleton,
|
|
32
29
|
minHeight: "100%",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AvatarProps } from '..';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
type AvatarGroupAvatarProps = Omit<AvatarProps, 'size' | 'ref'>;
|
|
5
4
|
/**
|
|
@@ -10,7 +9,7 @@ type AvatarGroupAvatarProps = Omit<AvatarProps, 'size' | 'ref'>;
|
|
|
10
9
|
*
|
|
11
10
|
* @default Native div pass-through props keep React defaults.
|
|
12
11
|
*/
|
|
13
|
-
export type AvatarGroupProps = React.ComponentPropsWithRef<'div'> &
|
|
12
|
+
export type AvatarGroupProps = React.ComponentPropsWithRef<'div'> & {
|
|
14
13
|
/**
|
|
15
14
|
* Supplies the avatar payloads rendered by the group in DOM order.
|
|
16
15
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './avatar-group.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { Avatar } from "../avatar/avatar.js";
|
|
5
4
|
import avatar_group_module_default from "./avatar-group.module.js";
|
|
6
5
|
import { Text } from "../text/text.js";
|
|
@@ -10,13 +9,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
9
|
//#region src/components/avatar-group/avatar-group.tsx
|
|
11
10
|
var getAvatarKey = (avatar, index) => `${avatar.src ?? "fallback"}-${typeof avatar.fallback === "string" ? avatar.fallback : "node"}-${index}`;
|
|
12
11
|
var AvatarGroup = ({ avatars, className, direction = "horizontal", maxVisible, overflowText, ref, size = "small", style, ...otherProps }) => {
|
|
13
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
14
12
|
const isOverflowing = typeof maxVisible === "number" && maxVisible > 0 && avatars.length > maxVisible;
|
|
15
13
|
const hasOverflow = isOverflowing && overflowText !== void 0 && overflowText !== null;
|
|
16
14
|
const truncatedAvatars = isOverflowing ? avatars.slice(0, maxVisible) : avatars;
|
|
17
15
|
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
-
...
|
|
19
|
-
...intrinsicAttributes,
|
|
16
|
+
...otherProps,
|
|
20
17
|
ref,
|
|
21
18
|
className: clsx(avatar_group_module_default.AvatarGroup, className),
|
|
22
19
|
"data-direction": direction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-basic-input-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-basic-input-border-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-basic-input-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-basic-input-font-size{syntax:"<length>";inherits:false;initial-value:1rem}@property --vui-basic-input-padding-inline{syntax:"<length>";inherits:false;initial-value:0}@property --vui-basic-input-placeholder-color{syntax:"<color>";inherits:false;initial-value:#0000}.viraui__basic-input-module__BasicInput_5uE64{--vui-basic-input-background:var(--base-1);--vui-basic-input-color:var(--global-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);--vui-basic-input-padding-inline:var(--space-small);--vui-basic-input-font-size:var(--font-scale-body-small);--vui-basic-input-border-radius:var(--radius-medium);box-sizing:border-box;margin:0;inline-size:100%;min-inline-size:0;padding-inline:var(--vui-basic-input-padding-inline);font-family:inherit;font-size:var(--vui-basic-input-font-size);font-variation-settings:"wght" 400;color:var(--vui-basic-input-color);background:var(--vui-basic-input-background);border:none;border-radius:var(--vui-basic-input-border-radius);appearance:none;&::-webkit-contacts-auto-fill-button{background-color:var(--vui-basic-input-color)}&::placeholder{color:var(--vui-basic-input-placeholder-color)}&:disabled{--vui-basic-input-background:var(--global-disabled-background);--vui-basic-input-color:var(--global-disabled-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);cursor:not-allowed}&[data-invalid]{outline-color:oklab(from var(--highlight-red) l a b/.3)}}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-basic-input-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-basic-input-border-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-basic-input-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-basic-input-font-size{syntax:"<length>";inherits:false;initial-value:1rem}@property --vui-basic-input-padding-inline{syntax:"<length>";inherits:false;initial-value:0}@property --vui-basic-input-placeholder-color{syntax:"<color>";inherits:false;initial-value:#0000}.viraui__basic-input-module__BasicInput_5uE64{--vui-basic-input-background:var(--base-1);--vui-basic-input-color:var(--global-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);--vui-basic-input-padding-inline:var(--space-small);--vui-basic-input-font-size:var(--font-scale-body-small);--vui-basic-input-border-radius:var(--radius-medium);box-sizing:border-box;margin:0;inline-size:100%;min-inline-size:0;padding-inline:var(--vui-basic-input-padding-inline);font-family:inherit;font-size:var(--vui-basic-input-font-size);font-variation-settings:"wght" 400;color:var(--vui-basic-input-color);background:var(--vui-basic-input-background);border:none;border-radius:var(--vui-basic-input-border-radius);appearance:none;&::-webkit-contacts-auto-fill-button{background-color:var(--vui-basic-input-color)}&::placeholder{color:var(--vui-basic-input-placeholder-color)}&:disabled{--vui-basic-input-background:var(--global-disabled-background);--vui-basic-input-color:var(--global-disabled-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);cursor:not-allowed}&[data-invalid]{outline-color:oklab(from var(--highlight-red) l a b/.3)}&[data-sizing=content]{field-sizing:content}}}
|
|
@@ -9,5 +9,12 @@ import * as React from 'react';
|
|
|
9
9
|
*/
|
|
10
10
|
export type BasicInputProps = Omit<Field.Control.Props, 'ref'> & {
|
|
11
11
|
ref?: React.Ref<HTMLElement> | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* When `true`, sets `field-sizing: content` on the control via `data-sizing="content"`.
|
|
14
|
+
* Omitted / `false` keeps the browser `field-sizing: fixed` default.
|
|
15
|
+
*
|
|
16
|
+
* @default undefined (browser fixed)
|
|
17
|
+
*/
|
|
18
|
+
fitContent?: boolean;
|
|
12
19
|
};
|
|
13
20
|
export declare const BasicInput: React.ForwardRefExoticComponent<Omit<BasicInputProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -9,17 +9,20 @@ import { Input } from "@base-ui/react/input";
|
|
|
9
9
|
function usesInputPrimitiveRender(render) {
|
|
10
10
|
return React.isValidElement(render) && render.type === Input;
|
|
11
11
|
}
|
|
12
|
-
var BasicInput = React.forwardRef(function BasicInput({ className, render, ...otherProps }, ref) {
|
|
12
|
+
var BasicInput = React.forwardRef(function BasicInput({ className, render, fitContent, ...otherProps }, ref) {
|
|
13
13
|
const mergedClassName = clsx(basic_input_module_default.BasicInput, className);
|
|
14
|
+
const sizingProps = { ...fitContent && { "data-sizing": "content" } };
|
|
14
15
|
if (usesInputPrimitiveRender(render)) return /* @__PURE__ */ jsx(Input, {
|
|
15
16
|
ref,
|
|
16
17
|
className: mergedClassName,
|
|
18
|
+
...sizingProps,
|
|
17
19
|
...otherProps
|
|
18
20
|
});
|
|
19
21
|
return /* @__PURE__ */ jsx(Field.Control, {
|
|
20
22
|
ref,
|
|
21
23
|
className: mergedClassName,
|
|
22
24
|
render,
|
|
25
|
+
...sizingProps,
|
|
23
26
|
...otherProps
|
|
24
27
|
});
|
|
25
28
|
});
|
|
@@ -18,7 +18,7 @@ var InputControlGroup = ({ addonClassName, children, controlGroupClassName, endA
|
|
|
18
18
|
hAlign: "center",
|
|
19
19
|
hPadding: ["small", "x-small"],
|
|
20
20
|
inline: true,
|
|
21
|
-
shrink: false,
|
|
21
|
+
"data-shrink": "false",
|
|
22
22
|
vAlign: "center",
|
|
23
23
|
children: startAddon
|
|
24
24
|
}),
|
|
@@ -30,7 +30,7 @@ var InputControlGroup = ({ addonClassName, children, controlGroupClassName, endA
|
|
|
30
30
|
hAlign: "center",
|
|
31
31
|
hPadding: "x-small",
|
|
32
32
|
inline: true,
|
|
33
|
-
shrink: false,
|
|
33
|
+
"data-shrink": "false",
|
|
34
34
|
vAlign: "center",
|
|
35
35
|
children: endAddon
|
|
36
36
|
})
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
1
|
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
@@ -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 BleedProps = React.ComponentPropsWithRef<'div'> &
|
|
11
|
+
export type BleedProps = React.ComponentPropsWithRef<'div'> & {
|
|
13
12
|
/**
|
|
14
13
|
* Sets the inline bleed amount using a Vira space token.
|
|
15
14
|
*
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import './bleed.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import bleed_module_default from "./bleed.module.js";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/bleed/bleed.tsx
|
|
7
6
|
var Bleed = ({ amount, children, className, full = false, ref, style, ...otherProps }) => {
|
|
8
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
9
7
|
const dynamicStyle = {
|
|
10
8
|
...amount && !full && { "--vui-bleed-amount": `var(--space-${amount})` },
|
|
11
9
|
...style
|
|
12
10
|
};
|
|
13
11
|
return /* @__PURE__ */ jsx("div", {
|
|
14
|
-
...
|
|
15
|
-
...intrinsicAttributes,
|
|
12
|
+
...otherProps,
|
|
16
13
|
ref,
|
|
17
14
|
className: clsx(bleed_module_default.Bleed, className),
|
|
18
15
|
"data-bleed-full": full ? "true" : void 0,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { ButtonAddonPosition, ButtonSize, ButtonVariant } from './button-chrome';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
/**
|
|
@@ -11,7 +10,7 @@ import * as React from 'react';
|
|
|
11
10
|
*
|
|
12
11
|
* @default Renders an `a` root; pass `render` for framework Link composition.
|
|
13
12
|
*/
|
|
14
|
-
export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type'> &
|
|
13
|
+
export type ButtonLinkProps = Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {
|
|
15
14
|
/**
|
|
16
15
|
* Replaces the default `a` root using Base UI render semantics (e.g. Next.js `Link`).
|
|
17
16
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
2
1
|
import { ButtonChromeChildren, getButtonChromeRootAttrs } from "./button-chrome.js";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -7,14 +6,12 @@ import "react";
|
|
|
7
6
|
var ButtonLink = ({ children, className, disabled = false, addon, addonPosition = "start", loading = false, pill = false, size = "medium", variant = "primary", render, ref, onClick, ...otherProps }) => {
|
|
8
7
|
const isDisabled = disabled || loading;
|
|
9
8
|
const isIconOnly = Boolean(addon) && (children == null || children === "");
|
|
10
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
11
9
|
return useRender({
|
|
12
10
|
defaultTagName: "a",
|
|
13
11
|
render,
|
|
14
12
|
ref,
|
|
15
13
|
props: {
|
|
16
|
-
...
|
|
17
|
-
...intrinsicAttributes,
|
|
14
|
+
...otherProps,
|
|
18
15
|
...getButtonChromeRootAttrs({
|
|
19
16
|
addon,
|
|
20
17
|
addonPosition,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Button as PrimitiveButton } from '@base-ui/react/button';
|
|
2
2
|
import { ButtonAddonPosition, ButtonSize, ButtonVariant } from './button-chrome';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
/**
|
|
@@ -11,7 +10,7 @@ import * as React from 'react';
|
|
|
11
10
|
*
|
|
12
11
|
* @default Base UI pass-through props keep upstream defaults.
|
|
13
12
|
*/
|
|
14
|
-
export type ButtonProps = PrimitiveButton.Props &
|
|
13
|
+
export type ButtonProps = PrimitiveButton.Props & {
|
|
15
14
|
/**
|
|
16
15
|
* Controls the visual button size.
|
|
17
16
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './button.css';
|
|
2
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
3
2
|
import { ButtonChromeChildren, getButtonChromeRootAttrs } from "./button-chrome.js";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { Button } from "@base-ui/react/button";
|
|
@@ -29,7 +28,7 @@ var ButtonRenderRoot = ({ isDisabled, ref, render, rootProps }) => {
|
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
var ButtonRoot = ({ children, className,
|
|
31
|
+
var ButtonRoot = ({ children, className, isDisabled, isIconOnly, addon, addonPosition, loading, passThroughProps, pill, ref, render, size, variant }) => {
|
|
33
32
|
const chromeAttrs = getButtonChromeRootAttrs({
|
|
34
33
|
addon,
|
|
35
34
|
addonPosition,
|
|
@@ -42,7 +41,6 @@ var ButtonRoot = ({ children, className, intrinsicAttributes, isDisabled, isIcon
|
|
|
42
41
|
});
|
|
43
42
|
const rootProps = {
|
|
44
43
|
...passThroughProps,
|
|
45
|
-
...intrinsicAttributes,
|
|
46
44
|
...chromeAttrs,
|
|
47
45
|
className: typeof className === "function" ? className : chromeAttrs.className,
|
|
48
46
|
children
|
|
@@ -64,11 +62,9 @@ var ButtonRoot = ({ children, className, intrinsicAttributes, isDisabled, isIcon
|
|
|
64
62
|
var Button$1 = ({ children, className, disabled, addon, addonPosition = "start", loading = false, pill = false, size = "medium", variant = "primary", ...otherProps }) => {
|
|
65
63
|
const isDisabled = disabled || loading;
|
|
66
64
|
const isIconOnly = Boolean(addon) && (children == null || children === "");
|
|
67
|
-
const {
|
|
68
|
-
const { render, ref, ...passThroughProps } = componentProps;
|
|
65
|
+
const { render, ref, ...passThroughProps } = otherProps;
|
|
69
66
|
return /* @__PURE__ */ jsx(ButtonRoot, {
|
|
70
67
|
className,
|
|
71
|
-
intrinsicAttributes,
|
|
72
68
|
isDisabled,
|
|
73
69
|
isIconOnly,
|
|
74
70
|
addon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-checkbox-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-checkbox-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-checkbox-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}.viraui__checkbox-module__Checkbox_3oGip{&:has([required]) .viraui__checkbox-module__Label_n9HL7:after{content:" *";color:var(--highlight-red)}}.viraui__checkbox-module__CheckboxRoot_PeyF5{--vui-checkbox-size:var(--space-medium);--vui-checkbox-radius:var(--radius-x-small);--vui-checkbox-background:var(--global-contrast);--vui-checkbox-indicator-color:contrast-color(var(--global-primary));position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--vui-checkbox-border-color);inline-size:var(--vui-checkbox-size);block-size:var(--vui-checkbox-size);background:var(--vui-checkbox-background);border-radius:var(--vui-checkbox-radius);&[data-size=regular]{--vui-checkbox-size:var(--space-large);--vui-checkbox-radius:var(--radius-small)}&[data-checked]:not([data-disabled]):not([data-invalid])
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-checkbox-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-checkbox-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-checkbox-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}.viraui__checkbox-module__Checkbox_3oGip{&:has([required]) .viraui__checkbox-module__Label_n9HL7:after{content:" *";color:var(--highlight-red)}}.viraui__checkbox-module__CheckboxRoot_PeyF5{--vui-checkbox-size:var(--space-medium);--vui-checkbox-radius:var(--radius-x-small);--vui-checkbox-background:var(--global-contrast);--vui-checkbox-indicator-color:contrast-color(var(--global-primary));position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--vui-checkbox-border-color);inline-size:var(--vui-checkbox-size);block-size:var(--vui-checkbox-size);background:var(--vui-checkbox-background);border-radius:var(--vui-checkbox-radius);&[data-size=regular]{--vui-checkbox-size:var(--space-large);--vui-checkbox-radius:var(--radius-small)}&[data-checked]:not([data-disabled]):not([data-invalid]){--vui-checkbox-background:var(--global-primary);--vui-checkbox-border-color:var(--global-primary);box-shadow:none}&[data-indeterminate]:not([data-disabled]):not([data-invalid]){--vui-checkbox-indicator-color:var(--global-primary)}&[data-invalid]:not([data-disabled]),[data-invalid] &:not([data-disabled]){--vui-checkbox-border-color:var(--highlight-red);--vui-checkbox-indicator-color:var(--global-primary);box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],[data-disabled] &{--vui-checkbox-background:var(--global-disabled-background);--vui-checkbox-border-color:#0000;--vui-checkbox-indicator-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__checkbox-module__Indicator_C-k-l{display:inline-flex;align-items:center;justify-content:center;color:var(--vui-checkbox-indicator-color)}.viraui__checkbox-module__Icon_926Sa{stroke:currentColor}.viraui__checkbox-module__CheckboxRoot_PeyF5:not([data-indeterminate]) .viraui__checkbox-module__MinusIcon_Q57pY,.viraui__checkbox-module__CheckboxRoot_PeyF5[data-indeterminate] .viraui__checkbox-module__CheckIcon_XqUcs{display:none}.viraui__checkbox-module__CheckboxRoot_PeyF5[data-indeterminate] .viraui__checkbox-module__MinusIcon_Q57pY{display:inline-flex}}
|
|
@@ -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 { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
5
4
|
import * as React from 'react';
|
|
@@ -11,7 +10,7 @@ import * as React from 'react';
|
|
|
11
10
|
*
|
|
12
11
|
* @default Base UI pass-through props keep upstream defaults.
|
|
13
12
|
*/
|
|
14
|
-
export type ChipProps = React.ComponentPropsWithRef<'div'> &
|
|
13
|
+
export type ChipProps = React.ComponentPropsWithRef<'div'> & {
|
|
15
14
|
/**
|
|
16
15
|
* Replaces the default `div` root using Base UI render semantics.
|
|
17
16
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './chip.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { Stack } from "../stack/stack.js";
|
|
5
4
|
import chip_module_default from "./chip.module.js";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -8,7 +7,6 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
8
7
|
import "react";
|
|
9
8
|
//#region src/components/chip/chip.tsx
|
|
10
9
|
var Chip = ({ addon, addonPosition = "start", children, className, ref, render, variant = "primary", ...otherProps }) => {
|
|
11
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
12
10
|
const content = /* @__PURE__ */ jsxs(Stack, {
|
|
13
11
|
inline: true,
|
|
14
12
|
direction: addonPosition === "start" ? "row" : "row-reverse",
|
|
@@ -31,10 +29,9 @@ var Chip = ({ addon, addonPosition = "start", children, className, ref, render,
|
|
|
31
29
|
render,
|
|
32
30
|
ref,
|
|
33
31
|
props: {
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
"data-
|
|
37
|
-
"data-shrink": false,
|
|
32
|
+
...otherProps,
|
|
33
|
+
"data-grow": "false",
|
|
34
|
+
"data-shrink": "false",
|
|
38
35
|
children: content,
|
|
39
36
|
className: clsx(chip_module_default.Chip, className),
|
|
40
37
|
"data-has-icon": addon ? "true" : void 0,
|
|
@@ -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 ClampText props.
|
|
@@ -9,7 +8,7 @@ import type * as React from 'react';
|
|
|
9
8
|
*
|
|
10
9
|
* @default Native span pass-through props keep React defaults.
|
|
11
10
|
*/
|
|
12
|
-
export type ClampTextProps = React.ComponentPropsWithoutRef<'span'> &
|
|
11
|
+
export type ClampTextProps = React.ComponentPropsWithoutRef<'span'> & {
|
|
13
12
|
/**
|
|
14
13
|
* Replaces the default `span` root using Base UI render semantics.
|
|
15
14
|
*
|