@adea-ai/ui 0.81.0 → 0.82.0
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 +41 -8
- package/dist/components/composites/account-menu/account-menu.d.ts +5 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +122 -70
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts +27 -0
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -0
- package/dist/components/composites/action-button/action-button.js +121 -0
- package/dist/components/composites/action-button/action-button.js.map +1 -0
- package/dist/components/composites/action-button/index.d.ts +3 -0
- package/dist/components/composites/action-button/index.d.ts.map +1 -0
- package/dist/components/composites/action-button/index.js +2 -0
- package/dist/components/conversation/thread-panel.d.ts +2 -0
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +36 -31
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/layout/sidebar-nav/index.d.ts +1 -1
- package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +6 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +66 -62
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/ui/board/board.d.ts.map +1 -1
- package/dist/components/ui/board/board.js +54 -7
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/command/command.d.ts +5 -1
- package/dist/components/ui/command/command.d.ts.map +1 -1
- package/dist/components/ui/command/command.js +8 -3
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/input/index.d.ts +1 -1
- package/dist/components/ui/input/index.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts +5 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +36 -17
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint.js +47 -7
- package/dist/lint.js.map +1 -1
- package/dist/r/account-menu.json +1 -0
- package/dist/r/action-button.json +24 -0
- package/dist/r/conversation.json +1 -0
- package/dist/r/registry.json +26 -0
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +100 -44
- package/dist/r/src/components/composites/action-button/action-button.tsx +139 -0
- package/dist/r/src/components/composites/action-button/index.ts +2 -0
- package/dist/r/src/components/conversation/thread-panel.tsx +22 -12
- package/dist/r/src/components/layout/sidebar-nav/index.ts +1 -0
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +29 -21
- package/dist/r/src/components/ui/board/board.tsx +74 -6
- package/dist/r/src/components/ui/command/command.tsx +15 -4
- package/dist/r/src/components/ui/input/index.ts +1 -1
- package/dist/r/src/components/ui/input/input.tsx +38 -21
- package/package.json +1 -1
- package/registry.json +26 -0
- package/src/components/composites/account-menu/account-menu.tsx +100 -44
- package/src/components/composites/action-button/action-button.tsx +139 -0
- package/src/components/composites/action-button/index.ts +2 -0
- package/src/components/conversation/thread-panel.tsx +22 -12
- package/src/components/layout/sidebar-nav/index.ts +1 -0
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +29 -21
- package/src/components/ui/board/board.tsx +74 -6
- package/src/components/ui/command/command.tsx +15 -4
- package/src/components/ui/input/index.ts +1 -1
- package/src/components/ui/input/input.tsx +38 -21
- package/src/index.ts +1 -0
- package/src/lint/index.ts +71 -7
package/src/lint/index.ts
CHANGED
|
@@ -111,11 +111,14 @@ interface PrimitiveImportOptions {
|
|
|
111
111
|
|
|
112
112
|
const DEFAULT_PRIMITIVE_PACKAGES = Object.freeze([
|
|
113
113
|
'@kobalte/core',
|
|
114
|
+
'@corvu',
|
|
115
|
+
'cmdk-solid',
|
|
114
116
|
'@ark-ui',
|
|
115
117
|
'@zag-js',
|
|
116
118
|
'@radix-ui',
|
|
117
119
|
'radix-ui',
|
|
118
120
|
'@base-ui-components',
|
|
121
|
+
'@base-ui',
|
|
119
122
|
])
|
|
120
123
|
|
|
121
124
|
/**
|
|
@@ -166,7 +169,20 @@ const GENERIC_ELEMENTS: ReadonlySet<string> = new Set([
|
|
|
166
169
|
'svg',
|
|
167
170
|
])
|
|
168
171
|
|
|
169
|
-
const CLICK_HANDLERS: ReadonlySet<string> = new Set([
|
|
172
|
+
const CLICK_HANDLERS: ReadonlySet<string> = new Set([
|
|
173
|
+
'onClick',
|
|
174
|
+
'onDoubleClick',
|
|
175
|
+
'onPointerDown',
|
|
176
|
+
'onPointerUp',
|
|
177
|
+
'onMouseDown',
|
|
178
|
+
'onMouseUp',
|
|
179
|
+
'on:click',
|
|
180
|
+
'on:dblclick',
|
|
181
|
+
'on:pointerdown',
|
|
182
|
+
'on:pointerup',
|
|
183
|
+
'on:mousedown',
|
|
184
|
+
'on:mouseup',
|
|
185
|
+
])
|
|
170
186
|
|
|
171
187
|
interface InteractiveWrapperOptions {
|
|
172
188
|
/** Element names this rule should not report (rare; prefer fixing the file). */
|
|
@@ -175,13 +191,25 @@ interface InteractiveWrapperOptions {
|
|
|
175
191
|
message?: string
|
|
176
192
|
}
|
|
177
193
|
|
|
178
|
-
/**
|
|
194
|
+
/** Only statically knowable branches; unresolved roles remain a review boundary. */
|
|
195
|
+
const staticStrings = (node: any): string[] => {
|
|
196
|
+
if (node?.type === 'Literal' && typeof node.value === 'string') return [node.value]
|
|
197
|
+
if (node?.type === 'JSXExpressionContainer') return staticStrings(node.expression)
|
|
198
|
+
if (node?.type === 'ConditionalExpression')
|
|
199
|
+
return [...staticStrings(node.consequent), ...staticStrings(node.alternate)]
|
|
200
|
+
if (node?.type === 'TemplateLiteral' && node.expressions.length === 0)
|
|
201
|
+
return [node.quasis[0].value.cooked ?? node.quasis[0].value.raw]
|
|
202
|
+
return []
|
|
203
|
+
}
|
|
204
|
+
|
|
179
205
|
const roleOf = (node: any): string | null => {
|
|
180
206
|
for (const attribute of node.attributes ?? []) {
|
|
181
207
|
if (attribute.type !== 'JSXAttribute' || attribute.name?.name !== 'role') continue
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
208
|
+
return (
|
|
209
|
+
staticStrings(attribute.value)
|
|
210
|
+
.flatMap((role) => role.split(/\s+/))
|
|
211
|
+
.find((role) => role in ROLE_PRIMITIVES) ?? null
|
|
212
|
+
)
|
|
185
213
|
}
|
|
186
214
|
return null
|
|
187
215
|
}
|
|
@@ -189,9 +217,34 @@ const roleOf = (node: any): string | null => {
|
|
|
189
217
|
/** Whether the element carries the attribute, by name. */
|
|
190
218
|
const has = (node: any, name: string): boolean =>
|
|
191
219
|
(node.attributes ?? []).some(
|
|
192
|
-
(attribute: any) =>
|
|
220
|
+
(attribute: any) =>
|
|
221
|
+
attribute.type === 'JSXAttribute' &&
|
|
222
|
+
(attribute.name?.type === 'JSXNamespacedName'
|
|
223
|
+
? `${attribute.name.namespace.name}:${attribute.name.name.name}`
|
|
224
|
+
: attribute.name?.name) === name
|
|
193
225
|
)
|
|
194
226
|
|
|
227
|
+
const hasTabStop = (node: any): boolean =>
|
|
228
|
+
(node.attributes ?? []).some((attribute: any) => {
|
|
229
|
+
if (
|
|
230
|
+
attribute.type !== 'JSXAttribute' ||
|
|
231
|
+
!['tabIndex', 'tabindex'].includes(attribute.name?.name)
|
|
232
|
+
)
|
|
233
|
+
return false
|
|
234
|
+
const value =
|
|
235
|
+
attribute.value?.type === 'JSXExpressionContainer'
|
|
236
|
+
? attribute.value.expression
|
|
237
|
+
: attribute.value
|
|
238
|
+
if (value?.type === 'Literal') return !(Number(value.value) < 0)
|
|
239
|
+
if (
|
|
240
|
+
value?.type === 'UnaryExpression' &&
|
|
241
|
+
value.operator === '-' &&
|
|
242
|
+
value.argument?.type === 'Literal'
|
|
243
|
+
)
|
|
244
|
+
return !(Number(value.argument.value) > 0)
|
|
245
|
+
return true
|
|
246
|
+
})
|
|
247
|
+
|
|
195
248
|
const noInteractiveWrappers: RuleModule = {
|
|
196
249
|
meta: {
|
|
197
250
|
type: 'problem',
|
|
@@ -255,7 +308,7 @@ const noInteractiveWrappers: RuleModule = {
|
|
|
255
308
|
})
|
|
256
309
|
return
|
|
257
310
|
}
|
|
258
|
-
if (
|
|
311
|
+
if (hasTabStop(node)) {
|
|
259
312
|
context.report({
|
|
260
313
|
node,
|
|
261
314
|
messageId: 'tabindexWrapper',
|
|
@@ -315,6 +368,17 @@ const noPrimitiveLibraryImports: RuleModule = {
|
|
|
315
368
|
if (typeof node.source?.value === 'string' && offender(node.source.value))
|
|
316
369
|
report(node, node.source.value)
|
|
317
370
|
},
|
|
371
|
+
ExportNamedDeclaration(node: any) {
|
|
372
|
+
if (offender(node.source?.value)) report(node, node.source.value)
|
|
373
|
+
},
|
|
374
|
+
ExportAllDeclaration(node: any) {
|
|
375
|
+
if (offender(node.source?.value)) report(node, node.source.value)
|
|
376
|
+
},
|
|
377
|
+
CallExpression(node: any) {
|
|
378
|
+
if (node.callee?.type !== 'Identifier' || node.callee.name !== 'require') return
|
|
379
|
+
const source = node.arguments?.[0]?.value
|
|
380
|
+
if (typeof source === 'string' && offender(source)) report(node, source)
|
|
381
|
+
},
|
|
318
382
|
}
|
|
319
383
|
},
|
|
320
384
|
}
|