@djangocfg/ui-core 2.1.610 → 2.1.612
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-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.612",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -133,10 +133,10 @@
|
|
|
133
133
|
"check:docs": "node scripts/check-docs.mjs"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@djangocfg/api": "^2.1.
|
|
137
|
-
"@djangocfg/i18n": "^2.1.
|
|
136
|
+
"@djangocfg/api": "^2.1.612",
|
|
137
|
+
"@djangocfg/i18n": "^2.1.612",
|
|
138
138
|
"consola": "^3.4.2",
|
|
139
|
-
"lucide-react": "^
|
|
139
|
+
"lucide-react": "^1.68.0",
|
|
140
140
|
"moment": "^2.30.1",
|
|
141
141
|
"next": ">=14.0.0",
|
|
142
142
|
"react": "^19.0.0",
|
|
@@ -157,72 +157,72 @@
|
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@chenglou/pretext": "^0.0
|
|
161
|
-
"@hookform/resolvers": "^
|
|
162
|
-
"@radix-ui/react-accordion": "^1.
|
|
163
|
-
"@radix-ui/react-alert-dialog": "^1.1
|
|
164
|
-
"@radix-ui/react-aspect-ratio": "^1.
|
|
165
|
-
"@radix-ui/react-avatar": "^1.
|
|
166
|
-
"@radix-ui/react-checkbox": "^1.
|
|
167
|
-
"@radix-ui/react-collapsible": "^1.1
|
|
168
|
-
"@radix-ui/react-context-menu": "^2.
|
|
169
|
-
"@radix-ui/react-dialog": "^1.1
|
|
170
|
-
"@radix-ui/react-dropdown-menu": "^2.1
|
|
171
|
-
"@radix-ui/react-hover-card": "^1.1
|
|
160
|
+
"@chenglou/pretext": "^1.0.0",
|
|
161
|
+
"@hookform/resolvers": "^7.0.2",
|
|
162
|
+
"@radix-ui/react-accordion": "^1.3.1",
|
|
163
|
+
"@radix-ui/react-alert-dialog": "^1.2.1",
|
|
164
|
+
"@radix-ui/react-aspect-ratio": "^1.2.0",
|
|
165
|
+
"@radix-ui/react-avatar": "^1.3.1",
|
|
166
|
+
"@radix-ui/react-checkbox": "^1.4.1",
|
|
167
|
+
"@radix-ui/react-collapsible": "^1.2.1",
|
|
168
|
+
"@radix-ui/react-context-menu": "^2.4.1",
|
|
169
|
+
"@radix-ui/react-dialog": "^1.3.1",
|
|
170
|
+
"@radix-ui/react-dropdown-menu": "^2.2.1",
|
|
171
|
+
"@radix-ui/react-hover-card": "^1.2.1",
|
|
172
172
|
"@radix-ui/react-icons": "^1.3.2",
|
|
173
|
-
"@radix-ui/react-label": "^2.1.
|
|
174
|
-
"@radix-ui/react-menubar": "^1.1
|
|
175
|
-
"@radix-ui/react-navigation-menu": "^1.
|
|
176
|
-
"@radix-ui/react-popover": "^1.1
|
|
177
|
-
"@radix-ui/react-progress": "^1.1
|
|
178
|
-
"@radix-ui/react-radio-group": "^1.
|
|
179
|
-
"@radix-ui/react-scroll-area": "^1.
|
|
180
|
-
"@radix-ui/react-select": "^2.
|
|
181
|
-
"@radix-ui/react-separator": "^1.
|
|
182
|
-
"@radix-ui/react-slider": "^1.
|
|
183
|
-
"@radix-ui/react-slot": "^1.
|
|
184
|
-
"@radix-ui/react-switch": "^1.
|
|
185
|
-
"@radix-ui/react-tabs": "^1.1
|
|
186
|
-
"@radix-ui/react-toast": "^1.
|
|
187
|
-
"@radix-ui/react-toggle": "^1.1
|
|
188
|
-
"@radix-ui/react-toggle-group": "^1.1
|
|
189
|
-
"@radix-ui/react-tooltip": "^1.
|
|
190
|
-
"@web3icons/react": "^4.1.
|
|
173
|
+
"@radix-ui/react-label": "^2.1.17",
|
|
174
|
+
"@radix-ui/react-menubar": "^1.2.1",
|
|
175
|
+
"@radix-ui/react-navigation-menu": "^1.4.1",
|
|
176
|
+
"@radix-ui/react-popover": "^1.3.1",
|
|
177
|
+
"@radix-ui/react-progress": "^1.2.1",
|
|
178
|
+
"@radix-ui/react-radio-group": "^1.5.1",
|
|
179
|
+
"@radix-ui/react-scroll-area": "^1.4.0",
|
|
180
|
+
"@radix-ui/react-select": "^2.4.1",
|
|
181
|
+
"@radix-ui/react-separator": "^1.2.0",
|
|
182
|
+
"@radix-ui/react-slider": "^1.6.1",
|
|
183
|
+
"@radix-ui/react-slot": "^1.5.0",
|
|
184
|
+
"@radix-ui/react-switch": "^1.4.1",
|
|
185
|
+
"@radix-ui/react-tabs": "^1.2.1",
|
|
186
|
+
"@radix-ui/react-toast": "^1.3.1",
|
|
187
|
+
"@radix-ui/react-toggle": "^1.2.1",
|
|
188
|
+
"@radix-ui/react-toggle-group": "^1.2.1",
|
|
189
|
+
"@radix-ui/react-tooltip": "^1.4.1",
|
|
190
|
+
"@web3icons/react": "^4.1.24",
|
|
191
191
|
"class-variance-authority": "^0.7.1",
|
|
192
192
|
"clsx": "^2.1.1",
|
|
193
193
|
"cmdk": "1.1.1",
|
|
194
|
-
"countries-list": "^3.4.
|
|
194
|
+
"countries-list": "^3.4.1",
|
|
195
195
|
"country-flag-icons": "^1.6.20",
|
|
196
196
|
"date-fns": "^4.4.0",
|
|
197
197
|
"embla-carousel-react": "8.6.0",
|
|
198
198
|
"i18n-iso-countries": "^7.14.0",
|
|
199
|
-
"input-otp": "1.
|
|
200
|
-
"libphonenumber-js": "^1.13.
|
|
199
|
+
"input-otp": "1.5.0",
|
|
200
|
+
"libphonenumber-js": "^1.13.15",
|
|
201
201
|
"next-themes": "^0.4.6",
|
|
202
202
|
"nextjs-toploader": "^3.9.17",
|
|
203
|
-
"react-day-picker": "
|
|
204
|
-
"react-hotkeys-hook": "^
|
|
203
|
+
"react-day-picker": "10.0.2",
|
|
204
|
+
"react-hotkeys-hook": "^5.3.3",
|
|
205
205
|
"react-resizable-panels": "3.0.6",
|
|
206
206
|
"react-sticky-box": "^2.0.5",
|
|
207
|
-
"recharts": "
|
|
208
|
-
"sonner": "2.0.
|
|
209
|
-
"tailwind-merge": "^3.
|
|
207
|
+
"recharts": "^3.10.1",
|
|
208
|
+
"sonner": "2.0.8",
|
|
209
|
+
"tailwind-merge": "^3.7.0",
|
|
210
210
|
"vaul": "1.1.2"
|
|
211
211
|
},
|
|
212
212
|
"devDependencies": {
|
|
213
|
-
"@djangocfg/api": "^2.1.
|
|
214
|
-
"@djangocfg/eslint-config": "^2.1.
|
|
215
|
-
"@djangocfg/i18n": "^2.1.
|
|
216
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
217
|
-
"@storybook/react-vite": "^10.5
|
|
213
|
+
"@djangocfg/api": "^2.1.612",
|
|
214
|
+
"@djangocfg/eslint-config": "^2.1.612",
|
|
215
|
+
"@djangocfg/i18n": "^2.1.612",
|
|
216
|
+
"@djangocfg/typescript-config": "^2.1.612",
|
|
217
|
+
"@storybook/react-vite": "^10.6.5",
|
|
218
218
|
"@types/node": "^24.13.3",
|
|
219
|
-
"@types/react": "19.
|
|
220
|
-
"@types/react-dom": "19.
|
|
221
|
-
"lucide-react": "^
|
|
222
|
-
"next": "^16.
|
|
223
|
-
"storybook": "^10.5
|
|
219
|
+
"@types/react": "19.3.0",
|
|
220
|
+
"@types/react-dom": "19.3.0",
|
|
221
|
+
"lucide-react": "^1.68.0",
|
|
222
|
+
"next": "^16.4.5",
|
|
223
|
+
"storybook": "^10.6.5",
|
|
224
224
|
"typescript": "^5.9.3",
|
|
225
|
-
"vitest": "^
|
|
225
|
+
"vitest": "^5.1.0"
|
|
226
226
|
},
|
|
227
227
|
"publishConfig": {
|
|
228
228
|
"access": "public"
|
|
@@ -152,7 +152,7 @@ function AvatarGroupItem(props: AvatarGroupItemProps) {
|
|
|
152
152
|
const maskStyle = React.useMemo<React.CSSProperties>(() => {
|
|
153
153
|
let maskImage = ""
|
|
154
154
|
|
|
155
|
-
let shouldMask
|
|
155
|
+
let shouldMask: boolean
|
|
156
156
|
|
|
157
157
|
if (orientation === "vertical" && dir === "rtl" && reverse) {
|
|
158
158
|
shouldMask = index !== itemCount - 1
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { enUS, ko, ru, type Locale } from 'date-fns/locale';
|
|
4
4
|
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
6
|
+
import { DayButton, DayPicker, getDefaultClassNames, type Matcher } from 'react-day-picker';
|
|
7
7
|
|
|
8
8
|
import { useLocaleOptional } from '@djangocfg/i18n';
|
|
9
9
|
import { cn } from '../../../lib/utils';
|
|
@@ -23,10 +23,32 @@ function Calendar({
|
|
|
23
23
|
formatters,
|
|
24
24
|
components,
|
|
25
25
|
locale,
|
|
26
|
+
fromDate,
|
|
27
|
+
toDate,
|
|
28
|
+
initialFocus,
|
|
29
|
+
disabled,
|
|
26
30
|
...props
|
|
27
31
|
}: React.ComponentProps<typeof DayPicker> & {
|
|
28
32
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
33
|
+
/** react-day-picker 9 name, kept for our callers: earliest selectable day. */
|
|
34
|
+
fromDate?: Date
|
|
35
|
+
/** react-day-picker 9 name, kept for our callers: latest selectable day. */
|
|
36
|
+
toDate?: Date
|
|
37
|
+
/** react-day-picker 9 name for `autoFocus`. */
|
|
38
|
+
initialFocus?: boolean
|
|
29
39
|
}) {
|
|
40
|
+
// react-day-picker 10 dropped fromDate/toDate/initialFocus. Map them onto the
|
|
41
|
+
// v10 API: navigation bounds + disabled matchers + autoFocus.
|
|
42
|
+
const limits: Matcher[] = []
|
|
43
|
+
if (fromDate) limits.push({ before: fromDate })
|
|
44
|
+
if (toDate) limits.push({ after: toDate })
|
|
45
|
+
const mergedDisabled: Matcher | Matcher[] | undefined =
|
|
46
|
+
limits.length === 0
|
|
47
|
+
? disabled
|
|
48
|
+
: disabled === undefined || disabled === false
|
|
49
|
+
? limits
|
|
50
|
+
: [...(Array.isArray(disabled) ? disabled : [disabled]), ...limits]
|
|
51
|
+
|
|
30
52
|
const defaultClassNames = getDefaultClassNames()
|
|
31
53
|
|
|
32
54
|
// Localize month/weekday names from the app locale. An explicit `locale` prop
|
|
@@ -48,6 +70,10 @@ function Calendar({
|
|
|
48
70
|
className
|
|
49
71
|
)}
|
|
50
72
|
captionLayout={captionLayout}
|
|
73
|
+
disabled={mergedDisabled}
|
|
74
|
+
startMonth={fromDate}
|
|
75
|
+
endMonth={toDate}
|
|
76
|
+
autoFocus={initialFocus}
|
|
51
77
|
formatters={{
|
|
52
78
|
formatMonthDropdown: (date) =>
|
|
53
79
|
date.toLocaleString("default", { month: "short" }),
|
|
@@ -97,7 +123,7 @@ function Calendar({
|
|
|
97
123
|
: "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
|
|
98
124
|
defaultClassNames.caption_label
|
|
99
125
|
),
|
|
100
|
-
|
|
126
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
101
127
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
102
128
|
weekday: cn(
|
|
103
129
|
"text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
|
|
@@ -10,7 +10,7 @@ import { Button } from '../../forms/button';
|
|
|
10
10
|
import { Popover, PopoverContent, PopoverTrigger } from '../../overlay/popover';
|
|
11
11
|
import { Calendar } from './calendar';
|
|
12
12
|
|
|
13
|
-
import type {
|
|
13
|
+
import type { DateRange as RDPDateRange } from 'react-day-picker'
|
|
14
14
|
|
|
15
15
|
// =============================================================================
|
|
16
16
|
// DatePicker - Single date selection with popover
|
|
@@ -60,7 +60,7 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
60
60
|
|
|
61
61
|
const resolvedPlaceholder = placeholder ?? t('ui.datetime.pickDate')
|
|
62
62
|
|
|
63
|
-
const handleSelect
|
|
63
|
+
const handleSelect = (date: Date | undefined) => {
|
|
64
64
|
onChange?.(date)
|
|
65
65
|
setOpen(false)
|
|
66
66
|
}
|
|
@@ -102,11 +102,24 @@ ${colorConfig
|
|
|
102
102
|
|
|
103
103
|
const ChartTooltip = RechartsPrimitive.Tooltip
|
|
104
104
|
|
|
105
|
+
// recharts 3 no longer types the injected content props on <Tooltip>; take them
|
|
106
|
+
// from TooltipContentProps instead (all optional: the element is created bare).
|
|
107
|
+
type TooltipInjectedProps = Partial<
|
|
108
|
+
Pick<
|
|
109
|
+
RechartsPrimitive.TooltipContentProps<
|
|
110
|
+
RechartsPrimitive.TooltipValueType,
|
|
111
|
+
string | number
|
|
112
|
+
>,
|
|
113
|
+
"active" | "payload" | "label" | "labelFormatter" | "formatter"
|
|
114
|
+
>
|
|
115
|
+
>
|
|
116
|
+
|
|
105
117
|
const ChartTooltipContent = React.forwardRef<
|
|
106
118
|
HTMLDivElement,
|
|
107
|
-
React.ComponentProps<
|
|
108
|
-
|
|
119
|
+
Omit<React.ComponentProps<"div">, "children"> &
|
|
120
|
+
TooltipInjectedProps & {
|
|
109
121
|
hideLabel?: boolean
|
|
122
|
+
labelClassName?: string
|
|
110
123
|
hideIndicator?: boolean
|
|
111
124
|
indicator?: "line" | "dot" | "dashed"
|
|
112
125
|
nameKey?: string
|
|
@@ -194,7 +207,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
194
207
|
|
|
195
208
|
return (
|
|
196
209
|
<div
|
|
197
|
-
key={item.dataKey}
|
|
210
|
+
key={typeof item.dataKey === "function" ? index : (item.dataKey ?? index)}
|
|
198
211
|
className={cn(
|
|
199
212
|
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
200
213
|
indicator === "dot" && "items-center"
|
|
@@ -262,8 +275,9 @@ const ChartLegend = RechartsPrimitive.Legend
|
|
|
262
275
|
|
|
263
276
|
const ChartLegendContent = React.forwardRef<
|
|
264
277
|
HTMLDivElement,
|
|
265
|
-
React.ComponentProps<"div"> &
|
|
266
|
-
|
|
278
|
+
React.ComponentProps<"div"> & {
|
|
279
|
+
payload?: readonly RechartsPrimitive.LegendPayload[]
|
|
280
|
+
verticalAlign?: "top" | "middle" | "bottom"
|
|
267
281
|
hideIcon?: boolean
|
|
268
282
|
nameKey?: string
|
|
269
283
|
}
|
|
@@ -41,7 +41,7 @@ function hslToRgb(h: number, s: number, l: number): { r: number; g: number; b: n
|
|
|
41
41
|
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
42
42
|
const m = l - c / 2;
|
|
43
43
|
|
|
44
|
-
let r
|
|
44
|
+
let r: number, g: number, b: number;
|
|
45
45
|
|
|
46
46
|
if (h >= 0 && h < 60) { r = c; g = x; b = 0; }
|
|
47
47
|
else if (h >= 60 && h < 120) { r = x; g = c; b = 0; }
|