@djangocfg/ui-tools 2.1.425 → 2.1.427

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": "@djangocfg/ui-tools",
3
- "version": "2.1.425",
3
+ "version": "2.1.427",
4
4
  "description": "Heavy React tools with lazy loading - for Electron, Vite, CRA, Next.js apps",
5
5
  "keywords": [
6
6
  "ui-tools",
@@ -77,9 +77,9 @@
77
77
  "require": "./dist/audio-player/index.cjs"
78
78
  },
79
79
  "./chat": {
80
- "types": "./src/tools/Chat/lazy.tsx",
81
- "import": "./src/tools/Chat/lazy.tsx",
82
- "require": "./src/tools/Chat/lazy.tsx"
80
+ "types": "./src/tools/chat/lazy.tsx",
81
+ "import": "./src/tools/chat/lazy.tsx",
82
+ "require": "./src/tools/chat/lazy.tsx"
83
83
  },
84
84
  "./cron-scheduler": {
85
85
  "types": "./src/tools/input/CronScheduler/lazy.tsx",
@@ -329,8 +329,8 @@
329
329
  "test:watch": "vitest"
330
330
  },
331
331
  "peerDependencies": {
332
- "@djangocfg/i18n": "^2.1.425",
333
- "@djangocfg/ui-core": "^2.1.425",
332
+ "@djangocfg/i18n": "^2.1.427",
333
+ "@djangocfg/ui-core": "^2.1.427",
334
334
  "consola": "^3.4.2",
335
335
  "lodash-es": "^4.18.1",
336
336
  "lucide-react": "^0.545.0",
@@ -405,9 +405,9 @@
405
405
  "@maplibre/maplibre-gl-geocoder": "^1.7.0"
406
406
  },
