@kazee-ds/react 0.6.0 → 0.8.0
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/README.md +2 -2
- package/dist/index.js +2077 -179
- package/dist/index.js.map +1 -1
- package/dist/types/Avatar.d.ts +42 -0
- package/dist/types/AvatarGroup.d.ts +18 -0
- package/dist/types/Badge.d.ts +23 -5
- package/dist/types/Button.d.ts +1 -1
- package/dist/types/Calendar.d.ts +60 -0
- package/dist/types/Card.d.ts +30 -8
- package/dist/types/DropdownMenu.d.ts +2 -1
- package/dist/types/Input.d.ts +8 -3
- package/dist/types/OverlayDirection.d.ts +1 -1
- package/dist/types/Select.d.ts +2 -2
- package/dist/types/Switch.d.ts +9 -2
- package/dist/types/Tabs.d.ts +3 -1
- package/dist/types/TemporalField.d.ts +36 -0
- package/dist/types/TemporalPicker.d.ts +137 -0
- package/dist/types/TimeControls.d.ts +14 -0
- package/dist/types/ToggleButton.d.ts +2 -1
- package/dist/types/ToggleButtonGroup.d.ts +2 -0
- package/dist/types/choice-composition.d.ts +5 -2
- package/dist/types/control-composition.d.ts +6 -5
- package/dist/types/date-range-model.d.ts +3 -1
- package/dist/types/index.d.ts +19 -1
- package/dist/types/input-clear.d.ts +24 -0
- package/dist/types/switch-visual.d.ts +21 -0
- package/dist/types/temporal-model.d.ts +44 -0
- package/dist/types/toggle-group-model.d.ts +1 -1
- package/dist/types/visual-slot.d.ts +3 -0
- package/dist/types/visual.d.ts +5 -0
- package/package.json +1 -1
|
@@ -27,7 +27,9 @@ export interface DateRangeOptions extends DateRangeConstraints {
|
|
|
27
27
|
dir?: 'ltr' | 'rtl';
|
|
28
28
|
visibleMonths?: 1 | 2;
|
|
29
29
|
weekStartsOn?: 0 | 1;
|
|
30
|
-
display?: 'popover' | 'inline';
|
|
30
|
+
display?: 'popover' | 'inline' | 'dialog' | 'auto';
|
|
31
|
+
commitMode?: 'apply' | 'immediate';
|
|
32
|
+
showActions?: boolean;
|
|
31
33
|
showInputs?: boolean;
|
|
32
34
|
showMonthYearPicker?: boolean;
|
|
33
35
|
triggerDisplay?: 'text' | 'icon';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -36,7 +36,12 @@ export type { NumberFieldProps } from './NumberField.js';
|
|
|
36
36
|
export { Card } from './Card.js';
|
|
37
37
|
export type { CardProps } from './Card.js';
|
|
38
38
|
export { Badge } from './Badge.js';
|
|
39
|
-
export type { BadgeProps, BadgeTone } from './Badge.js';
|
|
39
|
+
export type { BadgeProps, BadgeTone, BadgeVariant } from './Badge.js';
|
|
40
|
+
export { Avatar, AvatarRoot, AvatarImage, AvatarFallback, AvatarBadge } from './Avatar.js';
|
|
41
|
+
export type { AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarBadgeProps, } from './Avatar.js';
|
|
42
|
+
export { AvatarGroup, AvatarGroupRoot, AvatarGroupCount } from './AvatarGroup.js';
|
|
43
|
+
export type { AvatarGroupProps } from './AvatarGroup.js';
|
|
44
|
+
export type { Tone, ComponentSize, IndicatorPlacement, AvatarVariant, ImageLoadingStatus, } from './visual.js';
|
|
40
45
|
export { Skeleton } from './Skeleton.js';
|
|
41
46
|
export type { SkeletonProps } from './Skeleton.js';
|
|
42
47
|
export { Separator } from './Separator.js';
|
|
@@ -112,3 +117,16 @@ export type { SidebarRootProps, DataTableRootProps } from './layout-parts.js';
|
|
|
112
117
|
export { ToastRoot, ToastIndicator, ToastBody, ToastTitle, ToastDescription, ToastActions, ToastActionButton, ToastCloseButton, ToastProgress, } from './Toast.js';
|
|
113
118
|
export { DropdownItemIndicator, DropdownSubmenuTrigger, DropdownSubmenuIndicator, } from './structural-parts.js';
|
|
114
119
|
export { DataTableColumn as DataTableColumnPart, DataTableEmpty } from './layout-parts.js';
|
|
120
|
+
export { Calendar, RangeCalendar, MonthPicker, YearPicker, MonthYearNavigation, } from './Calendar.js';
|
|
121
|
+
export type { CalendarProps, RangeCalendarProps, MonthPickerProps, YearPickerProps, MonthYearNavigationProps, } from './Calendar.js';
|
|
122
|
+
export { DateField, TimeField, DateTimeField, DateRangeField, TimeRangeField, DateTimeRangeField, } from './TemporalField.js';
|
|
123
|
+
export type { TemporalFieldProps, TemporalRangeFieldProps } from './TemporalField.js';
|
|
124
|
+
export { TimeList, TimeClock } from './TimeControls.js';
|
|
125
|
+
export type { TimeControlProps } from './TimeControls.js';
|
|
126
|
+
export { DatePicker, TimePicker, TimeRangePicker, DateTimePicker, DateTimeRangePicker, } from './TemporalPicker.js';
|
|
127
|
+
export type { TemporalPickerProps, TemporalPickerOptions, TemporalPreset, TemporalValue, } from './TemporalPicker.js';
|
|
128
|
+
export type { TemporalConstraints, TemporalRange, TemporalKind, TemporalError, } from './temporal-model.js';
|
|
129
|
+
export { SwitchGroup } from './switch-visual.js';
|
|
130
|
+
export type { SwitchVisualProps } from './switch-visual.js';
|
|
131
|
+
export { InputClearButton } from './input-clear.js';
|
|
132
|
+
export type { CardInteractionProps } from './Card.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RefObject, type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export declare const InputClearContext: import("react").Context<{
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
} | null>;
|
|
8
|
+
export declare function useClearableInput({ value, defaultValue, onChange, isDisabled, isReadOnly, }: {
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isReadOnly?: boolean;
|
|
14
|
+
}, element: RefObject<HTMLElement | null>): {
|
|
15
|
+
value: string;
|
|
16
|
+
update: (next: string) => void;
|
|
17
|
+
context: {
|
|
18
|
+
value: string;
|
|
19
|
+
disabled: boolean | undefined;
|
|
20
|
+
readOnly: boolean | undefined;
|
|
21
|
+
clear: () => void;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function InputClearButton({ className, children, onClick, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { Tone, ComponentSize } from './visual.js';
|
|
3
|
+
export interface SwitchVisualProps {
|
|
4
|
+
size?: ComponentSize;
|
|
5
|
+
tone?: Tone;
|
|
6
|
+
variant?: 'default' | 'outline';
|
|
7
|
+
}
|
|
8
|
+
export declare const SwitchVisualContext: import("react").Context<SwitchVisualProps & {
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function SwitchGroup({ size, tone, variant, isDisabled, orientation, className, ...props }: HTMLAttributes<HTMLDivElement> & SwitchVisualProps & {
|
|
12
|
+
label?: string;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function useSwitchVisual(props: SwitchVisualProps): {
|
|
17
|
+
size: ComponentSize;
|
|
18
|
+
tone: Tone;
|
|
19
|
+
variant: "default" | "outline";
|
|
20
|
+
disabled: boolean | undefined;
|
|
21
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type TemporalKind = 'date' | 'time' | 'datetime';
|
|
2
|
+
export interface TemporalRange {
|
|
3
|
+
start: string;
|
|
4
|
+
end: string;
|
|
5
|
+
}
|
|
6
|
+
export type TemporalError = 'invalid' | 'required' | 'incomplete' | 'order' | 'bounds' | 'unavailable' | 'step';
|
|
7
|
+
export interface TemporalConstraints {
|
|
8
|
+
kind: TemporalKind;
|
|
9
|
+
minDate?: string;
|
|
10
|
+
maxDate?: string;
|
|
11
|
+
minTime?: string;
|
|
12
|
+
maxTime?: string;
|
|
13
|
+
minDateTime?: string;
|
|
14
|
+
maxDateTime?: string;
|
|
15
|
+
isDateUnavailable?: (date: string) => boolean;
|
|
16
|
+
isTimeUnavailable?: (time: string) => boolean;
|
|
17
|
+
isRequired?: boolean;
|
|
18
|
+
hourStep?: number;
|
|
19
|
+
minuteStep?: number;
|
|
20
|
+
secondStep?: number;
|
|
21
|
+
granularity?: 'hour' | 'minute' | 'second';
|
|
22
|
+
timeZone?: string;
|
|
23
|
+
disambiguation?: 'compatible' | 'earlier' | 'later' | 'reject';
|
|
24
|
+
}
|
|
25
|
+
/** Wall time is resolved explicitly; DST gaps/overlaps reject by default. */
|
|
26
|
+
export declare function toZonedValue(value: string, timeZone?: string, disambiguation?: TemporalConstraints['disambiguation']): string;
|
|
27
|
+
export declare function toLocalValue(value: string, timeZone?: string, seconds?: boolean): string;
|
|
28
|
+
export declare function temporalError(value: string | null, options: TemporalConstraints): TemporalError | null;
|
|
29
|
+
export declare function temporalRangeError(value: TemporalRange | null, options: TemporalConstraints): TemporalError | null;
|
|
30
|
+
/** Project instant boundaries into the selected display zone for disabled calendar/time options. */
|
|
31
|
+
export declare function temporalDisplayBounds(options: TemporalConstraints, selectedDate?: string): {
|
|
32
|
+
minDate: string | undefined;
|
|
33
|
+
maxDate: string | undefined;
|
|
34
|
+
minTime: string | undefined;
|
|
35
|
+
maxTime: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
/** Minute-granularity list; seconds are edited with TimeField/TimeClock to avoid 86k DOM options. */
|
|
38
|
+
export declare function timeChoices(options: TemporalConstraints): string[];
|
|
39
|
+
/** User edits zero units hidden by the configured field granularity. */
|
|
40
|
+
export declare function normalizeTime(value: string, granularity?: TemporalConstraints['granularity']): string;
|
|
41
|
+
export declare function normalizeWallDateTime(value: string, granularity?: TemporalConstraints['granularity']): string;
|
|
42
|
+
/** Keep the selected unit and choose the nearest complete valid time for the other units. */
|
|
43
|
+
export declare function resolveTimeUnit(value: string, part: 'hour' | 'minute' | 'second', selected: number, options: TemporalConstraints): string | null;
|
|
44
|
+
export declare function temporalMessages(locale?: string): Record<TemporalError, string>;
|
|
@@ -4,6 +4,6 @@ export interface ToggleGroupItem {
|
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export type ToggleGroupMode = 'single' | 'multiple';
|
|
7
|
-
export type ToggleGroupVariant = 'outline' | 'ghost';
|
|
7
|
+
export type ToggleGroupVariant = 'outline' | 'ghost' | 'chip';
|
|
8
8
|
/** Normalize IDs without discarding existing disabled selections. */
|
|
9
9
|
export declare function toggleIds(value: unknown, items: ToggleGroupItem[], multiple: boolean): string[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
/** Decorate one child while preserving its handlers and ref. */
|
|
3
|
+
export declare function visualSlot(children: ReactNode, props: Record<string, unknown>): ReactElement<Record<string, unknown>, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type Tone = 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
2
|
+
export type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type IndicatorPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
4
|
+
export type AvatarVariant = 'default' | 'soft';
|
|
5
|
+
export type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|