@rebasepro/ui 0.13.0 → 0.13.1-canary.g3660bd5

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/ui",
3
3
  "type": "module",
4
- "version": "0.13.0",
4
+ "version": "0.13.1-canary.g3660bd5",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -29,14 +29,21 @@ export function Skeleton({
29
29
 
30
30
  return <span
31
31
  style={{
32
- width: width ? `${width}px` : "100%",
33
- height: height ? `${height}px` : "12px"
32
+ width: width === undefined ? undefined : `${width}px`,
33
+ height: height === undefined ? undefined : `${height}px`
34
34
  }}
35
35
  className={
36
36
  cls(
37
37
  "block relative overflow-hidden",
38
38
  "bg-surface-accent-50 dark:bg-surface-accent-800 rounded-md",
39
39
  "max-w-full max-h-full",
40
+ // The defaults are classes, not inline styles, so that a caller can
41
+ // override them: an inline style beats every utility, which is why
42
+ // `<Skeleton className="w-full h-full"/>` inside a 40px thumbnail
43
+ // box used to render a 12px bar. The `width`/`height` props still
44
+ // win over any class, since those do land inline.
45
+ width === undefined ? "w-full" : undefined,
46
+ height === undefined ? "h-3" : undefined,
40
47
  className)
41
48
  }>
42
49
  <span
@@ -22,6 +22,13 @@ export function VirtualTableDateField(props: {
22
22
  <DateTimeField
23
23
  value={internalValue ?? undefined}
24
24
  onChange={(dateValue) => updateValue(dateValue ?? null)}
25
+ // Same omission as `VirtualTableInput`: destructured and forwarded
26
+ // nowhere, so a disabled date cell was still editable. `error` went
27
+ // the same way — it drives `DateTimeField`'s invalid styling, and a
28
+ // prop a caller passes should reach something rather than sit in a
29
+ // destructure.
30
+ disabled={disabled}
31
+ error={Boolean(error)}
25
32
  invisible={true}
26
33
  // Without this the field falls back to DateTimeField's own default of
27
34
  // `size="large"` (min-h-64px), which overflows a table cell and makes
@@ -50,6 +50,13 @@ export function VirtualTableInput(props: {
50
50
  <TextareaAutosize
51
51
  className={focusedDisabled}
52
52
  ref={ref}
53
+ // Destructured above and passed to nothing, so a property carrying
54
+ // `admin: { disabled: true }` stayed typeable in the table and the
55
+ // debounced write fired on blur. `readOnly` as well as `disabled`:
56
+ // a disabled textarea is skipped by keyboard navigation, and a cell
57
+ // you cannot tab through is worse than one you cannot edit.
58
+ disabled={disabled}
59
+ readOnly={disabled}
53
60
  style={{
54
61
  padding: 0,
55
62
  margin: 0,
@@ -323,7 +323,13 @@ export function CollectionView<T extends Record<string, unknown> = Record<string
323
323
  <CollectionKanbanView<T>
324
324
  {...sharedProps}
325
325
  kanbanProperty={resolvedKanbanProperty}
326
- onRowCreate={onRowCreate}
326
+ // `canCreate` is documented as "whether creation is
327
+ // allowed (shows the + button)" and was destructured
328
+ // and read nowhere, so the button showed regardless.
329
+ // The kanban view draws its add affordance exactly when
330
+ // it has a callback, so withholding the callback is
331
+ // what the prop means.
332
+ onRowCreate={canCreate ? onRowCreate : undefined}
327
333
  />
328
334
  ) : (
329
335
  <div className="flex items-center justify-center p-8">