@sakura-ui/sakura-ui 0.1.10 → 0.1.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/README.md +8 -32
- package/package.json +4 -4
- package/packages/config/package.json +8 -8
- package/packages/config/src/index.ts +1 -1
- package/packages/core/package.json +12 -12
- package/packages/core/src/components/IconButton.tsx +12 -3
- package/packages/forms/coverage/clover.xml +60 -60
- package/packages/forms/coverage/coverage-final.json +17 -17
- package/packages/forms/coverage/lcov-report/index.html +23 -23
- package/packages/forms/coverage/lcov-report/src/components/Checkbox.tsx.html +8 -8
- package/packages/forms/coverage/lcov-report/src/components/FieldsetControl.tsx.html +4 -4
- package/packages/forms/coverage/lcov-report/src/components/LabelControl.tsx.html +60 -60
- package/packages/forms/coverage/lcov-report/src/components/Radio.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/Select.tsx.html +31 -37
- package/packages/forms/coverage/lcov-report/src/components/Text.tsx.html +13 -16
- package/packages/forms/coverage/lcov-report/src/components/Textarea.tsx.html +27 -30
- package/packages/forms/coverage/lcov-report/src/components/context.ts.html +2 -5
- package/packages/forms/coverage/lcov-report/src/components/controlled/CheckboxGroup.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/controlled/RadioGroup.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/controlled/SelectControl.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/controlled/TextControl.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/controlled/TextareaControl.tsx.html +3 -3
- package/packages/forms/coverage/lcov-report/src/components/controlled/index.html +1 -1
- package/packages/forms/coverage/lcov-report/src/components/controlled/index.ts.html +1 -1
- package/packages/forms/coverage/lcov-report/src/components/index.html +37 -37
- package/packages/forms/coverage/lcov-report/src/components/index.ts.html +9 -9
- package/packages/forms/coverage/lcov-report/src/index.html +5 -5
- package/packages/forms/coverage/lcov-report/src/index.ts.html +9 -9
- package/packages/forms/coverage/lcov-report/src/utils/index.html +1 -1
- package/packages/forms/coverage/lcov-report/src/utils/index.ts.html +2 -2
- package/packages/forms/coverage/lcov.info +83 -91
- package/packages/forms/dist/components/Textarea.d.ts.map +1 -1
- package/packages/forms/dist/index.cjs.js +15 -15
- package/packages/forms/dist/index.cjs.js.map +1 -1
- package/packages/forms/dist/index.es.js +351 -341
- package/packages/forms/dist/index.es.js.map +1 -1
- package/packages/forms/node_modules/.bin/autoprefixer +4 -4
- package/packages/forms/node_modules/.bin/browserslist +4 -4
- package/packages/forms/node_modules/.bin/jest +4 -4
- package/packages/forms/node_modules/.bin/npm-run-all +2 -2
- package/packages/forms/node_modules/.bin/run-p +2 -2
- package/packages/forms/node_modules/.bin/run-s +2 -2
- package/packages/forms/node_modules/.bin/tailwind +2 -2
- package/packages/forms/node_modules/.bin/tailwindcss +2 -2
- package/packages/forms/node_modules/.bin/ts-jest +4 -4
- package/packages/forms/node_modules/.bin/ts-node +4 -4
- package/packages/forms/node_modules/.bin/ts-node-cwd +4 -4
- package/packages/forms/node_modules/.bin/ts-node-esm +4 -4
- package/packages/forms/node_modules/.bin/ts-node-script +4 -4
- package/packages/forms/node_modules/.bin/ts-node-transpile-only +4 -4
- package/packages/forms/node_modules/.bin/ts-script +4 -4
- package/packages/forms/node_modules/.bin/tsc +4 -4
- package/packages/forms/node_modules/.bin/tsc-alias +4 -4
- package/packages/forms/node_modules/.bin/tsserver +4 -4
- package/packages/forms/node_modules/.bin/vite +4 -4
- package/packages/forms/package.json +15 -15
- package/packages/forms/src/components/Textarea.tsx +33 -12
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">100% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>14/14</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -146,9 +146,9 @@
|
|
|
146
146
|
<span class="cline-any cline-neutral"> </span>
|
|
147
147
|
<span class="cline-any cline-yes">4x</span>
|
|
148
148
|
<span class="cline-any cline-neutral"> </span>
|
|
149
|
+
<span class="cline-any cline-yes">11x</span>
|
|
149
150
|
<span class="cline-any cline-neutral"> </span>
|
|
150
151
|
<span class="cline-any cline-neutral"> </span>
|
|
151
|
-
<span class="cline-any cline-yes">17x</span>
|
|
152
152
|
<span class="cline-any cline-neutral"> </span>
|
|
153
153
|
<span class="cline-any cline-neutral"> </span>
|
|
154
154
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -156,19 +156,19 @@
|
|
|
156
156
|
<span class="cline-any cline-neutral"> </span>
|
|
157
157
|
<span class="cline-any cline-neutral"> </span>
|
|
158
158
|
<span class="cline-any cline-neutral"> </span>
|
|
159
|
+
<span class="cline-any cline-yes">11x</span>
|
|
159
160
|
<span class="cline-any cline-neutral"> </span>
|
|
161
|
+
<span class="cline-any cline-yes">11x</span>
|
|
160
162
|
<span class="cline-any cline-neutral"> </span>
|
|
161
|
-
<span class="cline-any cline-yes">17x</span>
|
|
162
163
|
<span class="cline-any cline-neutral"> </span>
|
|
163
|
-
<span class="cline-any cline-yes">17x</span>
|
|
164
164
|
<span class="cline-any cline-neutral"> </span>
|
|
165
165
|
<span class="cline-any cline-neutral"> </span>
|
|
166
166
|
<span class="cline-any cline-neutral"> </span>
|
|
167
167
|
<span class="cline-any cline-neutral"> </span>
|
|
168
|
+
<span class="cline-any cline-yes">11x</span>
|
|
168
169
|
<span class="cline-any cline-neutral"> </span>
|
|
169
170
|
<span class="cline-any cline-neutral"> </span>
|
|
170
171
|
<span class="cline-any cline-neutral"> </span>
|
|
171
|
-
<span class="cline-any cline-yes">17x</span>
|
|
172
172
|
<span class="cline-any cline-neutral"> </span>
|
|
173
173
|
<span class="cline-any cline-neutral"> </span>
|
|
174
174
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -204,7 +204,7 @@ import { cx } from '../utils'
|
|
|
204
204
|
import { ControllerContext } from './context'
|
|
205
205
|
|
|
206
206
|
export interface LabelControlProps
|
|
207
|
-
extends React.ComponentPropsWithoutRef<'
|
|
207
|
+
extends React.ComponentPropsWithoutRef<'div'> {
|
|
208
208
|
labelText: string
|
|
209
209
|
helperText?: string
|
|
210
210
|
errorMessage?: string
|
|
@@ -212,61 +212,61 @@ export interface LabelControlProps
|
|
|
212
212
|
isRequired?: boolean
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
export const LabelControl = React.forwardRef<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
...restProps
|
|
229
|
-
} = props
|
|
215
|
+
export const LabelControl = React.forwardRef<HTMLDivElement, LabelControlProps>(
|
|
216
|
+
(props, ref) => {
|
|
217
|
+
const id = React.useId()
|
|
218
|
+
const {
|
|
219
|
+
labelText,
|
|
220
|
+
className,
|
|
221
|
+
helperText,
|
|
222
|
+
errorMessage,
|
|
223
|
+
isInvalid,
|
|
224
|
+
isRequired,
|
|
225
|
+
children,
|
|
226
|
+
...newProps
|
|
227
|
+
} = props
|
|
230
228
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<ControllerContext.Provider value={context}>
|
|
241
|
-
<div className={cx('mb-4', className)}>
|
|
242
|
-
<label
|
|
243
|
-
className={cx('block mb-2', isInvalid && 'text-sun-800')}
|
|
244
|
-
htmlFor={context.id}
|
|
245
|
-
ref={ref}
|
|
246
|
-
{...restProps}
|
|
247
|
-
>
|
|
248
|
-
{labelText}
|
|
249
|
-
{isRequired && <span className="text-sun-800">&nbsp;*</span>}
|
|
250
|
-
</label>
|
|
251
|
-
{children}
|
|
229
|
+
const context = {
|
|
230
|
+
helperTextId: `helper-text-${id}`,
|
|
231
|
+
errorMessageId: `error-message-${id}`,
|
|
232
|
+
isInvalid: isInvalid ?? false,
|
|
233
|
+
isRequired: isRequired ?? false
|
|
234
|
+
}
|
|
252
235
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
236
|
+
return (
|
|
237
|
+
<ControllerContext.Provider value={context}>
|
|
238
|
+
<div className={cx('mb-4', className)} ref={ref} {...newProps}>
|
|
239
|
+
<label>
|
|
240
|
+
<p className={cx('block mb-2', isInvalid && 'text-sun-800')}>
|
|
241
|
+
{labelText}
|
|
242
|
+
{isRequired && <span className="text-sun-800">&nbsp;*</span>}
|
|
243
|
+
</p>
|
|
244
|
+
{children}
|
|
245
|
+
{helperText && (
|
|
246
|
+
<p
|
|
247
|
+
id={context.helperTextId}
|
|
248
|
+
className="text-sm text-sumi-700 mt-2"
|
|
249
|
+
>
|
|
250
|
+
{helperText}
|
|
251
|
+
</p>
|
|
252
|
+
)}
|
|
253
|
+
{isInvalid && (
|
|
254
|
+
<p
|
|
255
|
+
id={context.errorMessageId}
|
|
256
|
+
className={cx(
|
|
257
|
+
'text-sm text-sun-800',
|
|
258
|
+
helperText ? 'mt-1' : 'mt-2'
|
|
259
|
+
)}
|
|
260
|
+
>
|
|
261
|
+
{errorMessage}
|
|
262
|
+
</p>
|
|
263
|
+
)}
|
|
264
|
+
</label>
|
|
265
|
+
</div>
|
|
266
|
+
</ControllerContext.Provider>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
270
|
</pre></td></tr></table></pre>
|
|
271
271
|
|
|
272
272
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -274,7 +274,7 @@ export const LabelControl = React.forwardRef<
|
|
|
274
274
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
275
275
|
Code coverage generated by
|
|
276
276
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
277
|
-
at 2023-03-
|
|
277
|
+
at 2023-03-27T00:09:49.121Z
|
|
278
278
|
</div>
|
|
279
279
|
<script src="../../prettify.js"></script>
|
|
280
280
|
<script>
|
|
@@ -224,7 +224,7 @@ export const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref
|
|
|
224
224
|
`
|
|
225
225
|
return (
|
|
226
226
|
<label htmlFor={newProps.id} className={cx(style, className)}>
|
|
227
|
-
<
|
|
227
|
+
<div className="flex items-center">
|
|
228
228
|
<input
|
|
229
229
|
className={styleInput}
|
|
230
230
|
type="radio"
|
|
@@ -236,7 +236,7 @@ export const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref
|
|
|
236
236
|
/>
|
|
237
237
|
<span className={styleRadio}></span>
|
|
238
238
|
{children}
|
|
239
|
-
</
|
|
239
|
+
</div>
|
|
240
240
|
</label>
|
|
241
241
|
)
|
|
242
242
|
})
|
|
@@ -247,7 +247,7 @@ export const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref
|
|
|
247
247
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
248
248
|
Code coverage generated by
|
|
249
249
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
250
|
-
at 2023-03-
|
|
250
|
+
at 2023-03-27T00:09:49.121Z
|
|
251
251
|
</div>
|
|
252
252
|
<script src="../../prettify.js"></script>
|
|
253
253
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">36.36% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>4/11</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/5</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/1</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">36.36% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>4/11</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -119,9 +119,7 @@
|
|
|
119
119
|
<a name='L54'></a><a href='#L54'>54</a>
|
|
120
120
|
<a name='L55'></a><a href='#L55'>55</a>
|
|
121
121
|
<a name='L56'></a><a href='#L56'>56</a>
|
|
122
|
-
<a name='L57'></a><a href='#L57'>57</a>
|
|
123
|
-
<a name='L58'></a><a href='#L58'>58</a>
|
|
124
|
-
<a name='L59'></a><a href='#L59'>59</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
122
|
+
<a name='L57'></a><a href='#L57'>57</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
125
123
|
<span class="cline-any cline-yes">4x</span>
|
|
126
124
|
<span class="cline-any cline-yes">4x</span>
|
|
127
125
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -129,17 +127,15 @@
|
|
|
129
127
|
<span class="cline-any cline-neutral"> </span>
|
|
130
128
|
<span class="cline-any cline-yes">4x</span>
|
|
131
129
|
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-
|
|
133
|
-
<span class="cline-any cline-
|
|
134
|
-
<span class="cline-any cline-
|
|
130
|
+
<span class="cline-any cline-no"> </span>
|
|
131
|
+
<span class="cline-any cline-no"> </span>
|
|
132
|
+
<span class="cline-any cline-no"> </span>
|
|
135
133
|
<span class="cline-any cline-no"> </span>
|
|
136
134
|
<span class="cline-any cline-neutral"> </span>
|
|
137
135
|
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-
|
|
139
|
-
<span class="cline-any cline-neutral"> </span>
|
|
140
|
-
<span class="cline-any cline-yes">2x</span>
|
|
141
|
-
<span class="cline-any cline-neutral"> </span>
|
|
136
|
+
<span class="cline-any cline-no"> </span>
|
|
142
137
|
<span class="cline-any cline-neutral"> </span>
|
|
138
|
+
<span class="cline-any cline-no"> </span>
|
|
143
139
|
<span class="cline-any cline-neutral"> </span>
|
|
144
140
|
<span class="cline-any cline-neutral"> </span>
|
|
145
141
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -152,8 +148,8 @@
|
|
|
152
148
|
<span class="cline-any cline-neutral"> </span>
|
|
153
149
|
<span class="cline-any cline-neutral"> </span>
|
|
154
150
|
<span class="cline-any cline-neutral"> </span>
|
|
155
|
-
<span class="cline-any cline-yes">2x</span>
|
|
156
151
|
<span class="cline-any cline-neutral"> </span>
|
|
152
|
+
<span class="cline-any cline-no"> </span>
|
|
157
153
|
<span class="cline-any cline-neutral"> </span>
|
|
158
154
|
<span class="cline-any cline-neutral"> </span>
|
|
159
155
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -186,17 +182,16 @@ import { ControllerContext } from './context'
|
|
|
186
182
|
export interface SelectProps extends React.ComponentPropsWithoutRef<'select'> {}
|
|
187
183
|
|
|
188
184
|
export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
189
|
-
(
|
|
190
|
-
const { className, children, ...
|
|
191
|
-
const ctx = React.useContext(ControllerContext)
|
|
192
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (ctx.isRequired) {
|
|
193
|
-
<span class="cstat-no" title="statement not covered" >
|
|
185
|
+
<span class="fstat-no" title="function not covered" > (p</span>rops, ref) => {
|
|
186
|
+
const { className, children, ...newProps } = <span class="cstat-no" title="statement not covered" >props</span>
|
|
187
|
+
const ctx = <span class="cstat-no" title="statement not covered" >React.useContext(ControllerContext)</span>
|
|
188
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (ctx.isRequired) {</span>
|
|
189
|
+
<span class="cstat-no" title="statement not covered" > newProps.required = true</span>
|
|
194
190
|
}
|
|
195
191
|
|
|
196
|
-
const invalidStyle =
|
|
192
|
+
const invalidStyle = <span class="cstat-no" title="statement not covered" >ctx.isInvalid ? 'border-sun-800' : 'border-sumi-900'</span>
|
|
197
193
|
|
|
198
|
-
const style =
|
|
199
|
-
cursor-pointer
|
|
194
|
+
const style = <span class="cstat-no" title="statement not covered" >`</span>
|
|
200
195
|
appearance-none
|
|
201
196
|
text-base
|
|
202
197
|
w-full
|
|
@@ -210,20 +205,19 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
210
205
|
focus:outline-wood-500
|
|
211
206
|
`
|
|
212
207
|
|
|
213
|
-
return (
|
|
214
|
-
<
|
|
208
|
+
<span class="cstat-no" title="statement not covered" > return (</span>
|
|
209
|
+
<div className="inline-block relative">
|
|
215
210
|
<select
|
|
216
|
-
id={restProps.id ?? ctx.id}
|
|
217
211
|
className={cx(style, invalidStyle, props.className)}
|
|
218
212
|
aria-describedby={ctx.helperTextId}
|
|
219
213
|
aria-errormessage={ctx.errorMessageId}
|
|
220
|
-
aria-invalid={ctx.isInvalid ??
|
|
221
|
-
{...
|
|
214
|
+
aria-invalid={ctx.isInvalid ?? false}
|
|
215
|
+
{...newProps}
|
|
222
216
|
ref={ref}
|
|
223
217
|
>
|
|
224
218
|
{children}
|
|
225
219
|
</select>
|
|
226
|
-
<
|
|
220
|
+
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2">
|
|
227
221
|
<svg
|
|
228
222
|
xmlns="http://www.w3.org/2000/svg"
|
|
229
223
|
className="fill-sumi-900"
|
|
@@ -232,8 +226,8 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
232
226
|
>
|
|
233
227
|
<path d="M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z" />
|
|
234
228
|
</svg>
|
|
235
|
-
</
|
|
236
|
-
</
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
237
231
|
)
|
|
238
232
|
}
|
|
239
233
|
)
|
|
@@ -244,7 +238,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
244
238
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
245
239
|
Code coverage generated by
|
|
246
240
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
247
|
-
at 2023-03-
|
|
241
|
+
at 2023-03-27T00:09:49.121Z
|
|
248
242
|
</div>
|
|
249
243
|
<script src="../../prettify.js"></script>
|
|
250
244
|
<script>
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">80% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>4/5</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -107,8 +107,7 @@
|
|
|
107
107
|
<a name='L42'></a><a href='#L42'>42</a>
|
|
108
108
|
<a name='L43'></a><a href='#L43'>43</a>
|
|
109
109
|
<a name='L44'></a><a href='#L44'>44</a>
|
|
110
|
-
<a name='L45'></a><a href='#L45'>45</a>
|
|
111
|
-
<a name='L46'></a><a href='#L46'>46</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
110
|
+
<a name='L45'></a><a href='#L45'>45</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
112
111
|
<span class="cline-any cline-yes">4x</span>
|
|
113
112
|
<span class="cline-any cline-yes">4x</span>
|
|
114
113
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -116,15 +115,15 @@
|
|
|
116
115
|
<span class="cline-any cline-neutral"> </span>
|
|
117
116
|
<span class="cline-any cline-yes">4x</span>
|
|
118
117
|
<span class="cline-any cline-neutral"> </span>
|
|
119
|
-
<span class="cline-any cline-yes">
|
|
120
|
-
<span class="cline-any cline-yes">
|
|
121
|
-
<span class="cline-any cline-yes">
|
|
118
|
+
<span class="cline-any cline-yes">6x</span>
|
|
119
|
+
<span class="cline-any cline-yes">6x</span>
|
|
120
|
+
<span class="cline-any cline-yes">6x</span>
|
|
122
121
|
<span class="cline-any cline-yes">2x</span>
|
|
123
122
|
<span class="cline-any cline-neutral"> </span>
|
|
124
123
|
<span class="cline-any cline-neutral"> </span>
|
|
125
|
-
<span class="cline-any cline-yes">
|
|
124
|
+
<span class="cline-any cline-yes">6x</span>
|
|
126
125
|
<span class="cline-any cline-neutral"> </span>
|
|
127
|
-
<span class="cline-any cline-yes">
|
|
126
|
+
<span class="cline-any cline-yes">6x</span>
|
|
128
127
|
<span class="cline-any cline-neutral"> </span>
|
|
129
128
|
<span class="cline-any cline-neutral"> </span>
|
|
130
129
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -139,8 +138,7 @@
|
|
|
139
138
|
<span class="cline-any cline-neutral"> </span>
|
|
140
139
|
<span class="cline-any cline-neutral"> </span>
|
|
141
140
|
<span class="cline-any cline-neutral"> </span>
|
|
142
|
-
<span class="cline-any cline-yes">
|
|
143
|
-
<span class="cline-any cline-neutral"> </span>
|
|
141
|
+
<span class="cline-any cline-yes">6x</span>
|
|
144
142
|
<span class="cline-any cline-neutral"> </span>
|
|
145
143
|
<span class="cline-any cline-neutral"> </span>
|
|
146
144
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -161,10 +159,10 @@ export interface TextProps extends React.ComponentPropsWithoutRef<'input'>
|
|
|
161
159
|
|
|
162
160
|
export const Text = React.forwardRef<HTMLInputElement, TextProps>(
|
|
163
161
|
(props, ref) => {
|
|
164
|
-
const { className, ...
|
|
162
|
+
const { className, ...newProps } = props
|
|
165
163
|
const ctx = React.useContext(ControllerContext)
|
|
166
164
|
if (ctx.isRequired) {
|
|
167
|
-
|
|
165
|
+
newProps.required = true
|
|
168
166
|
}
|
|
169
167
|
|
|
170
168
|
const invalidStyle = ctx.isInvalid ? 'border-sun-800' : 'border-sumi-900'
|
|
@@ -187,12 +185,11 @@ export const Text = React.forwardRef<HTMLInputElement, TextProps>(
|
|
|
187
185
|
return (
|
|
188
186
|
<input
|
|
189
187
|
type="text"
|
|
190
|
-
id={restProps.id ?? ctx.id}
|
|
191
188
|
className={cx(style, invalidStyle, className)}
|
|
192
189
|
aria-describedby={ctx.helperTextId}
|
|
193
190
|
aria-errormessage={ctx.errorMessageId}
|
|
194
191
|
aria-invalid={ctx.isInvalid ?? <span class="branch-1 cbranch-no" title="branch not covered" >false}</span>
|
|
195
|
-
{...
|
|
192
|
+
{...newProps}
|
|
196
193
|
ref={ref}
|
|
197
194
|
/>
|
|
198
195
|
)
|
|
@@ -205,7 +202,7 @@ export const Text = React.forwardRef<HTMLInputElement, TextProps>(
|
|
|
205
202
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
206
203
|
Code coverage generated by
|
|
207
204
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
208
|
-
at 2023-03-
|
|
205
|
+
at 2023-03-27T00:09:49.121Z
|
|
209
206
|
</div>
|
|
210
207
|
<script src="../../prettify.js"></script>
|
|
211
208
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">36.36% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>4/11</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/5</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/1</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">36.36% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>4/11</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -110,8 +110,7 @@
|
|
|
110
110
|
<a name='L45'></a><a href='#L45'>45</a>
|
|
111
111
|
<a name='L46'></a><a href='#L46'>46</a>
|
|
112
112
|
<a name='L47'></a><a href='#L47'>47</a>
|
|
113
|
-
<a name='L48'></a><a href='#L48'>48</a>
|
|
114
|
-
<a name='L49'></a><a href='#L49'>49</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
113
|
+
<a name='L48'></a><a href='#L48'>48</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
115
114
|
<span class="cline-any cline-yes">4x</span>
|
|
116
115
|
<span class="cline-any cline-yes">4x</span>
|
|
117
116
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -120,17 +119,16 @@
|
|
|
120
119
|
<span class="cline-any cline-neutral"> </span>
|
|
121
120
|
<span class="cline-any cline-yes">4x</span>
|
|
122
121
|
<span class="cline-any cline-neutral"> </span>
|
|
123
|
-
<span class="cline-any cline-yes">2x</span>
|
|
124
|
-
<span class="cline-any cline-neutral"> </span>
|
|
125
|
-
<span class="cline-any cline-yes">2x</span>
|
|
126
|
-
<span class="cline-any cline-yes">2x</span>
|
|
127
122
|
<span class="cline-any cline-no"> </span>
|
|
128
123
|
<span class="cline-any cline-neutral"> </span>
|
|
124
|
+
<span class="cline-any cline-no"> </span>
|
|
125
|
+
<span class="cline-any cline-no"> </span>
|
|
126
|
+
<span class="cline-any cline-no"> </span>
|
|
129
127
|
<span class="cline-any cline-neutral"> </span>
|
|
130
|
-
<span class="cline-any cline-yes">2x</span>
|
|
131
128
|
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-
|
|
129
|
+
<span class="cline-any cline-no"> </span>
|
|
133
130
|
<span class="cline-any cline-neutral"> </span>
|
|
131
|
+
<span class="cline-any cline-no"> </span>
|
|
134
132
|
<span class="cline-any cline-neutral"> </span>
|
|
135
133
|
<span class="cline-any cline-neutral"> </span>
|
|
136
134
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -144,8 +142,8 @@
|
|
|
144
142
|
<span class="cline-any cline-neutral"> </span>
|
|
145
143
|
<span class="cline-any cline-neutral"> </span>
|
|
146
144
|
<span class="cline-any cline-neutral"> </span>
|
|
147
|
-
<span class="cline-any cline-yes">2x</span>
|
|
148
145
|
<span class="cline-any cline-neutral"> </span>
|
|
146
|
+
<span class="cline-any cline-no"> </span>
|
|
149
147
|
<span class="cline-any cline-neutral"> </span>
|
|
150
148
|
<span class="cline-any cline-neutral"> </span>
|
|
151
149
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -167,17 +165,17 @@ export interface TextareaProps
|
|
|
167
165
|
extends React.ComponentPropsWithoutRef<'textarea'> {}
|
|
168
166
|
|
|
169
167
|
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
170
|
-
(
|
|
171
|
-
const { className, children, ...
|
|
168
|
+
<span class="fstat-no" title="function not covered" > (p</span>rops, ref) => {
|
|
169
|
+
const { className, children, ...newProps } = <span class="cstat-no" title="statement not covered" >props</span>
|
|
172
170
|
|
|
173
|
-
const ctx = React.useContext(ControllerContext)
|
|
174
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (ctx.isRequired) {
|
|
175
|
-
<span class="cstat-no" title="statement not covered" >
|
|
171
|
+
const ctx = <span class="cstat-no" title="statement not covered" >React.useContext(ControllerContext)</span>
|
|
172
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (ctx.isRequired) {</span>
|
|
173
|
+
<span class="cstat-no" title="statement not covered" > newProps.required = true</span>
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
const invalidStyle =
|
|
176
|
+
const invalidStyle = <span class="cstat-no" title="statement not covered" >ctx.isInvalid ? 'border-sun-800' : 'border-sumi-900'</span>
|
|
179
177
|
|
|
180
|
-
const style =
|
|
178
|
+
const style = <span class="cstat-no" title="statement not covered" >`</span>
|
|
181
179
|
p-4
|
|
182
180
|
rounded-lg
|
|
183
181
|
border
|
|
@@ -192,14 +190,13 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps&g
|
|
|
192
190
|
disabled:border-sumi-500
|
|
193
191
|
`
|
|
194
192
|
|
|
195
|
-
return (
|
|
193
|
+
<span class="cstat-no" title="statement not covered" > return (</span>
|
|
196
194
|
<textarea
|
|
197
|
-
id={restProps.id ?? ctx.id}
|
|
198
195
|
className={cx(style, invalidStyle, className)}
|
|
199
196
|
aria-describedby={ctx.helperTextId}
|
|
200
197
|
aria-errormessage={ctx.errorMessageId}
|
|
201
|
-
aria-invalid={ctx.isInvalid ??
|
|
202
|
-
{...
|
|
198
|
+
aria-invalid={ctx.isInvalid ?? false}
|
|
199
|
+
{...newProps}
|
|
203
200
|
ref={ref}
|
|
204
201
|
>
|
|
205
202
|
{children}
|
|
@@ -214,7 +211,7 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps&g
|
|
|
214
211
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
215
212
|
Code coverage generated by
|
|
216
213
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
217
|
-
at 2023-03-
|
|
214
|
+
at 2023-03-27T00:09:49.121Z
|
|
218
215
|
</div>
|
|
219
216
|
<script src="../../prettify.js"></script>
|
|
220
217
|
<script>
|
|
@@ -79,9 +79,7 @@
|
|
|
79
79
|
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
80
|
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
81
|
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
84
|
-
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<a name='L17'></a><a href='#L17'>17</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">4x</span>
|
|
85
83
|
<span class="cline-any cline-neutral"> </span>
|
|
86
84
|
<span class="cline-any cline-neutral"> </span>
|
|
87
85
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -100,7 +98,6 @@
|
|
|
100
98
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react'
|
|
101
99
|
|
|
102
100
|
export interface ControllerContextType {
|
|
103
|
-
id?: string
|
|
104
101
|
groupName?: string
|
|
105
102
|
helperTextId: string
|
|
106
103
|
errorMessageId: string
|
|
@@ -121,7 +118,7 @@ export const ControllerContext = React.createContext<ControllerContextType>
|
|
|
121
118
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
122
119
|
Code coverage generated by
|
|
123
120
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
124
|
-
at 2023-03-
|
|
121
|
+
at 2023-03-27T00:09:49.121Z
|
|
125
122
|
</div>
|
|
126
123
|
<script src="../../prettify.js"></script>
|
|
127
124
|
<script>
|