@duro-app/ui 0.17.0 → 0.17.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duro-app/ui",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@duro-app/tokens": "^0.17.0"
55
+ "@duro-app/tokens": "^0.17.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/preset-typescript": "^7.28.0",
@@ -50,7 +50,16 @@ function ControlledRoot({
50
50
  },
51
51
  errorMessage: fieldState.error?.message,
52
52
  }),
53
- [id, invalid, field.value, field.onChange, field.onBlur, field.ref, field.name, fieldState.error],
53
+ [
54
+ id,
55
+ invalid,
56
+ field.value,
57
+ field.onChange,
58
+ field.onBlur,
59
+ field.ref,
60
+ field.name,
61
+ fieldState.error,
62
+ ],
54
63
  )
55
64
 
56
65
  return (
@@ -93,11 +93,7 @@ export const ValidationOnBlur: Story = {
93
93
  name: 'Validation — on blur',
94
94
  render: () => (
95
95
  <html.div style={wrapStyles.wrap}>
96
- <Form
97
- schema={LoginSchema}
98
- defaultValues={{username: '', password: ''}}
99
- onSubmit={fn()}
100
- >
96
+ <Form schema={LoginSchema} defaultValues={{username: '', password: ''}} onSubmit={fn()}>
101
97
  <Fieldset.Root gap="md">
102
98
  <Field.Root name="username">
103
99
  <Field.Label>Username</Field.Label>
@@ -131,10 +127,13 @@ export const ValidationOnBlur: Story = {
131
127
  await expect(alert).toHaveTextContent('Username must be at least 3 characters')
132
128
  })
133
129
 
134
- await step('Fix username by typing more — error clears (reValidateMode: onChange)', async () => {
135
- await userEvent.type(usernameInput, 'c') // now "abc"
136
- expect(canvas.queryByText('Username must be at least 3 characters')).not.toBeInTheDocument()
137
- })
130
+ await step(
131
+ 'Fix username by typing more — error clears (reValidateMode: onChange)',
132
+ async () => {
133
+ await userEvent.type(usernameInput, 'c') // now "abc"
134
+ expect(canvas.queryByText('Username must be at least 3 characters')).not.toBeInTheDocument()
135
+ },
136
+ )
138
137
 
139
138
  await step('Blur empty password — error appears', async () => {
140
139
  await userEvent.click(passwordInput)
@@ -150,11 +149,7 @@ export const WithTextarea: Story = {
150
149
  name: 'With Textarea',
151
150
  render: () => (
152
151
  <html.div style={wrapStyles.wrap}>
153
- <Form
154
- schema={FeedbackSchema}
155
- defaultValues={{email: '', message: ''}}
156
- onSubmit={fn()}
157
- >
152
+ <Form schema={FeedbackSchema} defaultValues={{email: '', message: ''}} onSubmit={fn()}>
158
153
  {({formState}) => (
159
154
  <Fieldset.Root gap="md">
160
155
  <Field.Root name="email">
@@ -193,11 +188,7 @@ export const SuccessfulSubmit: Story = {
193
188
  const onSubmit = fn()
194
189
  return (
195
190
  <html.div style={wrapStyles.wrap}>
196
- <Form
197
- schema={LoginSchema}
198
- defaultValues={{username: '', password: ''}}
199
- onSubmit={onSubmit}
200
- >
191
+ <Form schema={LoginSchema} defaultValues={{username: '', password: ''}} onSubmit={onSubmit}>
201
192
  <Fieldset.Root gap="md">
202
193
  <Field.Root name="username">
203
194
  <Field.Label>Username</Field.Label>