@radix-ng/primitives 0.37.0 → 0.39.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/accordion/index.d.ts +3 -1
- package/accordion/src/accordion-content-presence.directive.d.ts +6 -0
- package/accordion/src/accordion-content.directive.d.ts +7 -8
- package/accordion/src/accordion-header.directive.d.ts +2 -2
- package/accordion/src/accordion-item.directive.d.ts +29 -77
- package/accordion/src/accordion-root.directive.d.ts +49 -78
- package/accordion/src/accordion-trigger.directive.d.ts +6 -11
- package/collapsible/index.d.ts +11 -0
- package/collapsible/src/collapsible-content-presence.directive.d.ts +6 -0
- package/collapsible/src/collapsible-content.directive.d.ts +13 -9
- package/collapsible/src/collapsible-root.directive.d.ts +19 -37
- package/collapsible/src/collapsible-trigger.directive.d.ts +1 -21
- package/core/index.d.ts +5 -0
- package/core/src/accessor/control-value-accessor.d.ts +67 -0
- package/core/src/create-context.d.ts +10 -0
- package/core/src/date-time/comparators.d.ts +7 -1
- package/core/src/date-time/useDateField.d.ts +2 -2
- package/core/src/types.d.ts +24 -0
- package/{stepper/src/utils → core/src}/useArrowNavigation.d.ts +2 -2
- package/core/src/useResizeObserver.d.ts +15 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +231 -398
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +2 -10
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +3 -14
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +151 -143
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +248 -7
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +1 -3
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +1 -8
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +2 -6
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +2 -6
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +34 -1
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +2 -7
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +1 -3
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +75 -33
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +1 -84
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +61 -97
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +4 -19
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +351 -0
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +1 -6
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +1 -3
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/hover-card/src/hover-card-root.directive.d.ts +4 -4
- package/package.json +5 -1
- package/popover/src/popover-root.directive.d.ts +4 -4
- package/presence/index.d.ts +1 -0
- package/presence/src/presence.directive.d.ts +27 -0
- package/select/src/select-trigger.directive.d.ts +8 -2
- package/select/src/select.component.d.ts +23 -6
- package/switch/index.d.ts +0 -1
- package/switch/src/switch-input.directive.d.ts +1 -1
- package/switch/src/switch-root.directive.d.ts +23 -43
- package/switch/src/switch-thumb.directive.d.ts +1 -1
- package/time-field/README.md +1 -0
- package/time-field/index.d.ts +11 -0
- package/time-field/src/time-field-context.token.d.ts +19 -0
- package/time-field/src/time-field-input.directive.d.ts +53 -0
- package/time-field/src/time-field-root.directive.d.ts +125 -0
- package/tooltip/src/tooltip-root.directive.d.ts +4 -4
- package/collapsible/src/collapsible-content.token.d.ts +0 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CalendarDateTime, type DateValue, ZonedDateTime } from '@internationalized/date';
|
1
|
+
import { CalendarDateTime, type DateValue, Time, ZonedDateTime } from '@internationalized/date';
|
2
2
|
import type { DateMatcher } from './types';
|
3
3
|
/**
|
4
4
|
* Given a `DateValue` object, convert it to a native `Date` object.
|
@@ -70,6 +70,7 @@ export declare function isBetween(date: DateValue, start: DateValue, end: DateVa
|
|
70
70
|
export declare function getLastFirstDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
|
71
71
|
export declare function getNextLastDayOfWeek<T extends DateValue = DateValue>(date: T, firstDayOfWeek: number, locale: string): T;
|
72
72
|
export declare function areAllDaysBetweenValid(start: DateValue, end: DateValue, isUnavailable: DateMatcher | undefined, isDisabled: DateMatcher | undefined): boolean;
|
73
|
+
export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
73
74
|
export type Granularity = 'day' | 'hour' | 'minute' | 'second';
|
74
75
|
export type TimeGranularity = 'hour' | 'minute' | 'second';
|
75
76
|
type GetDefaultDateProps = {
|
@@ -89,4 +90,9 @@ type GetDefaultDateProps = {
|
|
89
90
|
*
|
90
91
|
*/
|
91
92
|
export declare function getDefaultDate(props: GetDefaultDateProps): DateValue;
|
93
|
+
type GetDefaultTimeProps = {
|
94
|
+
defaultValue?: TimeValue | undefined;
|
95
|
+
defaultPlaceholder?: TimeValue | undefined;
|
96
|
+
};
|
97
|
+
export declare function getDefaultTime(props: GetDefaultTimeProps): TimeValue;
|
92
98
|
export {};
|
@@ -5,14 +5,14 @@ import { HourCycle, SegmentPart, SegmentValueObj } from './types';
|
|
5
5
|
export type UseDateFieldProps = {
|
6
6
|
hasLeftFocus: WritableSignal<boolean>;
|
7
7
|
lastKeyZero: WritableSignal<boolean>;
|
8
|
-
placeholder: ModelSignal<DateValue>;
|
8
|
+
placeholder: ModelSignal<DateValue> | WritableSignal<DateValue>;
|
9
9
|
hourCycle: HourCycle;
|
10
10
|
formatter: Formatter;
|
11
11
|
segmentValues: WritableSignal<SegmentValueObj>;
|
12
12
|
disabled: InputSignal<boolean>;
|
13
13
|
readonly: InputSignal<boolean>;
|
14
14
|
part: SegmentPart;
|
15
|
-
modelValue: ModelSignal<DateValue | undefined>;
|
15
|
+
modelValue: ModelSignal<DateValue | undefined> | WritableSignal<DateValue | undefined>;
|
16
16
|
focusNext: () => void;
|
17
17
|
};
|
18
18
|
type SegmentAttrProps = {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export type DataOrientation = 'vertical' | 'horizontal';
|
2
|
+
/**
|
3
|
+
* Nullable from `Type` adds `null` and `undefined`
|
4
|
+
*
|
5
|
+
* @example ```ts
|
6
|
+
* // Expect: string | number | undefined | null
|
7
|
+
* type Value = Nulling<string | number>;
|
8
|
+
* ```
|
9
|
+
*/
|
10
|
+
export type Nullable<Type> = null | Type | undefined;
|
11
|
+
/**
|
12
|
+
* SafeFunction is a type for functions that accept any number of arguments of unknown types
|
13
|
+
* and return a value of an unknown type. This is useful when you want to define a function
|
14
|
+
* without being strict about the input or output types, maintaining flexibility.
|
15
|
+
*
|
16
|
+
* @example ```ts
|
17
|
+
* const safeFn: SafeFunction = (...args) => {
|
18
|
+
* return args.length > 0 ? args[0] : null;
|
19
|
+
* };
|
20
|
+
*
|
21
|
+
* const result = safeFn(1, 'hello'); // result: 1
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
export type SafeFunction = (...args: unknown[]) => unknown;
|
@@ -10,7 +10,7 @@ interface ArrowNavigationOptions {
|
|
10
10
|
/**
|
11
11
|
* The attribute name to find the collection items in the parent element.
|
12
12
|
*
|
13
|
-
* @defaultValue "data-
|
13
|
+
* @defaultValue "data-rdx-collection-item"
|
14
14
|
*/
|
15
15
|
attributeName?: string;
|
16
16
|
/**
|
@@ -53,7 +53,7 @@ interface ArrowNavigationOptions {
|
|
53
53
|
focus?: boolean;
|
54
54
|
}
|
55
55
|
/**
|
56
|
-
* Allow arrow navigation for every html element with data-
|
56
|
+
* Allow arrow navigation for every html element with data-rdx-collection-item tag
|
57
57
|
*
|
58
58
|
* @param e Keyboard event
|
59
59
|
* @param currentElement Event initiator element or any element that wants to handle the navigation
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { EffectRef, ElementRef, Injector, Signal } from '@angular/core';
|
2
|
+
/**
|
3
|
+
* Creates a resize observer effect for element
|
4
|
+
*
|
5
|
+
* @param options Configuration options
|
6
|
+
* @param options.injector Angular injector
|
7
|
+
* @param options.element Signal returning the element to observe
|
8
|
+
* @param options.onResize Callback when element is resized
|
9
|
+
* @returns EffectRef that can be destroyed when needed
|
10
|
+
*/
|
11
|
+
export declare function resizeEffect(options: {
|
12
|
+
injector: Injector;
|
13
|
+
element: Signal<ElementRef | HTMLElement | null | undefined>;
|
14
|
+
onResize: ResizeObserverCallback;
|
15
|
+
}): EffectRef;
|