@viraui/react 1.0.10 → 1.0.12
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/accordion/accordion.guide.json +1 -0
- package/dist/components/annotate/annotate.css +1 -0
- package/dist/components/annotate/annotate.d.ts +101 -0
- package/dist/components/annotate/annotate.guide.json +121 -0
- package/dist/components/annotate/annotate.js +39 -0
- package/dist/components/annotate/annotate.module.js +11 -0
- package/dist/components/annotate/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.guide.json +1 -0
- 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.guide.json +1 -0
- 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.guide.json +1 -0
- package/dist/components/bleed/bleed.js +1 -4
- package/dist/components/button/button-link.d.ts +1 -2
- package/dist/components/button/button-link.guide.json +1 -0
- package/dist/components/button/button-link.js +1 -4
- package/dist/components/button/button.d.ts +1 -2
- package/dist/components/button/button.guide.json +1 -0
- package/dist/components/button/button.js +2 -6
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/checkbox/checkbox.guide.json +1 -0
- package/dist/components/chip/chip.d.ts +1 -2
- package/dist/components/chip/chip.guide.json +1 -0
- 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.guide.json +1 -0
- package/dist/components/clamp-text/clamp-text.js +1 -4
- package/dist/components/dialog/dialog-sheet.js +2 -2
- package/dist/components/dialog/dialog.guide.json +1 -0
- package/dist/components/elevator/elevator.d.ts +1 -2
- package/dist/components/elevator/elevator.guide.json +1 -0
- package/dist/components/elevator/elevator.js +1 -4
- package/dist/components/fieldset/fieldset.d.ts +1 -2
- package/dist/components/fieldset/fieldset.guide.json +1 -0
- 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 +40 -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/icon-button/icon-button-link.guide.json +1 -0
- package/dist/components/icon-button/icon-button.guide.json +1 -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.guide.json +1 -0
- 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 +2 -1
- package/dist/components/masonry/masonry.js +9 -18
- package/dist/components/meter/meter.d.ts +0 -13
- package/dist/components/meter/meter.guide.json +1 -0
- package/dist/components/meter/meter.js +40 -45
- package/dist/components/popover/popover-sheet.js +2 -2
- package/dist/components/popover/popover.guide.json +1 -0
- package/dist/components/progressive-blur/progressive-blur.d.ts +1 -2
- package/dist/components/progressive-blur/progressive-blur.guide.json +1 -0
- package/dist/components/progressive-blur/progressive-blur.js +1 -4
- package/dist/components/progressive-blur/progressive-blur.utils.js +4 -7
- package/dist/components/radio/radio.guide.json +1 -0
- 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.guide.json +1 -0
- package/dist/components/select/select.js +3 -6
- package/dist/components/separator/separator.d.ts +1 -2
- package/dist/components/separator/separator.guide.json +1 -0
- package/dist/components/separator/separator.js +1 -4
- package/dist/components/shimmer/shimmer.d.ts +1 -2
- package/dist/components/shimmer/shimmer.guide.json +1 -0
- package/dist/components/shimmer/shimmer.js +1 -4
- package/dist/components/skeleton/skeleton.d.ts +1 -2
- package/dist/components/skeleton/skeleton.guide.json +1 -0
- package/dist/components/skeleton/skeleton.js +1 -4
- package/dist/components/slider/slider.d.ts +0 -13
- package/dist/components/slider/slider.guide.json +1 -0
- package/dist/components/slider/slider.js +1 -4
- package/dist/components/spinner/spinner.d.ts +1 -2
- package/dist/components/spinner/spinner.guide.json +1 -0
- package/dist/components/spinner/spinner.js +19 -24
- package/dist/components/stack/stack.css +1 -1
- package/dist/components/stack/stack.d.ts +1 -2
- package/dist/components/stack/stack.guide.json +1 -0
- 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.guide.json +1 -0
- package/dist/components/static-noise/static-noise.js +1 -4
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +1 -2
- package/dist/components/surface/surface.guide.json +1 -0
- package/dist/components/surface/surface.js +1 -4
- package/dist/components/switch/switch.d.ts +0 -13
- package/dist/components/switch/switch.guide.json +1 -0
- package/dist/components/switch/switch.js +1 -4
- package/dist/components/tabs/tabs.guide.json +1 -0
- package/dist/components/text/text.d.ts +1 -2
- package/dist/components/text/text.guide.json +1 -0
- package/dist/components/text/text.js +1 -4
- package/dist/components/textarea/textarea.d.ts +9 -15
- package/dist/components/textarea/textarea.guide.json +8 -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 +6 -0
- package/dist/components/textfield/textfield.js +38 -42
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.d.ts +5 -6
- package/dist/components/title/title.guide.json +13 -12
- package/dist/components/title/title.js +3 -6
- package/dist/components/toast/toast-banner.js +1 -1
- package/dist/components/toast/toast.guide.json +1 -0
- package/dist/components/toggle-button/toggle-button.guide.json +1 -0
- package/dist/components/toggle-group/toggle-group.guide.json +1 -0
- package/dist/components/tooltip/tooltip-content.js +1 -1
- package/dist/components/tooltip/tooltip.guide.json +1 -0
- package/dist/components/typewriter/typewriter.d.ts +1 -2
- package/dist/components/typewriter/typewriter.guide.json +1 -0
- 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 arrow and handwritten label that wraps inline content with optional highlighter mark, positioned via CSS anchor positioning.",
|
|
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
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Accordion",
|
|
3
|
+
"structure": "<Accordion>\n <Accordion.Item trigger=\"…\">…</Accordion.Item>\n</Accordion>",
|
|
3
4
|
"summary": "Collapsible sections grouped into open/closed blocks with optional Surface wrapping, shared corner radius, and background on open items.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Progressive disclosure for related content sections in one surface",
|
|
@@ -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}@property --vui-annotate-z-index{syntax:"*";inherits:true;initial-value:auto}@property --vui-annotate-text-align{syntax:"*";inherits:true;initial-value:start}.viraui__annotate-module__Annotate_7C36U{--vui-annotate-color:var(--global-foreground);--vui-annotate-target-gap:var(--space-small);--vui-annotate-label-gap:var(--space-x-small);--_annotate-tail-x:23px;--_annotate-tail-y:4px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:calc(-100% - var(--vui-annotate-label-gap));anchor-name:--vui-annotate-target;anchor-scope:--vui-annotate-target,--vui-annotate-arrow;display:inline-block;overflow:visible;border-radius:var(--radius-x-small)}.viraui__annotate-module__Arrow_T4B-6{position:absolute;z-index:var(--vui-annotate-z-index);position-anchor:--vui-annotate-target;anchor-name:--vui-annotate-arrow;width:46px;height:38px;transform:translate(var(--vui-annotate-arrow-x),var(--vui-annotate-arrow-y));transform-origin:50% 50%;mask:var(--_annotate-arrow-mask) center /contain no-repeat;background:var(--vui-annotate-color);pointer-events:none}.viraui__annotate-module__Note_8UW-R{position:absolute;z-index:var(--vui-annotate-z-index);position-anchor:--vui-annotate-arrow;left:calc(anchor(left) + var(--_annotate-tail-x));top:calc(anchor(top) + var(--_annotate-tail-y));width:max-content;max-width:var(--vui-annotate-label-max-width);transform:translate(calc(var(--_annotate-note-align-x) + var(--vui-annotate-text-x)),calc(var(--_annotate-note-align-y) + var(--vui-annotate-text-y))) rotate(var(--vui-annotate-rotate));font-family:Segoe Print,Chalkboard SE,Marker Felt,Dancing Script,sans-serif,system-ui;font-size:.95rem;line-height:1.05;color:var(--vui-annotate-color);text-align:var(--vui-annotate-text-align);white-space:normal;pointer-events:none}.viraui__annotate-module__Annotate_7C36U[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%)}.viraui__annotate-module__Annotate_7C36U[data-side=top]{--_annotate-tail-x:23px;--_annotate-tail-y:4px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:calc(-100% - var(--vui-annotate-label-gap))}.viraui__annotate-module__Annotate_7C36U[data-side=top] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-start;margin-bottom:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=top-start]{--_annotate-tail-x:6px;--_annotate-tail-y:6px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:calc(-100% - var(--vui-annotate-label-gap))}.viraui__annotate-module__Annotate_7C36U[data-side=top-start] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-start inline-start;margin-bottom:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=top-end]{--_annotate-tail-x:40px;--_annotate-tail-y:6px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:calc(-100% - var(--vui-annotate-label-gap))}.viraui__annotate-module__Annotate_7C36U[data-side=top-end] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-start inline-end;margin-bottom:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom]{--_annotate-tail-x:23px;--_annotate-tail-y:35px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:var(--vui-annotate-label-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-end;margin-top:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom-start]{--_annotate-tail-x:6px;--_annotate-tail-y:32px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:var(--vui-annotate-label-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom-start] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-end inline-start;margin-top:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom-end]{--_annotate-tail-x:40px;--_annotate-tail-y:32px;--_annotate-note-align-x:-50%;--_annotate-note-align-y:var(--vui-annotate-label-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=bottom-end] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:block-end inline-end;margin-top:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=start]{--_annotate-tail-x:4px;--_annotate-tail-y:19px;--_annotate-note-align-x:calc(-100% - var(--vui-annotate-label-gap));--_annotate-note-align-y:-50%}.viraui__annotate-module__Annotate_7C36U[data-side=start] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:inline-start;margin-inline-end:var(--vui-annotate-target-gap)}.viraui__annotate-module__Annotate_7C36U[data-side=end]{--_annotate-tail-x:43px;--_annotate-tail-y:19px;--_annotate-note-align-x:var(--vui-annotate-label-gap);--_annotate-note-align-y:-50%}.viraui__annotate-module__Annotate_7C36U[data-side=end] .viraui__annotate-module__Arrow_T4B-6{--_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");position-area:inline-end;margin-inline-start:var(--vui-annotate-target-gap)}}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 in a presentational note span (not announced).
|
|
15
|
+
*
|
|
16
|
+
* Do not put critical information here — assistive tech does not announce the note.
|
|
17
|
+
*
|
|
18
|
+
* @default No note; arrow and label 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 `var(--global-foreground)` when omitted
|
|
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
|
+
* Stacking order for arrow and note via `--vui-annotate-z-index`.
|
|
89
|
+
* Same value on both parts.
|
|
90
|
+
*
|
|
91
|
+
* @default undefined (`auto`)
|
|
92
|
+
*/
|
|
93
|
+
zIndex?: React.CSSProperties['zIndex'];
|
|
94
|
+
/**
|
|
95
|
+
* Text alignment for the note via `--vui-annotate-text-align`.
|
|
96
|
+
*
|
|
97
|
+
* @default undefined (`start`)
|
|
98
|
+
*/
|
|
99
|
+
textAlign?: React.CSSProperties['textAlign'];
|
|
100
|
+
};
|
|
101
|
+
export declare const Annotate: React.FC<AnnotateProps>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Annotate",
|
|
3
|
+
"structure": "<Annotate note=\"…\">…<span aria-hidden className={Arrow} /><span aria-hidden className={Note}>{note}</span></Annotate>",
|
|
4
|
+
"summary": "Decorative arrow and handwritten label that wraps inline content with optional highlighter mark, positioned via CSS anchor positioning.",
|
|
5
|
+
"whenToUse": [
|
|
6
|
+
"Call out a word or phrase in marketing, docs, or onboarding copy",
|
|
7
|
+
"Add a playful visual annotation without interactive chrome",
|
|
8
|
+
"Highlight a target with an optional mark while keeping children as the real content"
|
|
9
|
+
],
|
|
10
|
+
"whenNotToUse": [
|
|
11
|
+
"Conveying critical instructions, status, or validation that assistive tech must announce",
|
|
12
|
+
"Interactive tooltips or popovers that need focus and keyboard behavior",
|
|
13
|
+
"Layouts that clip overflow and cannot leave room for the arrow and label"
|
|
14
|
+
],
|
|
15
|
+
"accessibility": [
|
|
16
|
+
"Arrow and note are presentational spans with aria-hidden — decorative only and not exposed to assistive tech",
|
|
17
|
+
"Do not put critical information in note; keep real meaning in children or aria-describedby content",
|
|
18
|
+
"Children retain native semantics; Annotate itself is a presentational span wrap"
|
|
19
|
+
],
|
|
20
|
+
"antiPatterns": [
|
|
21
|
+
"Using note as the only source of instructions or status",
|
|
22
|
+
"Nesting Annotate inside overflow-hidden parents without padding for the arrow",
|
|
23
|
+
"Expecting the label to participate in hit-testing or selection",
|
|
24
|
+
"Adding position:relative on Annotate — it breaks CSS anchor position-area placement"
|
|
25
|
+
],
|
|
26
|
+
"related": ["Text", "Title", "Tooltip", "Chip"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"react": {
|
|
29
|
+
"color": {
|
|
30
|
+
"description": "Highlight token driving arrow, label, and optional mark color via --vui-annotate-color. When omitted, falls back to var(--global-foreground).",
|
|
31
|
+
"refCss": "color"
|
|
32
|
+
},
|
|
33
|
+
"arrowOffsetX": {
|
|
34
|
+
"description": "Horizontal offset for the arrow part.",
|
|
35
|
+
"refCss": "arrow-x"
|
|
36
|
+
},
|
|
37
|
+
"arrowOffsetY": {
|
|
38
|
+
"description": "Vertical offset for the arrow part.",
|
|
39
|
+
"refCss": "arrow-y"
|
|
40
|
+
},
|
|
41
|
+
"textOffsetX": {
|
|
42
|
+
"description": "Horizontal offset for the note part.",
|
|
43
|
+
"refCss": "text-x"
|
|
44
|
+
},
|
|
45
|
+
"textOffsetY": {
|
|
46
|
+
"description": "Vertical offset for the note part.",
|
|
47
|
+
"refCss": "text-y"
|
|
48
|
+
},
|
|
49
|
+
"rotate": {
|
|
50
|
+
"description": "Rotation for the note via --vui-annotate-rotate.",
|
|
51
|
+
"refCss": "rotate"
|
|
52
|
+
},
|
|
53
|
+
"targetGap": {
|
|
54
|
+
"description": "Gap between the target and the arrow.",
|
|
55
|
+
"refCss": "target-gap"
|
|
56
|
+
},
|
|
57
|
+
"labelGap": {
|
|
58
|
+
"description": "Gap between arrow and note on all sides.",
|
|
59
|
+
"refCss": "label-gap"
|
|
60
|
+
},
|
|
61
|
+
"labelMaxWidth": {
|
|
62
|
+
"description": "Max width for the note part.",
|
|
63
|
+
"refCss": "label-max-width"
|
|
64
|
+
},
|
|
65
|
+
"zIndex": {
|
|
66
|
+
"description": "Stacking order for arrow and note via --vui-annotate-z-index. Same value on both. When omitted, auto.",
|
|
67
|
+
"refCss": "z-index"
|
|
68
|
+
},
|
|
69
|
+
"textAlign": {
|
|
70
|
+
"description": "Text alignment for the note via --vui-annotate-text-align. When omitted, start.",
|
|
71
|
+
"refCss": "text-align"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"css": {
|
|
75
|
+
"color": {
|
|
76
|
+
"description": "Arrow, note, and mark accent color. Defaults to var(--global-foreground).",
|
|
77
|
+
"refReact": "color"
|
|
78
|
+
},
|
|
79
|
+
"arrow-x": {
|
|
80
|
+
"description": "Horizontal arrow offset.",
|
|
81
|
+
"refReact": "arrowOffsetX"
|
|
82
|
+
},
|
|
83
|
+
"arrow-y": {
|
|
84
|
+
"description": "Vertical arrow offset.",
|
|
85
|
+
"refReact": "arrowOffsetY"
|
|
86
|
+
},
|
|
87
|
+
"text-x": {
|
|
88
|
+
"description": "Horizontal note offset.",
|
|
89
|
+
"refReact": "textOffsetX"
|
|
90
|
+
},
|
|
91
|
+
"text-y": {
|
|
92
|
+
"description": "Vertical note offset.",
|
|
93
|
+
"refReact": "textOffsetY"
|
|
94
|
+
},
|
|
95
|
+
"rotate": {
|
|
96
|
+
"description": "Note rotation angle.",
|
|
97
|
+
"refReact": "rotate"
|
|
98
|
+
},
|
|
99
|
+
"target-gap": {
|
|
100
|
+
"description": "Gap between the target and the arrow.",
|
|
101
|
+
"refReact": "targetGap"
|
|
102
|
+
},
|
|
103
|
+
"label-gap": {
|
|
104
|
+
"description": "Gap between arrow and note on all sides.",
|
|
105
|
+
"refReact": "labelGap"
|
|
106
|
+
},
|
|
107
|
+
"label-max-width": {
|
|
108
|
+
"description": "Max width for the note part.",
|
|
109
|
+
"refReact": "labelMaxWidth"
|
|
110
|
+
},
|
|
111
|
+
"z-index": {
|
|
112
|
+
"description": "Stacking order for arrow and note. Defaults to auto.",
|
|
113
|
+
"refReact": "zIndex"
|
|
114
|
+
},
|
|
115
|
+
"text-align": {
|
|
116
|
+
"description": "Text alignment for the note. Defaults to start.",
|
|
117
|
+
"refReact": "textAlign"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import './annotate.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import annotate_module_default from "./annotate.module.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/annotate/annotate.tsx
|
|
6
|
+
var Annotate = ({ arrowOffsetX, arrowOffsetY, children, className, color, labelGap, labelMaxWidth = "300px", mark = false, note, ref, rotate, side = "top", style, targetGap, textAlign, textOffsetX, textOffsetY, zIndex, ...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
|
+
...zIndex != null && { "--vui-annotate-z-index": zIndex },
|
|
18
|
+
...textAlign && { "--vui-annotate-text-align": textAlign },
|
|
19
|
+
...style
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
22
|
+
...otherProps,
|
|
23
|
+
ref,
|
|
24
|
+
className: clsx(annotate_module_default.Annotate, className),
|
|
25
|
+
"data-mark": mark ? "true" : void 0,
|
|
26
|
+
"data-side": side,
|
|
27
|
+
style: dynamicStyle,
|
|
28
|
+
children: [children, note && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
className: annotate_module_default.Arrow
|
|
31
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
32
|
+
"aria-hidden": true,
|
|
33
|
+
className: annotate_module_default.Note,
|
|
34
|
+
children: note
|
|
35
|
+
})] })]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Annotate };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/components/annotate/annotate.module.css
|
|
2
|
+
var Annotate = "viraui__annotate-module__Annotate_7C36U";
|
|
3
|
+
var Arrow = "viraui__annotate-module__Arrow_T4B-6";
|
|
4
|
+
var Note = "viraui__annotate-module__Note_8UW-R";
|
|
5
|
+
var annotate_module_default = {
|
|
6
|
+
Annotate,
|
|
7
|
+
Arrow,
|
|
8
|
+
Note
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Annotate, Arrow, Note, annotate_module_default as default };
|
|
@@ -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,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "AvatarGroup",
|
|
3
|
+
"structure": "<AvatarGroup avatars={[{ fallback: \"AB\" }]} />",
|
|
3
4
|
"summary": "Overlapping avatar stack with shared sizing, directional layout, and an optional overflow pill.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Show a compact list of people or entities with consistent avatar sizing",
|
|
@@ -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,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ButtonLink",
|
|
3
|
+
"structure": "<ButtonLink href=\"#\">Save</ButtonLink>",
|
|
3
4
|
"summary": "Navigation link that shares Button visual chrome (--vui-button-* CSS) and default a root with optional render for framework Link.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Actions that navigate (href or router Link) but should look like Button",
|
|
@@ -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
|
*
|