407
407
  "devDependencies": {
408
- "@djangocfg/i18n": "^2.1.425",
409
- "@djangocfg/typescript-config": "^2.1.425",
410
- "@djangocfg/ui-core": "^2.1.425",
408
+ "@djangocfg/i18n": "^2.1.427",
409
+ "@djangocfg/typescript-config": "^2.1.427",
410
+ "@djangocfg/ui-core": "^2.1.427",
411
411
  "@types/lodash-es": "^4.17.12",
412
412
  "@types/mapbox__mapbox-gl-draw": "^1.4.8",
413
413
  "@types/node": "^25.2.3",
@@ -6,7 +6,7 @@
6
6
  * sibling of `lib/page-snapshot/`, so it must NOT reach up into `tools/` —
7
7
  * the bridge is infrastructure, Chat is merely a consumer.
8
8
  *
9
- * Mirrors the gating of the chat logger (`tools/Chat/core/logger.ts`): the
9
+ * Mirrors the gating of the chat logger (`tools/chat/core/logger.ts`): the
10
10
  * `chat:directives` sub-logger is silenced unless `isDev`, so noisy bridge
11
11
  * events never leak into production builds. Kept local and minimal — only
12
12
  * the `directives` scope is needed here.
@@ -15,7 +15,7 @@ import {
15
15
  installChatBridge,
16
16
  setBridgeResolver,
17
17
  } from '../../browser-bridge';
18
- import { useChatSettings } from '../../../tools/Chat/settings';
18
+ import { useChatSettings } from '../../../tools/chat/settings';
19
19
 
20
20
  import type { CaptureEngineOptions, CaptureResult } from '../engine';
21
21
  import { PageSnapshotEngine } from '../engine';
@@ -80,17 +80,27 @@ function DataTableShell({ className, style }: { className?: string; style?: Reac
80
80
  return (
81
81
  <div
82
82
  data-slot="data-table"
83
- className={cn('flex flex-col gap-2 rounded-sm border border-border bg-background', className)}
83
+ // Single card frame owned by the shell, matching ui-core <Card>:
84
+ // `--radius-popover` corner + `--shadow-card` so a data panel reads the
85
+ // same as every other panel in the app (and gains the soft light-theme
86
+ // lift). The inner <Table> renders `frame={false}` so it doesn't draw a
87
+ // second border/radius inside this one (that produced the visible double
88
+ // border + mismatched corners). `overflow-hidden` clips the header band
89
+ // and the pagination strip to the rounded corners; the pagination's own
90
+ // top border is the only divider between body and footer — no `gap`
91
+ // gutter that reads as a second line.
92
+ className={cn(
93
+ 'flex flex-col overflow-hidden rounded-[var(--radius-popover)] border border-border bg-card text-card-foreground [box-shadow:var(--shadow-card)]',
94
+ className
95
+ )}
84
96
  style={style}
85
97
  >
86
- <div className="relative w-full overflow-auto">
87
- <Table>
88
- <DataTableHeader />
89
- <TableBody>
90
- <DataTableRows />
91
- </TableBody>
92
- </Table>
93
- </div>
98
+ <Table frame={false}>
99
+ <DataTableHeader />
100
+ <TableBody>
101
+ <DataTableRows />
102
+ </TableBody>
103
+ </Table>
94
104
  <DataTablePagination />
95
105
  </div>
96
106
  );
@@ -1,7 +1,14 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { cn } from '@djangocfg/ui-core/lib';
4
+ import {
5
+ Button,
6
+ Select,
7
+ SelectContent,
8
+ SelectItem,
9
+ SelectTrigger,
10
+ SelectValue,
11
+ } from '@djangocfg/ui-core/components';
5
12
  import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react';
6
13
 
7
14
  import { useDataTableContext } from '../context/DataTableContext';
@@ -16,90 +23,93 @@ export function DataTablePagination() {
16
23
  return (
17
24
  <div
18
25
  data-slot="data-table-pagination"
19
- className="flex flex-col items-center justify-between gap-2 px-4 py-2 sm:flex-row"
26
+ className="flex flex-col items-center justify-between gap-2 border-t border-border px-4 py-2 sm:flex-row"
20
27
  >
21
28
  <span className="text-sm text-muted-foreground">
22
29
  {start}-{end} of {totalRows}
23
30
  </span>
24
31
 
25
32
  <div className="flex items-center gap-2">
26
- <select
27
- value={pagination.pageSize}
28
- onChange={(e) => setPageSize(Number(e.target.value))}
29
- className={cn(
30
- 'h-8 rounded-sm border border-input bg-background px-2 text-sm',
31
- 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring'
32
- )}
33
- aria-label="Rows per page"
33
+ <Select
34
+ value={String(pagination.pageSize)}
35
+ onValueChange={(value) => setPageSize(Number(value))}
34
36
  >
35
- {pageSizeOptions.map((size) => (
36
- <option key={size} value={size}>
37
- {size} / page
38
- </option>
39
- ))}
40
- </select>
37
+ {/* `--radius` is the shared control corner used by ui-core <Button>,
38
+ * so the page-size trigger and the nav buttons round identically. */}
39
+ <SelectTrigger
40
+ className="h-8 w-auto gap-1 rounded-[var(--radius)] px-2 shadow-none"
41
+ aria-label="Rows per page"
42
+ >
43
+ <SelectValue />
44
+ </SelectTrigger>
45
+ <SelectContent>
46
+ {pageSizeOptions.map((size) => (
47
+ <SelectItem key={size} value={String(size)}>
48
+ {size} / page
49
+ </SelectItem>
50
+ ))}
51
+ </SelectContent>
52
+ </Select>
41
53
 
54
+ {/* Nav controls reuse the library <Button> (outline/icon) rather than a
55
+ * bespoke button, so hover, disabled, focus-ring and radius all track
56
+ * the rest of the app automatically. `h-8 w-8` shrinks the default
57
+ * icon size (h-9 w-9) to match the compact pagination row.
58
+ * `elevated={false}` drops the variant's shadow so the buttons sit
59
+ * flat against the panel, matching the shadow-less page-size select. */}
42
60
  <div className="flex items-center gap-1">
43
- <PaginationButton
61
+ <Button
62
+ variant="outline"
63
+ size="icon"
64
+ elevated={false}
65
+ className="h-8 w-8"
44
66
  onClick={() => setPage(1)}
45
67
  disabled={pagination.page <= 1}
46
68
  aria-label="First page"
47
69
  >
48
70
  <ChevronsLeft className="h-4 w-4" />
49
- </PaginationButton>
50
- <PaginationButton
71
+ </Button>
72
+ <Button
73
+ variant="outline"
74
+ size="icon"
75
+ elevated={false}
76
+ className="h-8 w-8"
51
77
  onClick={() => setPage(pagination.page - 1)}
52
78
  disabled={pagination.page <= 1}
53
79
  aria-label="Previous page"
54
80
  >
55
81
  <ChevronLeft className="h-4 w-4" />
56
- </PaginationButton>
82
+ </Button>
57
83
 
58
84
  <span className="px-2 text-sm tabular-nums">
59
85
  {pagination.page} / {pageCount}
60
86
  </span>
61
87
 
62
- <PaginationButton
88
+ <Button
89
+ variant="outline"
90
+ size="icon"
91
+ elevated={false}
92
+ className="h-8 w-8"
63
93
  onClick={() => setPage(pagination.page + 1)}
64
94
  disabled={pagination.page >= pageCount}
65
95
  aria-label="Next page"
66
96
  >
67
97
  <ChevronRight className="h-4 w-4" />
68
- </PaginationButton>
69
- <PaginationButton
98
+ </Button>
99
+ <Button
100
+ variant="outline"
101
+ size="icon"
102
+ elevated={false}
103
+ className="h-8 w-8"
70
104
  onClick={() => setPage(pageCount)}
71
105
  disabled={pagination.page >= pageCount}
72
106
  aria-label="Last page"
73
107
  >
74
108
  <ChevronsRight className="h-4 w-4" />
75
- </PaginationButton>
109
+ </Button>
76
110
  </div>
77
111
  </div>
78
112
  </div>
79
113
  );
80
114
  }
81
115
  DataTablePagination.displayName = 'DataTablePagination';
82
-
83
- function PaginationButton({
84
- children,
85
- onClick,
86
- disabled,
87
- ...props
88
- }: React.ButtonHTMLAttributes<HTMLButtonElement>) {
89
- return (
90
- <button
91
- type="button"
92
- onClick={onClick}
93
- disabled={disabled}
94
- className={cn(
95
- 'inline-flex h-8 w-8 items-center justify-center rounded-sm border border-input bg-background text-sm',
96
- 'hover:bg-accent hover:text-accent-foreground',
97
- 'disabled:pointer-events-none disabled:opacity-50',
98
- 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring'
99
- )}
100
- {...props}
101
- >
102
- {children}
103
- </button>
104
- );
105
- }
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
 
3
- import { TOGGLE } from '../../../Chat/styles/bubbleTokens';
3
+ import { TOGGLE } from '../../../chat/styles/bubbleTokens';
4
4
 
5
5
  interface CollapseToggleProps {
6
6
  isCollapsed: boolean;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Components } from 'react-markdown';
3
3
  import Mermaid from '../../Mermaid';
4
- import { ANCHOR } from '../../../Chat/styles/bubbleTokens';
4
+ import { ANCHOR } from '../../../chat/styles/bubbleTokens';
5
5
  import { CodeBlock, CodeBlockFallback } from './CodeBlock';
6
6
  import { extractTextFromChildren } from './plainText';
7
7
 
@@ -13,8 +13,8 @@
13
13
  * Inlined as base64 data URLs in the Chat sound modules, so consumers
14
14
  * get working audio with zero loader / ambient-type setup.
15
15
  */
16
- import start from '../../../../Chat/core/audio/sounds/start';
17
- import sent from '../../../../Chat/core/audio/sounds/sent';
16
+ import start from '../../../../chat/core/audio/sounds/start';
17
+ import sent from '../../../../chat/core/audio/sounds/sent';
18
18
 
19
19
  export type VoiceSoundEvent = 'start' | 'stop';
20
20