@codefast/ui 0.3.16-canary.0 → 0.3.16-canary.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/CHANGELOG.md +7 -0
- package/dist/components/calendar.mjs +1 -1
- package/dist/components/chart.d.mts +1 -1
- package/dist/components/field.d.mts +1 -1
- package/dist/hooks/use-animated-value.mjs +3 -3
- package/dist/hooks/use-copy-to-clipboard.mjs +3 -3
- package/dist/hooks/use-is-mobile.mjs +3 -3
- package/dist/hooks/use-media-query.mjs +3 -3
- package/dist/hooks/use-mutation-observer.mjs +3 -3
- package/dist/hooks/use-pagination.d.mts +1 -1
- package/dist/hooks/use-pagination.mjs +3 -3
- package/dist/lib/utils.d.mts +1 -1
- package/dist/primitives/checkbox-group.d.mts +3 -3
- package/dist/primitives/progress-circle.d.mts +1 -1
- package/dist/primitives/progress-circle.mjs +7 -7
- package/package.json +17 -9
package/CHANGELOG.md
CHANGED
|
@@ -39,7 +39,7 @@ function Calendar({ buttonVariant = "ghost", captionLayout = "label", className,
|
|
|
39
39
|
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
40
40
|
range_start: cn("rounded-l-md", "bg-accent", defaultClassNames.range_start),
|
|
41
41
|
root: cn("w-fit", defaultClassNames.root),
|
|
42
|
-
|
|
42
|
+
month_grid: "w-full border-collapse",
|
|
43
43
|
today: cn("rounded-md", "bg-accent text-accent-foreground", "data-selected:rounded-none", defaultClassNames.today),
|
|
44
44
|
week: cn("flex w-full", "mt-2", defaultClassNames.week),
|
|
45
45
|
week_number: cn("text-[0.8rem] text-muted-foreground", "select-none", defaultClassNames.week_number),
|
|
@@ -81,7 +81,7 @@ type ChartTooltipContentProps<TValue extends ValueType, TName extends NameType>
|
|
|
81
81
|
nameKey?: string;
|
|
82
82
|
color?: string | undefined;
|
|
83
83
|
className?: string | undefined;
|
|
84
|
-
payload?: Payload<TValue, TName
|
|
84
|
+
payload?: Array<Payload<TValue, TName>>;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* @since 0.3.16-canary.0
|
|
@@ -127,7 +127,7 @@ interface FieldErrorMessage {
|
|
|
127
127
|
* @since 0.3.16-canary.0
|
|
128
128
|
*/
|
|
129
129
|
interface FieldErrorProps extends ComponentProps<"div"> {
|
|
130
|
-
errors?:
|
|
130
|
+
errors?: Array<FieldErrorMessage | undefined>;
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* @since 0.3.16-canary.0
|
|
@@ -3,15 +3,15 @@ import { useEffect, useRef, useState } from "react";
|
|
|
3
3
|
//#region src/hooks/use-animated-value.ts
|
|
4
4
|
/**
|
|
5
5
|
* Produce a smoothly animated numeric value in response to changes.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* Applies a time-based easing (easeOutQuad) between the current and target values
|
|
8
8
|
* over the specified duration. When disabled, the value updates immediately.
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
* @param targetValue - Target number to animate toward; null resolves to 0.
|
|
11
11
|
* @param duration - Animation duration in milliseconds.
|
|
12
12
|
* @param animate - When false, bypasses animation and sets the value directly.
|
|
13
13
|
* @returns The current (rounded) animated value.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```tsx
|
|
17
17
|
* const value = useAnimatedValue(75, 1000, true);
|
|
@@ -3,15 +3,15 @@ import { useState } from "react";
|
|
|
3
3
|
//#region src/hooks/use-copy-to-clipboard.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provide clipboard copy capability with a transient copied state.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* Internally uses the Clipboard API when available and sets a temporary
|
|
8
8
|
* `isCopied` flag for UI feedback. A custom callback may be invoked upon copy.
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
* @param options - Configuration options.
|
|
11
11
|
* - onCopy: Callback invoked after a successful copy.
|
|
12
12
|
* - timeout: Duration in milliseconds to keep `isCopied` true. Defaults to 2000.
|
|
13
13
|
* @returns An object with a `copyToClipboard` function and an `isCopied` flag.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```tsx
|
|
17
17
|
* const { copyToClipboard, isCopied } = useCopyToClipboard({ timeout: 1500 });
|
|
@@ -3,14 +3,14 @@ import { useMediaQuery } from "./use-media-query.mjs";
|
|
|
3
3
|
//#region src/hooks/use-is-mobile.ts
|
|
4
4
|
/**
|
|
5
5
|
* Determine whether the current viewport should be treated as mobile.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* Uses {@link useMediaQuery} to evaluate a max-width media query derived from the
|
|
8
8
|
* provided breakpoint. By default, widths below 768px are considered mobile.
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
* @param mobileBreakpoint - Pixel width used as the mobile breakpoint. Values strictly
|
|
11
11
|
* less than this breakpoint are treated as mobile. Defaults to 768.
|
|
12
12
|
* @returns true when the viewport width is less than the given breakpoint; otherwise false.
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```tsx
|
|
16
16
|
* const isMobile = useIsMobile();
|
|
@@ -3,13 +3,13 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
//#region src/hooks/use-media-query.ts
|
|
4
4
|
/**
|
|
5
5
|
* Subscribe to a CSS media query and receive its match state.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* Evaluates the query immediately (when supported) and updates on changes
|
|
8
8
|
* via an event listener.
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
* @param query - A valid media query string (e.g., "(max-width: 768px)").
|
|
11
11
|
* @returns true when the media query currently matches; otherwise false.
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```tsx
|
|
15
15
|
* const isNarrow = useMediaQuery("(max-width: 768px)");
|
|
@@ -12,15 +12,15 @@ const defaultOptions = {
|
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Observe DOM mutations on a referenced element and invoke a callback.
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
16
|
* Attaches a MutationObserver to the provided element reference with the given
|
|
17
17
|
* options and calls the callback whenever mutations occur.
|
|
18
|
-
*
|
|
18
|
+
*
|
|
19
19
|
* @param ref - Ref to the target HTMLElement to observe.
|
|
20
20
|
* @param callback - Mutation callback invoked with observed records.
|
|
21
21
|
* @param options - Observer configuration. Defaults watch attributes, characterData, childList, subtree.
|
|
22
22
|
* @returns void
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
24
|
* @see [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)
|
|
25
25
|
*
|
|
26
26
|
* @since 0.3.16-canary.0
|
|
@@ -54,6 +54,6 @@ declare function usePagination({
|
|
|
54
54
|
resultsPerPage,
|
|
55
55
|
siblingPagesCount,
|
|
56
56
|
totalResults
|
|
57
|
-
}: UsePaginationProps):
|
|
57
|
+
}: UsePaginationProps): Array<number | string>;
|
|
58
58
|
//#endregion
|
|
59
59
|
export { ELLIPSIS, UsePaginationProps, usePagination };
|
|
@@ -20,14 +20,14 @@ const createRange = (start, end) => {
|
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Compute a pagination structure for result sets.
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
24
|
* Returns a mixed array of page numbers and the `ELLIPSIS` marker representing
|
|
25
25
|
* collapsed ranges. The shape adapts to the total pages and the requested
|
|
26
26
|
* sibling window around the current page.
|
|
27
|
-
*
|
|
27
|
+
*
|
|
28
28
|
* @param props - Pagination options. See {@link UsePaginationProps}.
|
|
29
29
|
* @returns Array of page numbers and `ELLIPSIS` representing the pagination model.
|
|
30
|
-
*
|
|
30
|
+
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```tsx
|
|
33
33
|
* const paginationRange = usePagination({
|
package/dist/lib/utils.d.mts
CHANGED
|
@@ -8,6 +8,6 @@ import { VariantProps } from "@codefast/tailwind-variants";
|
|
|
8
8
|
* Use these `cn` / `tv` helpers everywhere in this package so class merging stays consistent
|
|
9
9
|
* and optional `twMergeConfig` can be applied in one place later.
|
|
10
10
|
*/
|
|
11
|
-
declare const cn: (...classes: ClassValue
|
|
11
|
+
declare const cn: (...classes: Array<ClassValue>) => string, tv: _$_codefast_tailwind_variants0.TailwindVariantsFactory;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { type VariantProps, cn, tv };
|
|
@@ -44,7 +44,7 @@ interface CheckboxGroupContextValue {
|
|
|
44
44
|
/**
|
|
45
45
|
* Array of currently selected checkbox values
|
|
46
46
|
*/
|
|
47
|
-
value?: string
|
|
47
|
+
value?: Array<string>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Base props for the CheckboxGroup component
|
|
@@ -53,7 +53,7 @@ interface CheckboxGroupBaseProps {
|
|
|
53
53
|
/**
|
|
54
54
|
* Default values for the checkbox group when uncontrolled
|
|
55
55
|
*/
|
|
56
|
-
defaultValue?: string
|
|
56
|
+
defaultValue?: Array<string>;
|
|
57
57
|
/**
|
|
58
58
|
* Direction for roving focus navigation
|
|
59
59
|
*/
|
|
@@ -74,7 +74,7 @@ interface CheckboxGroupBaseProps {
|
|
|
74
74
|
* Callback fired when the selected values change
|
|
75
75
|
* @param value - The new array of selected values
|
|
76
76
|
*/
|
|
77
|
-
onValueChange?: (value?: string
|
|
77
|
+
onValueChange?: (value?: Array<string>) => void;
|
|
78
78
|
/**
|
|
79
79
|
* Orientation of the checkbox group (horizontal or vertical)
|
|
80
80
|
*/
|
|
@@ -8,10 +8,10 @@ const [createProgressCircleContext, createProgressCircleScope] = createContextSc
|
|
|
8
8
|
const [ProgressCircleContextProvider, useProgressCircleContext] = createProgressCircleContext(PROGRESS_CIRCLE_PROVIDER_NAME);
|
|
9
9
|
/**
|
|
10
10
|
* Provides context for the ProgressCircle component
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
12
|
* Manages calculations for rendering the circular progress indicator,
|
|
13
13
|
* including value clamping, sizing, thresholds, and indeterminate state.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```tsx
|
|
17
17
|
* <ProgressCircleProvider
|
|
@@ -80,7 +80,7 @@ function ProgressCircleProvider({ __scopeProgressCircle, children, formatValue,
|
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Root component for the progress circle
|
|
83
|
-
*
|
|
83
|
+
*
|
|
84
84
|
* Serves as a wrapper for other progress circle components.
|
|
85
85
|
*
|
|
86
86
|
* @since 0.3.16-canary.0
|
|
@@ -91,7 +91,7 @@ function ProgressCircle({ __scopeProgressCircle, ...props }) {
|
|
|
91
91
|
const PROGRESS_CIRCLE_SVG_NAME = "ProgressCircleSVG";
|
|
92
92
|
/**
|
|
93
93
|
* SVG container for the progress circle
|
|
94
|
-
*
|
|
94
|
+
*
|
|
95
95
|
* Renders the SVG with accessibility attributes and supports indeterminate state.
|
|
96
96
|
*
|
|
97
97
|
* @since 0.3.16-canary.0
|
|
@@ -115,7 +115,7 @@ function ProgressCircleSVG({ __scopeProgressCircle, ...props }) {
|
|
|
115
115
|
const PROGRESS_CIRCLE_TRACK_NAME = "ProgressCircleTrack";
|
|
116
116
|
/**
|
|
117
117
|
* Background circle for the progress indicator
|
|
118
|
-
*
|
|
118
|
+
*
|
|
119
119
|
* Renders the static track of the progress circle.
|
|
120
120
|
*
|
|
121
121
|
* @since 0.3.16-canary.0
|
|
@@ -135,7 +135,7 @@ function ProgressCircleTrack({ __scopeProgressCircle, ...props }) {
|
|
|
135
135
|
const PROGRESS_CIRCLE_INDICATOR_NAME = "ProgressCircleIndicator";
|
|
136
136
|
/**
|
|
137
137
|
* Foreground circle showing progress
|
|
138
|
-
*
|
|
138
|
+
*
|
|
139
139
|
* Renders the dynamic progress indicator with stroke dash properties.
|
|
140
140
|
*
|
|
141
141
|
* @since 0.3.16-canary.0
|
|
@@ -159,7 +159,7 @@ function ProgressCircleIndicator({ __scopeProgressCircle, ...props }) {
|
|
|
159
159
|
const PROGRESS_CIRCLE_VALUE_NAME = "ProgressCircleValue";
|
|
160
160
|
/**
|
|
161
161
|
* Displays the current progress value
|
|
162
|
-
*
|
|
162
|
+
*
|
|
163
163
|
* Supports custom content or default value text rendering.
|
|
164
164
|
*
|
|
165
165
|
* @since 0.3.16-canary.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/ui",
|
|
3
|
-
"version": "0.3.16-canary.
|
|
3
|
+
"version": "0.3.16-canary.1",
|
|
4
4
|
"description": "Core UI components library built with React and Tailwind CSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -396,33 +396,34 @@
|
|
|
396
396
|
"input-otp": "^1.4.2",
|
|
397
397
|
"lucide-react": "^1.14.0",
|
|
398
398
|
"next-themes": "^0.4.6",
|
|
399
|
-
"react-day-picker": "^
|
|
399
|
+
"react-day-picker": "^10.0.0",
|
|
400
400
|
"react-hook-form": "^7.75.0",
|
|
401
401
|
"react-resizable-panels": "^4.11.0",
|
|
402
402
|
"recharts": "^3.8.1",
|
|
403
403
|
"sonner": "^2.0.7",
|
|
404
404
|
"tw-animate-css": "^1.4.0",
|
|
405
405
|
"vaul": "^1.1.2",
|
|
406
|
-
"@codefast/tailwind-variants": "0.3.16-canary.
|
|
406
|
+
"@codefast/tailwind-variants": "0.3.16-canary.1"
|
|
407
407
|
},
|
|
408
408
|
"devDependencies": {
|
|
409
|
-
"@tailwindcss/postcss": "^4.
|
|
409
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
410
410
|
"@testing-library/dom": "^10.4.1",
|
|
411
411
|
"@testing-library/jest-dom": "^6.9.1",
|
|
412
412
|
"@testing-library/react": "^16.3.2",
|
|
413
413
|
"@testing-library/user-event": "^14.6.1",
|
|
414
414
|
"@types/jest-axe": "^3.5.9",
|
|
415
|
-
"@types/node": "^25.6.
|
|
416
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
415
|
+
"@types/node": "^25.6.2",
|
|
416
|
+
"@typescript/native-preview": "7.0.0-dev.20260509.2",
|
|
417
417
|
"@vitejs/plugin-react": "^6.0.1",
|
|
418
418
|
"@vitest/coverage-v8": "^4.1.5",
|
|
419
419
|
"jest-axe": "^10.0.0",
|
|
420
420
|
"jsdom": "^29.1.1",
|
|
421
|
-
"postcss": "^8.5.
|
|
422
|
-
"tailwindcss": "^4.
|
|
421
|
+
"postcss": "^8.5.14",
|
|
422
|
+
"tailwindcss": "^4.3.0",
|
|
423
|
+
"tsdown": "^0.22.0",
|
|
423
424
|
"typescript": "^6.0.3",
|
|
424
425
|
"vitest": "^4.1.5",
|
|
425
|
-
"@codefast/typescript-config": "0.3.16-canary.
|
|
426
|
+
"@codefast/typescript-config": "0.3.16-canary.1"
|
|
426
427
|
},
|
|
427
428
|
"peerDependencies": {
|
|
428
429
|
"@types/react": "^19.0",
|
|
@@ -438,6 +439,9 @@
|
|
|
438
439
|
"optional": true
|
|
439
440
|
}
|
|
440
441
|
},
|
|
442
|
+
"engines": {
|
|
443
|
+
"node": ">=22.0.0"
|
|
444
|
+
},
|
|
441
445
|
"scripts": {
|
|
442
446
|
"build": "tsdown",
|
|
443
447
|
"check-types": "tsgo --noEmit",
|
|
@@ -445,6 +449,10 @@
|
|
|
445
449
|
"dev": "tsdown --watch",
|
|
446
450
|
"test": "vitest run",
|
|
447
451
|
"test:coverage": "vitest run --coverage",
|
|
452
|
+
"test:e2e": "vitest run tests/e2e",
|
|
453
|
+
"test:integration": "vitest run tests/integration",
|
|
454
|
+
"test:type": "vitest run tests/types",
|
|
455
|
+
"test:unit": "vitest run tests/unit",
|
|
448
456
|
"test:watch": "vitest"
|
|
449
457
|
}
|
|
450
458
|
}
|