@refraction-ui/react 0.16.0 → 0.16.2
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/dist/index.cjs +412 -424
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +412 -411
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker/index.d.cts +3 -1
- package/dist/internal/date-picker/index.d.ts +3 -1
- package/dist/internal/mascot/index.d.ts +46 -0
- package/dist/internal/react-date-picker/index.d.cts +2 -10
- package/dist/internal/react-date-picker/index.d.ts +2 -10
- package/dist/internal/react-mascot/index.d.ts +30 -0
- package/dist/internal/react-slider/index.d.cts +8 -1
- package/dist/internal/react-slider/index.d.ts +8 -1
- package/package.json +2 -1
- package/dist/internal/slider/index.d.cts +0 -4
- package/dist/internal/slider/index.d.ts +0 -4
|
@@ -22,6 +22,8 @@ interface DatePickerProps {
|
|
|
22
22
|
defaultOpen?: boolean;
|
|
23
23
|
/** Callback when open changes */
|
|
24
24
|
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/** The currently displayed month (controlled) */
|
|
26
|
+
currentMonth?: Date;
|
|
25
27
|
}
|
|
26
28
|
interface DatePickerState {
|
|
27
29
|
open: boolean;
|
|
@@ -85,7 +87,7 @@ declare function formatDate(date: Date | undefined, format: string, showTime: bo
|
|
|
85
87
|
declare function createDatePicker(props?: DatePickerProps): DatePickerAPI;
|
|
86
88
|
|
|
87
89
|
declare const datePickerTriggerStyles = "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer";
|
|
88
|
-
declare const datePickerDropdownStyles = "absolute z-50 mt-1 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
90
|
+
declare const datePickerDropdownStyles = "absolute z-50 mt-1 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
89
91
|
declare const datePickerGridStyles = "w-full border-collapse";
|
|
90
92
|
declare const datePickerDayVariants: (props?: ({
|
|
91
93
|
state?: "default" | "selected" | "today" | "disabled" | "outside" | undefined;
|
|
@@ -22,6 +22,8 @@ interface DatePickerProps {
|
|
|
22
22
|
defaultOpen?: boolean;
|
|
23
23
|
/** Callback when open changes */
|
|
24
24
|
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/** The currently displayed month (controlled) */
|
|
26
|
+
currentMonth?: Date;
|
|
25
27
|
}
|
|
26
28
|
interface DatePickerState {
|
|
27
29
|
open: boolean;
|
|
@@ -85,7 +87,7 @@ declare function formatDate(date: Date | undefined, format: string, showTime: bo
|
|
|
85
87
|
declare function createDatePicker(props?: DatePickerProps): DatePickerAPI;
|
|
86
88
|
|
|
87
89
|
declare const datePickerTriggerStyles = "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer";
|
|
88
|
-
declare const datePickerDropdownStyles = "absolute z-50 mt-1 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
90
|
+
declare const datePickerDropdownStyles = "absolute z-50 mt-1 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md";
|
|
89
91
|
declare const datePickerGridStyles = "w-full border-collapse";
|
|
90
92
|
declare const datePickerDayVariants: (props?: ({
|
|
91
93
|
state?: "default" | "selected" | "today" | "disabled" | "outside" | undefined;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TokenContract } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type MascotMood = 'happy' | 'think' | 'wave';
|
|
4
|
+
type MascotAnimation = 'none' | 'bounce' | 'float';
|
|
5
|
+
type MascotSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
interface MascotProps {
|
|
7
|
+
mood?: MascotMood;
|
|
8
|
+
animation?: MascotAnimation;
|
|
9
|
+
size?: MascotSize;
|
|
10
|
+
animate?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface MascotAPI {
|
|
13
|
+
/** ARIA attributes to spread on the root element */
|
|
14
|
+
ariaProps: Record<string, string | number | boolean>;
|
|
15
|
+
/** Data attributes for CSS styling hooks and states */
|
|
16
|
+
dataAttributes: Record<string, string>;
|
|
17
|
+
/** Active mascot state configuration */
|
|
18
|
+
state: {
|
|
19
|
+
mood: MascotMood;
|
|
20
|
+
animation: MascotAnimation;
|
|
21
|
+
size: MascotSize;
|
|
22
|
+
animate: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Mood styles mapping moods to CSS custom properties */
|
|
25
|
+
style: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Maps mascot moods ('happy', 'think', 'wave') to CSS custom properties (variables).
|
|
29
|
+
*/
|
|
30
|
+
declare function getMascotMoodStyles(mood: MascotMood): Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a cleanup-enabled interval timer for Tobi's blinking state.
|
|
33
|
+
* Blinks for 150ms every 4000ms.
|
|
34
|
+
*/
|
|
35
|
+
declare function startMascotBlinkInterval(onBlinkChange: (isBlinking: boolean) => void, intervalMs?: number, durationMs?: number): () => void;
|
|
36
|
+
declare function createMascot(props?: MascotProps): MascotAPI;
|
|
37
|
+
|
|
38
|
+
declare const mascotTokens: TokenContract;
|
|
39
|
+
declare const mascotVariants: (props?: ({
|
|
40
|
+
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
41
|
+
animation?: "none" | "bounce" | "float" | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
className?: string;
|
|
44
|
+
}) | undefined) => string;
|
|
45
|
+
|
|
46
|
+
export { type MascotAPI, type MascotAnimation, type MascotMood, type MascotProps, type MascotSize, createMascot, getMascotMoodStyles, mascotTokens, mascotVariants, startMascotBlinkInterval };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export { CalendarDay, DatePickerProps as CoreDatePickerProps, DatePickerAPI, DatePickerState, DatePickerView, datePickerDayVariants, datePickerDropdownStyles, datePickerTimeInputStyles, datePickerTimeStyles, datePickerTriggerStyles } from '../date-picker/index.cjs';
|
|
3
3
|
|
|
4
|
-
interface DatePickerProps {
|
|
4
|
+
interface DatePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
5
5
|
value?: Date;
|
|
6
6
|
onChange?: (date: Date) => void;
|
|
7
7
|
minDate?: Date;
|
|
@@ -9,15 +9,7 @@ interface DatePickerProps {
|
|
|
9
9
|
showTime?: boolean;
|
|
10
10
|
format?: string;
|
|
11
11
|
placeholder?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare function DatePicker({ value, onChange, minDate, maxDate, showTime, format, placeholder, className, disabled, }: DatePickerProps): React.DetailedReactHTMLElement<{
|
|
16
|
-
ref: React.RefObject<HTMLDivElement | null>;
|
|
17
|
-
className: string;
|
|
18
|
-
}, HTMLDivElement>;
|
|
19
|
-
declare namespace DatePicker {
|
|
20
|
-
var displayName: string;
|
|
21
12
|
}
|
|
13
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
22
14
|
|
|
23
15
|
export { DatePicker, type DatePickerProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export { CalendarDay, DatePickerProps as CoreDatePickerProps, DatePickerAPI, DatePickerState, DatePickerView, datePickerDayVariants, datePickerDropdownStyles, datePickerTimeInputStyles, datePickerTimeStyles, datePickerTriggerStyles } from '../date-picker/index.js';
|
|
3
3
|
|
|
4
|
-
interface DatePickerProps {
|
|
4
|
+
interface DatePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
5
5
|
value?: Date;
|
|
6
6
|
onChange?: (date: Date) => void;
|
|
7
7
|
minDate?: Date;
|
|
@@ -9,15 +9,7 @@ interface DatePickerProps {
|
|
|
9
9
|
showTime?: boolean;
|
|
10
10
|
format?: string;
|
|
11
11
|
placeholder?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare function DatePicker({ value, onChange, minDate, maxDate, showTime, format, placeholder, className, disabled, }: DatePickerProps): React.DetailedReactHTMLElement<{
|
|
16
|
-
ref: React.RefObject<HTMLDivElement | null>;
|
|
17
|
-
className: string;
|
|
18
|
-
}, HTMLDivElement>;
|
|
19
|
-
declare namespace DatePicker {
|
|
20
|
-
var displayName: string;
|
|
21
12
|
}
|
|
13
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
22
14
|
|
|
23
15
|
export { DatePicker, type DatePickerProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MascotMood, MascotAnimation, MascotSize } from '../mascot/index.js';
|
|
3
|
+
export { MascotAnimation, MascotMood, MascotSize } from '../mascot/index.js';
|
|
4
|
+
|
|
5
|
+
interface MascotProps extends Omit<React.SVGProps<SVGSVGElement>, 'size'> {
|
|
6
|
+
/** The mood of the mascot. Defaults to 'happy'. */
|
|
7
|
+
mood?: MascotMood;
|
|
8
|
+
/** The active animation style. Defaults to 'none'. */
|
|
9
|
+
animation?: MascotAnimation;
|
|
10
|
+
/** The size class of the mascot. Defaults to 'md'. */
|
|
11
|
+
size?: MascotSize;
|
|
12
|
+
/** Master switch for all animations. Defaults to true. */
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
/** Whether the bobbing animation is enabled. Defaults to null, falling back to animate. */
|
|
15
|
+
animateBobbing?: boolean;
|
|
16
|
+
/** Whether the blinking timer animation is enabled. Defaults to null, falling back to animate. */
|
|
17
|
+
animateBlinking?: boolean;
|
|
18
|
+
/** Whether the sprout swaying animation is enabled. Defaults to null, falling back to animate. */
|
|
19
|
+
animateSprout?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Mascot component displaying Tobi the tortoise.
|
|
23
|
+
*
|
|
24
|
+
* Supports three moods ('happy', 'think', and 'wave') and toggleable animations
|
|
25
|
+
* (breathing bobbing, blinking timers, sprout swaying).
|
|
26
|
+
* States and theme styling are driven by the headless core `@refraction-ui/mascot`.
|
|
27
|
+
*/
|
|
28
|
+
declare const Mascot: React.ForwardRefExoticComponent<Omit<MascotProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
29
|
+
|
|
30
|
+
export { Mascot, type MascotProps };
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SliderProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
variant?: 'default';
|
|
5
|
+
}
|
|
6
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
+
|
|
8
|
+
export { Slider, type SliderProps };
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SliderProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
variant?: 'default';
|
|
5
|
+
}
|
|
6
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
+
|
|
8
|
+
export { Slider, type SliderProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refraction-ui/react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "All Refraction UI React components in one package — headless, accessible, zero-dependency",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
"@refraction-ui/react-logger": "workspace:*",
|
|
118
118
|
"@refraction-ui/react-markdown-renderer": "workspace:*",
|
|
119
119
|
"@refraction-ui/react-marquee-strip": "workspace:*",
|
|
120
|
+
"@refraction-ui/react-mascot": "workspace:*",
|
|
120
121
|
"@refraction-ui/react-mastery-bar": "workspace:*",
|
|
121
122
|
"@refraction-ui/react-mini-map": "workspace:*",
|
|
122
123
|
"@refraction-ui/react-mobile-nav": "workspace:*",
|