@viraui/react 0.0.16 → 0.0.17
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 +6 -0
- package/dist/components/avatar/avatar.css +1 -55
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.js +49 -14
- package/dist/components/avatar/avatar.module.js +7 -0
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/basic-input/basic-input.css +1 -45
- package/dist/components/basic-input/basic-input.d.ts +0 -1
- package/dist/components/basic-input/basic-input.js +24 -13
- package/dist/components/basic-input/basic-input.module.js +3 -0
- package/dist/components/basic-input/field-helper-copy.d.ts +2 -1
- package/dist/components/basic-input/field-helper-copy.js +43 -24
- package/dist/components/basic-input/field-label.css +1 -0
- package/dist/components/basic-input/field-label.d.ts +10 -0
- package/dist/components/basic-input/field-label.js +24 -0
- package/dist/components/basic-input/field-label.module.js +3 -0
- package/dist/components/basic-input/index.d.ts +7 -2
- package/dist/components/basic-input/input-control-group.d.ts +2 -0
- package/dist/components/basic-input/input-control-group.js +40 -7
- package/dist/components/button/button.css +1 -157
- package/dist/components/button/button.d.ts +2 -3
- package/dist/components/button/button.js +100 -55
- package/dist/components/button/button.module.js +7 -0
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/checkbox/checkbox.css +1 -0
- package/dist/components/checkbox/checkbox.d.ts +65 -0
- package/dist/components/checkbox/checkbox.guide.json +22 -0
- package/dist/components/checkbox/checkbox.js +73 -0
- package/dist/components/checkbox/checkbox.module.js +10 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/clamp-text/clamp-text.css +1 -12
- package/dist/components/clamp-text/clamp-text.d.ts +1 -2
- package/dist/components/clamp-text/clamp-text.js +27 -22
- package/dist/components/clamp-text/clamp-text.module.js +3 -0
- package/dist/components/clamp-text/index.d.ts +2 -2
- package/dist/components/elevator/elevator.d.ts +5 -5
- package/dist/components/elevator/elevator.js +27 -27
- package/dist/components/elevator/index.d.ts +2 -2
- package/dist/components/icon/icon.css +1 -7
- package/dist/components/icon/icon.d.ts +2 -3
- package/dist/components/icon/icon.js +18 -9
- package/dist/components/icon/icon.module.js +3 -0
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/icon-button/icon-button.d.ts +2 -2
- package/dist/components/icon-button/icon-button.js +10 -3
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/index.d.ts +18 -17
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/select-group.d.ts +1 -1
- package/dist/components/select/select-group.js +37 -9
- package/dist/components/select/select-indicator-slot.js +33 -10
- package/dist/components/select/select-option.d.ts +1 -1
- package/dist/components/select/select-option.js +40 -10
- package/dist/components/select/select-separator.js +14 -6
- package/dist/components/select/select.css +1 -193
- package/dist/components/select/select.d.ts +10 -11
- package/dist/components/select/select.js +156 -32
- package/dist/components/select/select.module.js +19 -0
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/skeleton/skeleton.css +1 -36
- package/dist/components/skeleton/skeleton.d.ts +2 -3
- package/dist/components/skeleton/skeleton.js +26 -15
- package/dist/components/skeleton/skeleton.module.js +6 -0
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/slider-control.d.ts +1 -2
- package/dist/components/slider/slider-control.js +43 -19
- package/dist/components/slider/slider-utils.js +6 -3
- package/dist/components/slider/slider.css +1 -64
- package/dist/components/slider/slider.d.ts +5 -8
- package/dist/components/slider/slider.js +83 -17
- package/dist/components/slider/slider.module.js +12 -0
- package/dist/components/spinner/index.d.ts +2 -2
- package/dist/components/spinner/spinner.css +1 -45
- package/dist/components/spinner/spinner.d.ts +1 -2
- package/dist/components/spinner/spinner.js +29 -6
- package/dist/components/spinner/spinner.module.js +7 -0
- package/dist/components/stack/index.d.ts +2 -2
- package/dist/components/stack/stack.css +1 -57
- package/dist/components/stack/stack.d.ts +2 -3
- package/dist/components/stack/stack.js +40 -36
- package/dist/components/stack/stack.module.js +3 -0
- package/dist/components/surface/index.d.ts +2 -2
- package/dist/components/surface/surface.css +1 -70
- package/dist/components/surface/surface.d.ts +10 -6
- package/dist/components/surface/surface.js +43 -40
- package/dist/components/surface/surface.module.js +6 -0
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/switch.css +1 -73
- package/dist/components/switch/switch.d.ts +17 -5
- package/dist/components/switch/switch.js +59 -13
- package/dist/components/switch/switch.module.js +7 -0
- package/dist/components/text/index.d.ts +2 -2
- package/dist/components/text/text.css +1 -145
- package/dist/components/text/text.d.ts +8 -3
- package/dist/components/text/text.js +46 -41
- package/dist/components/text/text.module.js +3 -0
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/textarea.css +1 -45
- package/dist/components/textarea/textarea.d.ts +3 -4
- package/dist/components/textarea/textarea.js +51 -11
- package/dist/components/textarea/textarea.module.js +7 -0
- package/dist/components/textfield/index.d.ts +2 -2
- package/dist/components/textfield/textfield.css +1 -87
- package/dist/components/textfield/textfield.d.ts +3 -4
- package/dist/components/textfield/textfield.js +58 -12
- package/dist/components/textfield/textfield.module.js +9 -0
- package/dist/components/title/index.d.ts +2 -2
- package/dist/components/title/title.css +1 -137
- package/dist/components/title/title.d.ts +8 -3
- package/dist/components/title/title.js +44 -39
- package/dist/components/title/title.module.js +3 -0
- package/dist/consumption.json +6 -2
- package/dist/core/elevation/elevation-types.js +6 -3
- package/dist/core/elevation/get-elevation-props.d.ts +1 -1
- package/dist/core/elevation/get-elevation-props.js +14 -11
- package/dist/core/props/intrinsic-vira-props.js +12 -9
- package/dist/core/styles/resolve-axis-padding.d.ts +1 -1
- package/dist/core/styles/resolve-axis-padding.js +15 -16
- package/dist/core/theme/resolve-theme-value.d.ts +1 -1
- package/dist/core/theme/resolve-theme-value.js +7 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -1
- package/dist/internal-icons/icon-registry.d.ts +242 -239
- package/dist/internal-icons/icon-registry.js +247 -238
- package/dist/internal-icons/icons/duo/Magnifier.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Magnifier.js +13 -0
- package/dist/internal-icons/icons/duo/Minus.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Minus.js +13 -0
- package/dist/internal-icons/icons/duo/Plus.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Plus.js +13 -0
- package/dist/internal-icons/icons/duo/index.d.ts +241 -238
- package/dist/internal-icons/icons/duo/index.js +241 -238
- package/dist/preflight.css +1 -1
- package/package.json +10 -9
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/basic-input/index.js +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/clamp-text/index.js +0 -1
- package/dist/components/elevator/index.js +0 -1
- package/dist/components/icon/index.js +0 -1
- package/dist/components/icon-button/index.js +0 -1
- package/dist/components/index.js +0 -17
- package/dist/components/select/index.js +0 -1
- package/dist/components/skeleton/index.js +0 -1
- package/dist/components/slider/index.js +0 -1
- package/dist/components/slider/slider-control.css +0 -71
- package/dist/components/spinner/index.js +0 -1
- package/dist/components/stack/index.js +0 -1
- package/dist/components/surface/index.js +0 -1
- package/dist/components/switch/index.js +0 -1
- package/dist/components/text/index.js +0 -1
- package/dist/components/textarea/index.js +0 -1
- package/dist/components/textfield/index.js +0 -1
- package/dist/components/title/index.js +0 -1
|
@@ -1,145 +1 @@
|
|
|
1
|
-
|
|
2
|
-
:scope {
|
|
3
|
-
/*
|
|
4
|
-
* Fluid body scale (web.dev baseline pattern).
|
|
5
|
-
* Foundation refs: --font-scale-body-medium (fluid base), --font-heading-typescale, --font-scale-body-* bounds.
|
|
6
|
-
*/
|
|
7
|
-
--text-medium: clamp(
|
|
8
|
-
var(--font-scale-body-medium),
|
|
9
|
-
calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),
|
|
10
|
-
calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3)
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
--text-align: start;
|
|
14
|
-
--text-max-width: none;
|
|
15
|
-
--text-white-space: normal;
|
|
16
|
-
--text-padding-inline-start: 0;
|
|
17
|
-
--text-padding-inline-end: 0;
|
|
18
|
-
--text-padding-block-start: 0;
|
|
19
|
-
--text-padding-block-end: 0;
|
|
20
|
-
--text-font-family: var(--font-family-body);
|
|
21
|
-
--text-font-size: clamp(var(--font-scale-body-small), var(--text-medium), var(--font-scale-body-medium));
|
|
22
|
-
--text-font-weight: 400;
|
|
23
|
-
--text-font-width: 100;
|
|
24
|
-
--text-font-opsz: 16;
|
|
25
|
-
--text-line-height: var(--font-leading-standard);
|
|
26
|
-
|
|
27
|
-
margin: 0;
|
|
28
|
-
min-inline-size: 0;
|
|
29
|
-
max-inline-size: var(--text-max-width);
|
|
30
|
-
font-family: var(--text-font-family);
|
|
31
|
-
font-size: var(--text-font-size);
|
|
32
|
-
line-height: var(--text-line-height);
|
|
33
|
-
text-align: var(--text-align);
|
|
34
|
-
white-space: var(--text-white-space);
|
|
35
|
-
word-break: break-word;
|
|
36
|
-
font-optical-sizing: auto;
|
|
37
|
-
font-variation-settings:
|
|
38
|
-
'wght' var(--text-font-weight),
|
|
39
|
-
'wdth' var(--text-font-width),
|
|
40
|
-
'opsz' var(--text-font-opsz);
|
|
41
|
-
text-box: var(--text-trim) var(--text-trim-type);
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
|
|
44
|
-
&[data-text-balanced='true'] {
|
|
45
|
-
text-wrap: balance;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&[data-text-has-padding='true'] {
|
|
49
|
-
padding: var(--text-padding-block-start) var(--text-padding-inline-end) var(--text-padding-block-end)
|
|
50
|
-
var(--text-padding-inline-start);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&[data-text-family='mono'] {
|
|
54
|
-
--text-font-family: var(--font-family-mono);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&[data-text-size='x-large'] {
|
|
58
|
-
--text-font-size: clamp(
|
|
59
|
-
var(--font-scale-body-large),
|
|
60
|
-
calc(var(--text-medium) * pow(var(--font-heading-typescale), 2)),
|
|
61
|
-
var(--font-scale-body-x-large)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&[data-text-size='large'] {
|
|
66
|
-
--text-font-size: clamp(
|
|
67
|
-
var(--font-scale-body-medium),
|
|
68
|
-
calc(var(--text-medium) * pow(var(--font-heading-typescale), 1)),
|
|
69
|
-
var(--font-scale-body-large)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&[data-text-size='medium'] {
|
|
74
|
-
--text-font-size: clamp(var(--font-scale-body-small), var(--text-medium), var(--font-scale-body-medium));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&[data-text-size='small'] {
|
|
78
|
-
--text-font-size: clamp(
|
|
79
|
-
var(--font-scale-body-x-small),
|
|
80
|
-
calc(var(--text-medium) * pow(var(--font-heading-typescale), -0.1)),
|
|
81
|
-
var(--font-scale-body-small)
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&[data-text-size='x-small'] {
|
|
86
|
-
--text-font-size: var(--font-scale-body-x-small);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&[data-text-weight='light'] {
|
|
90
|
-
--text-font-weight: 200;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
&[data-text-weight='semibold'] {
|
|
94
|
-
--text-font-weight: 600;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&[data-text-weight='bold'] {
|
|
98
|
-
--text-font-weight: 800;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&[data-text-tone='muted'] {
|
|
102
|
-
color: var(--global-muted);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&[data-text-tone='interactive'] {
|
|
106
|
-
color: var(--global-interactive-text);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&[data-text-tone='positive'] {
|
|
110
|
-
color: var(--highlight-green);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&[data-text-tone='informative'] {
|
|
114
|
-
color: var(--highlight-blue);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&[data-text-tone='danger'] {
|
|
118
|
-
color: var(--highlight-red);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&[data-text-tone='warning'] {
|
|
122
|
-
color: var(--highlight-yellow);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&[data-text-has-literal-color='true'] {
|
|
126
|
-
color: var(--text-literal-color);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&[data-text-line-height='none'] {
|
|
130
|
-
--text-line-height: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&[data-text-line-height='x-small'] {
|
|
134
|
-
--text-line-height: var(--font-leading-x-small);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&[data-text-line-height='small'] {
|
|
138
|
-
--text-line-height: var(--font-leading-small);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&[data-text-line-height='large'] {
|
|
142
|
-
--text-line-height: var(--font-leading-large);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
1
|
+
.text-module_Text_bS8kv{--text-medium:clamp(var(--font-scale-body-medium),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3));--text-align:start;--text-max-width:none;--text-white-space:normal;--text-padding-inline-start:0;--text-padding-inline-end:0;--text-padding-block-start:0;--text-padding-block-end:0;--text-font-family:var(--font-family-body);--text-font-size:clamp(var(--font-scale-body-small),var(--text-medium),var(--font-scale-body-medium));--text-font-weight:400;--text-font-width:100;--text-font-opsz:16;--text-line-height:var(--font-leading-standard);margin:0;min-inline-size:0;max-inline-size:var(--text-max-width);font-family:var(--text-font-family);font-size:var(--text-font-size);line-height:var(--text-line-height);text-align:var(--text-align);white-space:var(--text-white-space);word-break:break-word;font-optical-sizing:auto;font-variation-settings:"wght" var(--text-font-weight),"wdth" var(--text-font-width),"opsz" var(--text-font-opsz);text-box:var(--text-trim) var(--text-trim-type);display:inline-flex;&[data-text-balanced=true]{text-wrap:balance}&[data-text-selection=false]{-webkit-user-select:none;user-select:none}&[data-text-has-padding=true]{padding:var(--text-padding-block-start) var(--text-padding-inline-end) var(--text-padding-block-end) var(--text-padding-inline-start)}&[data-text-family=mono]{--text-font-family:var(--font-family-mono)}&[data-text-size=x-large]{--text-font-size:clamp(var(--font-scale-body-large),calc(var(--text-medium) * pow(var(--font-heading-typescale), 2)),var(--font-scale-body-x-large))}&[data-text-size=large]{--text-font-size:clamp(var(--font-scale-body-medium),calc(var(--text-medium) * pow(var(--font-heading-typescale), 1)),var(--font-scale-body-large))}&[data-text-size=medium]{--text-font-size:clamp(var(--font-scale-body-small),var(--text-medium),var(--font-scale-body-medium))}&[data-text-size=small]{--text-font-size:clamp(var(--font-scale-body-x-small),calc(var(--text-medium) * pow(var(--font-heading-typescale), -0.1)),var(--font-scale-body-small))}&[data-text-size=x-small]{--text-font-size:var(--font-scale-body-x-small)}&[data-text-weight=light]{--text-font-weight:200}&[data-text-weight=semibold]{--text-font-weight:600}&[data-text-weight=bold]{--text-font-weight:800}&[data-text-tone=muted]{color:var(--global-muted)}&[data-text-tone=interactive]{color:var(--global-interactive-text)}&[data-text-tone=positive]{color:var(--highlight-green)}&[data-text-tone=informative]{color:var(--highlight-blue)}&[data-text-tone=danger]{color:var(--highlight-red)}&[data-text-tone=warning]{color:var(--highlight-yellow)}&[data-text-has-literal-color=true]{color:var(--text-literal-color)}&[data-text-line-height=none]{--text-line-height:0}&[data-text-line-height=x-small]{--text-line-height:var(--font-leading-x-small)}&[data-text-line-height=small]{--text-line-height:var(--font-leading-small)}&[data-text-line-height=large]{--text-line-height:var(--font-leading-large)}}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
|
+
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
4
|
import type * as React from 'react';
|
|
5
|
-
import './text.css';
|
|
6
5
|
type TextSpace = ThemeTypes['space'];
|
|
7
6
|
type TextAxisPadding = TextSpace | [TextSpace | 0, TextSpace | 0];
|
|
8
7
|
/**
|
|
@@ -86,6 +85,12 @@ export type TextProps = React.ComponentPropsWithoutRef<'span'> & IntrinsicViraPr
|
|
|
86
85
|
* @default false
|
|
87
86
|
*/
|
|
88
87
|
balanced?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Enables text selection on the rendered copy.
|
|
90
|
+
*
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
selection?: boolean;
|
|
89
94
|
/**
|
|
90
95
|
* Sets inline padding using one token for both sides or a `[start, end]` tuple.
|
|
91
96
|
*
|
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
4
|
-
import { resolveAxisPadding } from '../../core/styles/resolve-axis-padding.js';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
1
|
import './text.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import { resolveAxisPadding } from "../../core/styles/resolve-axis-padding.js";
|
|
5
|
+
import text_module_default from "./text.module.js";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/text/text.tsx
|
|
9
|
+
var Text = ({ align = "start", balanced = false, selection = true, className, color, family = "body", fontWidth, hPadding, lineHeight = "standard", maxWidth, opticalSize, ref, render, size = "medium", style, tone, trim = "both", trimType = "cap alphabetic", vPadding, weight = "regular", whiteSpace = "normal", ...otherProps }) => {
|
|
10
|
+
const hasPadding = Boolean(hPadding || vPadding);
|
|
11
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
12
|
+
const dynamicStyle = {
|
|
13
|
+
"--text-align": align,
|
|
14
|
+
"--text-max-width": maxWidth ?? "none",
|
|
15
|
+
"--text-literal-color": color,
|
|
16
|
+
"--text-white-space": whiteSpace,
|
|
17
|
+
"--text-trim": trim ? `trim-${trim}` : "initial",
|
|
18
|
+
"--text-trim-type": trim ? trimType : "initial",
|
|
19
|
+
...typeof weight === "number" ? { "--text-font-weight": weight } : {},
|
|
20
|
+
...fontWidth !== void 0 ? { "--text-font-width": fontWidth } : {},
|
|
21
|
+
...opticalSize !== void 0 ? { "--text-font-opsz": opticalSize } : {},
|
|
22
|
+
...resolveAxisPadding(hPadding, "--text-padding-inline-start", "--text-padding-inline-end"),
|
|
23
|
+
...resolveAxisPadding(vPadding, "--text-padding-block-start", "--text-padding-block-end"),
|
|
24
|
+
...style
|
|
25
|
+
};
|
|
26
|
+
return useRender({
|
|
27
|
+
defaultTagName: "span",
|
|
28
|
+
render,
|
|
29
|
+
ref,
|
|
30
|
+
props: {
|
|
31
|
+
...componentProps,
|
|
32
|
+
...intrinsicAttributes,
|
|
33
|
+
"data-text-size": size,
|
|
34
|
+
"data-text-family": family,
|
|
35
|
+
"data-text-weight": typeof weight === "string" ? weight : "custom",
|
|
36
|
+
"data-text-tone": tone,
|
|
37
|
+
"data-text-line-height": lineHeight,
|
|
38
|
+
"data-text-balanced": balanced ? "true" : "false",
|
|
39
|
+
"data-text-selection": selection ? "true" : "false",
|
|
40
|
+
"data-text-has-padding": hasPadding ? "true" : "false",
|
|
41
|
+
"data-text-has-literal-color": color ? "true" : "false",
|
|
42
|
+
className: clsx(text_module_default.Text, className),
|
|
43
|
+
style: dynamicStyle
|
|
44
|
+
}
|
|
45
|
+
});
|
|
43
46
|
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Text };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Textarea } from './textarea
|
|
2
|
-
export type { TextareaProps } from './textarea
|
|
1
|
+
export { Textarea } from './textarea';
|
|
2
|
+
export type { TextareaProps } from './textarea';
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
|
|
2
|
-
:scope {
|
|
3
|
-
--textarea-min-block-size: calc(var(--space-x-large) * 2);
|
|
4
|
-
--textarea-padding-block: var(--space-small);
|
|
5
|
-
--textarea-input-border-radius: var(--radius-small);
|
|
6
|
-
inline-size: 100%;
|
|
7
|
-
|
|
8
|
-
> .BasicInput {
|
|
9
|
-
--basic-input-border-radius: var(--textarea-input-border-radius);
|
|
10
|
-
border: 1px solid var(--global-contrast);
|
|
11
|
-
min-block-size: var(--textarea-min-block-size);
|
|
12
|
-
padding-block: var(--textarea-padding-block);
|
|
13
|
-
line-height: 1.4;
|
|
14
|
-
resize: none;
|
|
15
|
-
|
|
16
|
-
&[data-resize='vertical'] {
|
|
17
|
-
resize: vertical;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&[data-resize='both'] {
|
|
21
|
-
resize: both;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&[data-invalid] {
|
|
25
|
-
border-color: var(--highlight-red);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:disabled,
|
|
29
|
-
&[data-disabled] {
|
|
30
|
-
border-color: transparent;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Required field: append red asterisk on Label */
|
|
35
|
-
&:has([required]) > .Label::after {
|
|
36
|
-
content: ' *';
|
|
37
|
-
color: var(--highlight-red);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
> .Label,
|
|
41
|
-
> .Description {
|
|
42
|
-
padding-inline: calc(var(--textarea-input-border-radius) / 2);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
.textarea-module_Textarea_mtOUG{--textarea-min-block-size:calc(var(--space-x-large) * 2);--textarea-padding-block:var(--space-small);--textarea-input-border-radius:var(--radius-small);--field-label-padding-inline:calc(var(--textarea-input-border-radius) / 2);inline-size:100%;&:has([required]) [data-field-label]:after{content:" *";color:var(--highlight-red)}}.textarea-module_CustomBasicInput_Ce7yA{--basic-input-border-radius:var(--textarea-input-border-radius);border:1px solid var(--global-contrast);min-block-size:var(--textarea-min-block-size);padding-block:var(--textarea-padding-block);line-height:1.4;resize:none;&[data-resize=vertical]{resize:vertical}&[data-resize=both]{resize:both}&[data-invalid]{border-color:var(--highlight-red)}&:disabled,&[data-disabled]{border-color:transparent}}.textarea-module_Description_er3zI{padding-inline:calc(var(--textarea-input-border-radius) / 2)}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FieldRoot } from '@base-ui/react/field';
|
|
2
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
3
|
import type * as React from 'react';
|
|
3
|
-
import './textarea.css';
|
|
4
|
-
import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
5
4
|
/**
|
|
6
5
|
* Public Textarea props.
|
|
7
6
|
*
|
|
@@ -26,7 +25,7 @@ export type TextareaProps = React.ComponentPropsWithoutRef<'textarea'> & Omit<Fi
|
|
|
26
25
|
shrink?: IntrinsicViraProps['shrink'];
|
|
27
26
|
ref?: React.Ref<HTMLTextAreaElement>;
|
|
28
27
|
/**
|
|
29
|
-
* Visible label rendered with
|
|
28
|
+
* Visible label rendered with shared internal `FieldLabel`.
|
|
30
29
|
*
|
|
31
30
|
* @default No label is rendered.
|
|
32
31
|
*/
|
|
@@ -1,13 +1,53 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Field } from '@base-ui/react/field';
|
|
4
|
-
import { BasicInput } from '../../components/basic-input/index.js';
|
|
5
|
-
import { FieldHelperCopy } from '../../components/basic-input/field-helper-copy.js';
|
|
6
|
-
import { Stack } from '../../components/stack/index.js';
|
|
7
|
-
import { Text } from '../../components/text/index.js';
|
|
8
|
-
import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
9
1
|
import './textarea.css';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import { BasicInput } from "../basic-input/basic-input.js";
|
|
5
|
+
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
6
|
+
import { FieldLabel } from "../basic-input/field-label.js";
|
|
7
|
+
import { Stack } from "../stack/stack.js";
|
|
8
|
+
import textarea_module_default from "./textarea.module.js";
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Field } from "@base-ui/react/field";
|
|
12
|
+
//#region src/components/textarea/textarea.tsx
|
|
13
|
+
var Textarea = ({ className, description, dirty, disabled, error, invalid, label, name, ref, resize, touched, validate, validationDebounceTime, validationMode, ...textareaProps }) => {
|
|
14
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(textareaProps);
|
|
15
|
+
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
16
|
+
...intrinsicAttributes,
|
|
17
|
+
className: textarea_module_default.Textarea,
|
|
18
|
+
dirty,
|
|
19
|
+
disabled,
|
|
20
|
+
invalid,
|
|
21
|
+
name,
|
|
22
|
+
touched,
|
|
23
|
+
validate,
|
|
24
|
+
validationDebounceTime,
|
|
25
|
+
validationMode,
|
|
26
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
27
|
+
direction: "column",
|
|
28
|
+
fillChildren: false,
|
|
29
|
+
rowGap: "small"
|
|
30
|
+
}),
|
|
31
|
+
children: [
|
|
32
|
+
label && /* @__PURE__ */ jsx(Field.Label, {
|
|
33
|
+
"data-field-label": "",
|
|
34
|
+
children: /* @__PURE__ */ jsx(FieldLabel, { children: label })
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsx(BasicInput, {
|
|
37
|
+
...componentProps,
|
|
38
|
+
ref,
|
|
39
|
+
className: clsx(textarea_module_default.CustomBasicInput, className),
|
|
40
|
+
"data-resize": resize,
|
|
41
|
+
disabled,
|
|
42
|
+
render: /* @__PURE__ */ jsx("textarea", {})
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
45
|
+
className: textarea_module_default.Description,
|
|
46
|
+
description,
|
|
47
|
+
error
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
13
51
|
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Textarea };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Textfield } from './textfield
|
|
2
|
-
export type { TextfieldProps } from './textfield
|
|
1
|
+
export { Textfield } from './textfield';
|
|
2
|
+
export type { TextfieldProps } from './textfield';
|
|
@@ -1,87 +1 @@
|
|
|
1
|
-
|
|
2
|
-
:scope {
|
|
3
|
-
--input-height: var(--space-x-large);
|
|
4
|
-
--control-group-background: var(--base-1);
|
|
5
|
-
--control-group-color: var(--global-foreground);
|
|
6
|
-
--control-group-border-color: var(--global-contrast);
|
|
7
|
-
--control-group-border-radius: var(--radius-small);
|
|
8
|
-
inline-size: 100%;
|
|
9
|
-
|
|
10
|
-
> .ControlGroup {
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
inline-size: 100%;
|
|
13
|
-
min-inline-size: 0;
|
|
14
|
-
block-size: var(--input-height);
|
|
15
|
-
background: var(--control-group-background);
|
|
16
|
-
border: 1px solid var(--control-group-border-color);
|
|
17
|
-
border-radius: var(--control-group-border-radius);
|
|
18
|
-
|
|
19
|
-
&:has(.BasicInput[data-focused]),
|
|
20
|
-
&:has(.BasicInput:focus-visible) {
|
|
21
|
-
outline: 2px solid var(--global-foreground);
|
|
22
|
-
outline-offset: 2px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Invalid: propagate BasicInput error border and outline to ControlGroup shell */
|
|
26
|
-
&:has(.BasicInput[data-invalid]) {
|
|
27
|
-
--control-group-border-color: var(--highlight-red);
|
|
28
|
-
box-shadow: none;
|
|
29
|
-
outline-color: oklab(from var(--highlight-red) l a b / 0.5);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Disabled: mirror disabled input background/border on ControlGroup */
|
|
33
|
-
&:has(.BasicInput:disabled),
|
|
34
|
-
&:has(.BasicInput[data-disabled]) {
|
|
35
|
-
--control-group-background: var(--global-disabled-background);
|
|
36
|
-
--control-group-border-color: transparent;
|
|
37
|
-
|
|
38
|
-
box-shadow: none;
|
|
39
|
-
cursor: not-allowed;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
> .BasicInput {
|
|
43
|
-
flex: 1 1 auto;
|
|
44
|
-
min-inline-size: 0;
|
|
45
|
-
block-size: 100%;
|
|
46
|
-
line-height: 1.2;
|
|
47
|
-
border: none;
|
|
48
|
-
background: transparent;
|
|
49
|
-
box-shadow: none;
|
|
50
|
-
border-radius: inherit;
|
|
51
|
-
|
|
52
|
-
&:focus-visible {
|
|
53
|
-
outline: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&:disabled {
|
|
57
|
-
cursor: not-allowed;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
> .Addon {
|
|
62
|
-
min-inline-size: var(--space-x-large);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* Addon start: tighten input padding so text does not sit under the addon */
|
|
66
|
-
&:has(.Addon[data-position='start']) > .BasicInput {
|
|
67
|
-
padding-inline-start: var(--space-x-small);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Addon end: tighten trailing padding on the input */
|
|
71
|
-
&:has(.Addon[data-position='end']) > .BasicInput {
|
|
72
|
-
padding-inline-end: var(--space-x-small);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* Required field: append red asterisk on Label */
|
|
77
|
-
&:has([required]) > .Label::after {
|
|
78
|
-
content: ' *';
|
|
79
|
-
color: var(--highlight-red);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
> .Label,
|
|
83
|
-
> .Description {
|
|
84
|
-
padding-inline: calc(var(--control-group-border-radius) / 2);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
.textfield-module_Textfield_o-70A{--input-height:var(--space-x-large);--control-group-background:var(--base-1);--control-group-color:var(--global-foreground);--control-group-border-color:var(--global-contrast);--control-group-border-radius:var(--radius-small);--field-label-padding-inline:calc(var(--control-group-border-radius) / 2);inline-size:100%;&:has([required]) [data-field-label]:after{content:" *";color:var(--highlight-red)}}.textfield-module_ControlGroup_2W-OC{box-sizing:border-box;inline-size:100%;min-inline-size:0;block-size:var(--input-height);background:var(--control-group-background);border:1px solid var(--control-group-border-color);border-radius:var(--control-group-border-radius);&:has(.textfield-module_CustomBasicInput_oHgtd:focus-visible),&:has(.textfield-module_CustomBasicInput_oHgtd[data-focused]){outline:2px solid var(--global-foreground);outline-offset:2px}&:has(.textfield-module_CustomBasicInput_oHgtd[data-invalid]){--control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}&:has(.textfield-module_CustomBasicInput_oHgtd:disabled),&:has(.textfield-module_CustomBasicInput_oHgtd[data-disabled]){--control-group-background:var(--global-disabled-background);--control-group-border-color:transparent;box-shadow:none;cursor:not-allowed}&:has(.textfield-module_Addon_kK1ef[data-position=start])>.textfield-module_CustomBasicInput_oHgtd{padding-inline-start:var(--space-x-small)}&:has(.textfield-module_Addon_kK1ef[data-position=end])>.textfield-module_CustomBasicInput_oHgtd{padding-inline-end:var(--space-x-small)}}.textfield-module_CustomBasicInput_oHgtd{flex:1 1 auto;min-inline-size:0;block-size:100%;line-height:1.2;border:none;background:transparent;box-shadow:none;border-radius:inherit;&:focus-visible{outline:none}&:disabled{cursor:not-allowed}}.textfield-module_Addon_kK1ef{min-inline-size:var(--space-x-large)}.textfield-module_Description_8Qxot{padding-inline:calc(var(--control-group-border-radius) / 2)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FieldRoot } from '@base-ui/react/field';
|
|
2
2
|
import { Input as PrimitiveInput } from '@base-ui/react/input';
|
|
3
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
4
|
import type * as React from 'react';
|
|
4
|
-
import './textfield.css';
|
|
5
|
-
import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
6
5
|
/**
|
|
7
6
|
* Public Textfield props.
|
|
8
7
|
*
|
|
@@ -14,7 +13,7 @@ import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.j
|
|
|
14
13
|
*/
|
|
15
14
|
export type TextfieldProps = PrimitiveInput.Props & FieldRoot.Props & IntrinsicViraProps & {
|
|
16
15
|
/**
|
|
17
|
-
* Visible label rendered with
|
|
16
|
+
* Visible label rendered with shared internal `FieldLabel`.
|
|
18
17
|
*
|
|
19
18
|
* @default No label is rendered.
|
|
20
19
|
*/
|
|
@@ -1,14 +1,60 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Field } from '@base-ui/react/field';
|
|
4
|
-
import { Input as PrimitiveInput } from '@base-ui/react/input';
|
|
5
|
-
import { Stack, Text } from '../index.js';
|
|
6
|
-
import { BasicInput } from '../../components/basic-input/index.js';
|
|
7
|
-
import { FieldHelperCopy } from '../../components/basic-input/field-helper-copy.js';
|
|
8
|
-
import { InputControlGroup } from '../../components/basic-input/input-control-group.js';
|
|
9
|
-
import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
10
1
|
import './textfield.css';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import { BasicInput } from "../basic-input/basic-input.js";
|
|
5
|
+
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
6
|
+
import { FieldLabel } from "../basic-input/field-label.js";
|
|
7
|
+
import { InputControlGroup } from "../basic-input/input-control-group.js";
|
|
8
|
+
import textfield_module_default from "./textfield.module.js";
|
|
9
|
+
import { Stack } from "../stack/stack.js";
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Field } from "@base-ui/react/field";
|
|
13
|
+
import { Input } from "@base-ui/react/input";
|
|
14
|
+
//#region src/components/textfield/textfield.tsx
|
|
15
|
+
var Textfield = ({ className, description, dirty, disabled, endAddon, error, invalid, label, name, ref, startAddon, touched, validate, validationDebounceTime, validationMode, ...inputProps }) => {
|
|
16
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(inputProps);
|
|
17
|
+
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
18
|
+
...intrinsicAttributes,
|
|
19
|
+
className: textfield_module_default.Textfield,
|
|
20
|
+
dirty,
|
|
21
|
+
disabled,
|
|
22
|
+
invalid,
|
|
23
|
+
name,
|
|
24
|
+
touched,
|
|
25
|
+
validate,
|
|
26
|
+
validationDebounceTime,
|
|
27
|
+
validationMode,
|
|
28
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
29
|
+
direction: "column",
|
|
30
|
+
fillChildren: false,
|
|
31
|
+
rowGap: "small"
|
|
32
|
+
}),
|
|
33
|
+
children: [
|
|
34
|
+
label && /* @__PURE__ */ jsx(Field.Label, {
|
|
35
|
+
"data-field-label": "",
|
|
36
|
+
children: /* @__PURE__ */ jsx(FieldLabel, { children: label })
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx(InputControlGroup, {
|
|
39
|
+
addonClassName: textfield_module_default.Addon,
|
|
40
|
+
controlGroupClassName: textfield_module_default.ControlGroup,
|
|
41
|
+
endAddon,
|
|
42
|
+
startAddon,
|
|
43
|
+
children: /* @__PURE__ */ jsx(BasicInput, {
|
|
44
|
+
...componentProps,
|
|
45
|
+
ref,
|
|
46
|
+
className: clsx(textfield_module_default.CustomBasicInput, className),
|
|
47
|
+
disabled,
|
|
48
|
+
render: /* @__PURE__ */ jsx(Input, {})
|
|
49
|
+
})
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
52
|
+
className: textfield_module_default.Description,
|
|
53
|
+
description,
|
|
54
|
+
error
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
14
58
|
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Textfield };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var textfield_module_default = {
|
|
2
|
+
Textfield: "textfield-module_Textfield_o-70A",
|
|
3
|
+
ControlGroup: "textfield-module_ControlGroup_2W-OC",
|
|
4
|
+
CustomBasicInput: "textfield-module_CustomBasicInput_oHgtd",
|
|
5
|
+
Addon: "textfield-module_Addon_kK1ef",
|
|
6
|
+
Description: "textfield-module_Description_8Qxot"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { textfield_module_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Title } from './title
|
|
2
|
-
export type { TitleProps } from './title
|
|
1
|
+
export { Title } from './title';
|
|
2
|
+
export type { TitleProps } from './title';
|