@vinyasa/form 1.0.22 → 1.0.23
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/cjs/autocomplete.cjs +709 -309
- package/dist/cjs/autocomplete.css +1 -1
- package/dist/cjs/checkbox.cjs +399 -244
- package/dist/cjs/checkbox.css +5 -1
- package/dist/cjs/color-picker.cjs +478 -325
- package/dist/cjs/color-picker.css +1 -1
- package/dist/cjs/combobox.cjs +574 -359
- package/dist/cjs/combobox.css +1 -1
- package/dist/cjs/date-picker.cjs +522 -322
- package/dist/cjs/date-picker.css +1 -1
- package/dist/cjs/dropzone.cjs +562 -391
- package/dist/cjs/dropzone.css +1 -1
- package/dist/cjs/field.cjs +353 -0
- package/dist/cjs/field.css +139 -0
- package/dist/cjs/file-upload.cjs +667 -380
- package/dist/cjs/file-upload.css +44 -1
- package/dist/cjs/index.cjs +3066 -2546
- package/dist/cjs/index.css +9 -1
- package/dist/cjs/input.cjs +220 -74
- package/dist/cjs/input.css +1 -1
- package/dist/cjs/multi-select.cjs +756 -400
- package/dist/cjs/multi-select.css +1 -1
- package/dist/cjs/number-input.cjs +267 -125
- package/dist/cjs/number-input.css +1 -1
- package/dist/cjs/otp-input.cjs +232 -85
- package/dist/cjs/otp-input.css +1 -1
- package/dist/cjs/password-input.cjs +239 -93
- package/dist/cjs/password-input.css +1 -1
- package/dist/cjs/radio-group.cjs +388 -246
- package/dist/cjs/radio-group.css +1 -1
- package/dist/cjs/range-slider.cjs +106 -62
- package/dist/cjs/rich-text-editor.cjs +549 -517
- package/dist/cjs/rich-text-editor.css +1 -1
- package/dist/cjs/search-input.cjs +244 -98
- package/dist/cjs/search-input.css +1 -1
- package/dist/cjs/select.cjs +485 -353
- package/dist/cjs/select.css +1 -1
- package/dist/cjs/slider.cjs +129 -155
- package/dist/cjs/switch.cjs +376 -239
- package/dist/cjs/switch.css +5 -1
- package/dist/cjs/tags-input.cjs +264 -113
- package/dist/cjs/tags-input.css +1 -1
- package/dist/cjs/textarea.cjs +225 -79
- package/dist/cjs/textarea.css +1 -1
- package/dist/cjs/time-picker.cjs +546 -371
- package/dist/cjs/time-picker.css +1 -1
- package/dist/cjs/toggle-button.cjs +18 -15
- package/dist/esm/{switch.css → 1485.css} +4 -0
- package/dist/esm/1485.js +28 -0
- package/dist/esm/{2995.css → 2315.css} +1 -1
- package/dist/esm/{2995.js → 2315.js} +96 -4
- package/dist/esm/2692.js +114 -0
- package/dist/esm/27.js +23 -27
- package/dist/esm/345.js +81 -0
- package/dist/esm/5074.js +66 -0
- package/dist/esm/5333.js +72 -0
- package/dist/esm/6982.js +35 -0
- package/dist/esm/7580.js +34 -0
- package/dist/esm/7678.js +101 -0
- package/dist/esm/7800.js +131 -0
- package/dist/esm/8479.js +115 -0
- package/dist/esm/{checkbox.css → 9167.css} +4 -0
- package/dist/esm/9167.js +30 -0
- package/dist/esm/9545.js +118 -0
- package/dist/esm/{2942.css → 9559.css} +43 -0
- package/dist/esm/9559.js +179 -0
- package/dist/esm/autocomplete.js +2 -95
- package/dist/esm/checkbox.js +1 -38
- package/dist/esm/color-picker.js +1 -130
- package/dist/esm/combobox.js +1 -126
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +26 -16
- package/dist/esm/components/autocomplete/index.d.ts +1 -3
- package/dist/esm/components/checkbox/Checkbox.d.ts +12 -4
- package/dist/esm/components/checkbox/index.d.ts +1 -3
- package/dist/esm/components/color-picker/ColorPicker.d.ts +28 -21
- package/dist/esm/components/color-picker/index.d.ts +1 -3
- package/dist/esm/components/combobox/Combobox.d.ts +55 -29
- package/dist/esm/components/combobox/index.d.ts +1 -3
- package/dist/esm/components/date-picker/DatePicker.d.ts +28 -24
- package/dist/esm/components/date-picker/index.d.ts +1 -3
- package/dist/esm/components/dropzone/Dropzone.d.ts +52 -9
- package/dist/esm/components/dropzone/index.d.ts +1 -3
- package/dist/esm/components/field/Field.d.ts +106 -0
- package/dist/esm/components/field/index.d.ts +1 -0
- package/dist/esm/components/file-upload/FileUpload.d.ts +11 -18
- package/dist/esm/components/file-upload/index.d.ts +1 -3
- package/dist/esm/components/icon-button/IconButton.d.ts +1 -1
- package/dist/esm/components/input/Input.d.ts +3 -5
- package/dist/esm/components/multi-select/MultiSelect.d.ts +37 -30
- package/dist/esm/components/multi-select/index.d.ts +1 -3
- package/dist/esm/components/number-input/NumberInput.d.ts +3 -5
- package/dist/esm/components/otp-input/OtpInput.d.ts +2 -4
- package/dist/esm/components/password-input/PasswordInput.d.ts +3 -5
- package/dist/esm/components/radio-group/RadioGroup.d.ts +18 -10
- package/dist/esm/components/radio-group/index.d.ts +1 -3
- package/dist/esm/components/range-slider/RangeSlider.d.ts +1 -1
- package/dist/esm/components/rich-text-editor/RichTextEditor.d.ts +44 -7
- package/dist/esm/components/rich-text-editor/index.d.ts +1 -3
- package/dist/esm/components/search-input/SearchInput.d.ts +3 -5
- package/dist/esm/components/select/Select.d.ts +36 -23
- package/dist/esm/components/select/index.d.ts +1 -3
- package/dist/esm/components/slider/Slider.d.ts +17 -10
- package/dist/esm/components/slider/index.d.ts +1 -3
- package/dist/esm/components/switch/Switch.d.ts +10 -5
- package/dist/esm/components/switch/index.d.ts +1 -3
- package/dist/esm/components/tags-input/TagsInput.d.ts +3 -5
- package/dist/esm/components/textarea/Textarea.d.ts +3 -5
- package/dist/esm/components/time-picker/TimePicker.d.ts +31 -23
- package/dist/esm/components/time-picker/index.d.ts +1 -3
- package/dist/esm/date-picker.js +1 -118
- package/dist/esm/dropzone.js +1 -137
- package/dist/esm/field.d.ts +2 -24
- package/dist/esm/field.js +1 -0
- package/dist/esm/file-upload.js +2 -123
- package/dist/esm/index.d.ts +15 -14
- package/dist/esm/index.js +15 -14
- package/dist/esm/input.js +16 -25
- package/dist/esm/multi-select.js +2 -164
- package/dist/esm/number-input.js +65 -78
- package/dist/esm/otp-input.js +31 -38
- package/dist/esm/password-input.js +32 -41
- package/dist/esm/radio-group.js +1 -44
- package/dist/esm/range-slider.js +15 -8
- package/dist/esm/rich-text-editor.js +1 -212
- package/dist/esm/search-input.js +35 -44
- package/dist/esm/select.js +1 -87
- package/dist/esm/slider.js +1 -4
- package/dist/esm/switch.js +1 -36
- package/dist/esm/tags-input.js +51 -59
- package/dist/esm/textarea.js +22 -31
- package/dist/esm/time-picker.js +1 -137
- package/package.json +18 -9
- package/dist/esm/2942.js +0 -13
- package/dist/esm/4557.js +0 -39
- package/dist/esm/dropzone.css +0 -43
- /package/dist/esm/{date-picker.css → 2692.css} +0 -0
- /package/dist/esm/{select.css → 5333.css} +0 -0
- /package/dist/esm/{radio-group.css → 7580.css} +0 -0
- /package/dist/esm/{color-picker.css → 7678.css} +0 -0
- /package/dist/esm/{rich-text-editor.css → 9545.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SliderProps } from '../slider/Slider';
|
|
2
|
-
export interface RangeSliderProps extends Omit<SliderProps, 'value' | 'defaultValue' | '
|
|
2
|
+
export interface RangeSliderProps extends Omit<SliderProps, 'value' | 'defaultValue' | 'minStepsBetweenThumbs'> {
|
|
3
3
|
value?: [number, number];
|
|
4
4
|
defaultValue?: [number, number];
|
|
5
5
|
minLabel?: string;
|
|
@@ -1,18 +1,55 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
1
2
|
import { type ReactNode } from 'react';
|
|
3
|
+
import { type ToggleButtonProps } from '../toggle-button/ToggleButton';
|
|
4
|
+
/** The raw Tiptap editor instance, for calling commands (`editor.chain().focus().toggleBold().run()`). */
|
|
5
|
+
export declare const useRichTextEditorContext: () => Editor | null;
|
|
6
|
+
/**
|
|
7
|
+
* Whether the given mark/node is active at the current selection — a plain
|
|
8
|
+
* `editor.isActive(name)` call doesn't itself trigger a re-render when the
|
|
9
|
+
* selection changes (the editor instance mutates internally without
|
|
10
|
+
* changing identity), so each toolbar button subscribes to just the one
|
|
11
|
+
* piece of state it needs via `useEditorState` instead of the whole editor.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useRichTextEditorActive: (name: string, attributes?: Record<string, unknown>) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the editor is currently non-editable — same reactive-subscription
|
|
16
|
+
* reasoning as `useRichTextEditorActive`, so a toolbar button can disable
|
|
17
|
+
* itself in step with `RichTextEditor`'s own `disabled` prop instead of that
|
|
18
|
+
* prop being threaded to every button by hand.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useRichTextEditorDisabled: () => boolean;
|
|
2
21
|
export interface RichTextEditorProps {
|
|
3
22
|
/** HTML content. */
|
|
4
23
|
value?: string;
|
|
5
24
|
defaultValue?: string;
|
|
6
25
|
onValueChange?: (html: string) => void;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
error?: ReactNode;
|
|
10
|
-
required?: boolean;
|
|
26
|
+
/** Marks the editor invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
27
|
+
invalid?: boolean;
|
|
11
28
|
disabled?: boolean;
|
|
12
29
|
id?: string;
|
|
30
|
+
children: ReactNode;
|
|
13
31
|
}
|
|
14
|
-
declare const RichTextEditor: {
|
|
15
|
-
({ value, defaultValue, onValueChange,
|
|
32
|
+
export declare const RichTextEditor: {
|
|
33
|
+
({ value, defaultValue, onValueChange, invalid, disabled, id: idProp, children, }: RichTextEditorProps): import("react").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
export interface RichTextEditorToolbarProps {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export declare const RichTextEditorToolbar: {
|
|
40
|
+
({ children }: RichTextEditorToolbarProps): import("react").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const RichTextEditorDivider: {
|
|
44
|
+
(): import("react").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
export type RichTextEditorToolbarButtonProps = Omit<ToggleButtonProps, 'unpressedVariant' | 'pressedVariant' | 'size'>;
|
|
48
|
+
export declare const RichTextEditorToolbarButton: {
|
|
49
|
+
(props: RichTextEditorToolbarButtonProps): import("react").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const RichTextEditorContent: {
|
|
53
|
+
(): import("react").JSX.Element | null;
|
|
16
54
|
displayName: string;
|
|
17
55
|
};
|
|
18
|
-
export default RichTextEditor;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default RichTextEditor;
|
|
3
|
-
export type { RichTextEditorProps } from './RichTextEditor';
|
|
1
|
+
export { RichTextEditor, RichTextEditorContent, RichTextEditorDivider, RichTextEditorToolbar, RichTextEditorToolbarButton, useRichTextEditorActive, useRichTextEditorContext, useRichTextEditorDisabled, type RichTextEditorProps, type RichTextEditorToolbarButtonProps, type RichTextEditorToolbarProps, } from './RichTextEditor';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
export type SearchInputSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface SearchInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size' | 'type'> {
|
|
4
|
-
label?: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
6
|
-
error?: ReactNode;
|
|
7
|
-
required?: boolean;
|
|
8
4
|
size?: SearchInputSize;
|
|
5
|
+
/** Marks the input invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
6
|
+
invalid?: boolean;
|
|
9
7
|
/** Shows a clear button once there's a value; omit to hide it entirely. */
|
|
10
8
|
onClear?: () => void;
|
|
11
9
|
}
|
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export interface SelectProps extends Omit<RadixSelect.SelectProps, 'children'> {
|
|
9
|
-
options: SelectOption[];
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
description?: ReactNode;
|
|
13
|
-
error?: ReactNode;
|
|
14
|
-
required?: boolean;
|
|
3
|
+
export declare const Select: import("react").FC<RadixSelect.SelectProps>;
|
|
4
|
+
export interface SelectTriggerProps extends Omit<RadixSelect.SelectTriggerProps, 'id'> {
|
|
5
|
+
/** Marks the trigger invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
6
|
+
invalid?: boolean;
|
|
15
7
|
size?: 'sm' | 'md' | 'lg';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SelectTrigger: {
|
|
11
|
+
({ invalid, size, id: idProp, className, ...rest }: SelectTriggerProps): import("react").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export interface SelectValueProps extends RadixSelect.SelectValueProps {
|
|
15
|
+
placeholder?: ReactNode;
|
|
24
16
|
}
|
|
25
|
-
declare const
|
|
26
|
-
({
|
|
17
|
+
export declare const SelectValue: {
|
|
18
|
+
({ className, placeholder, ...rest }: SelectValueProps): import("react").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const SelectIcon: {
|
|
22
|
+
({ className, children, ...rest }: RadixSelect.SelectIconProps): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const SelectContent: {
|
|
26
|
+
({ className, ...rest }: RadixSelect.SelectContentProps): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const SelectViewport: {
|
|
30
|
+
({ className, ...rest }: RadixSelect.SelectViewportProps): import("react").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export type SelectItemProps = RadixSelect.SelectItemProps;
|
|
34
|
+
export declare const SelectItem: {
|
|
35
|
+
({ className, ...rest }: SelectItemProps): import("react").JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const SelectItemText: import("react").ForwardRefExoticComponent<RadixSelect.SelectItemTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export declare const SelectItemIndicator: {
|
|
40
|
+
({ className, children, ...rest }: RadixSelect.SelectItemIndicatorProps): import("react").JSX.Element;
|
|
27
41
|
displayName: string;
|
|
28
42
|
};
|
|
29
|
-
export default Select;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default Select;
|
|
3
|
-
export type { SelectOption, SelectProps } from './Select';
|
|
1
|
+
export { Select, SelectContent, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectTrigger, SelectValue, SelectViewport, type SelectItemProps, type SelectTriggerProps, type SelectValueProps, } from './Select';
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import * as RadixSlider from '@radix-ui/react-slider';
|
|
2
|
-
export
|
|
3
|
-
/**
|
|
4
|
-
* Accessible name for each thumb. A single string is reused for every
|
|
5
|
-
* thumb; an array assigns one label per thumb by index (used by
|
|
6
|
-
* RangeSlider for distinct "Minimum"/"Maximum" labels).
|
|
7
|
-
*/
|
|
8
|
-
label?: string | string[];
|
|
2
|
+
export type SliderProps = Omit<RadixSlider.SliderProps, 'defaultValue'> & {
|
|
9
3
|
defaultValue?: number[];
|
|
10
|
-
}
|
|
11
|
-
declare const Slider: import("react").ForwardRefExoticComponent<SliderProps &
|
|
12
|
-
|
|
4
|
+
};
|
|
5
|
+
export declare const Slider: import("react").ForwardRefExoticComponent<Omit<RadixSlider.SliderProps, "defaultValue"> & {
|
|
6
|
+
defaultValue?: number[];
|
|
7
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export type SliderTrackProps = RadixSlider.SliderTrackProps;
|
|
9
|
+
export declare const SliderTrack: {
|
|
10
|
+
({ className, ...rest }: SliderTrackProps): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export type SliderRangeProps = RadixSlider.SliderRangeProps;
|
|
14
|
+
export declare const SliderRange: {
|
|
15
|
+
({ className, ...rest }: SliderRangeProps): import("react").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export type SliderThumbProps = RadixSlider.SliderThumbProps;
|
|
19
|
+
export declare const SliderThumb: import("react").ForwardRefExoticComponent<RadixSlider.SliderThumbProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface SwitchProps extends Omit<RadixSwitch.SwitchProps, 'id'> {
|
|
3
|
+
/** Marks the switch invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
4
|
+
invalid?: boolean;
|
|
5
|
+
id?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
export
|
|
7
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export type SwitchThumbProps = RadixSwitch.SwitchThumbProps;
|
|
9
|
+
export declare const SwitchThumb: {
|
|
10
|
+
({ className, ...rest }: SwitchThumbProps): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
1
|
export interface TagsInputProps {
|
|
3
2
|
value?: string[];
|
|
4
3
|
defaultValue?: string[];
|
|
5
4
|
onValueChange?: (value: string[]) => void;
|
|
6
5
|
placeholder?: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
error?: ReactNode;
|
|
10
|
-
required?: boolean;
|
|
6
|
+
/** Marks the input invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
7
|
+
invalid?: boolean;
|
|
11
8
|
size?: 'sm' | 'md' | 'lg';
|
|
12
9
|
/** Rejects further tags once this many are present. */
|
|
13
10
|
max?: number;
|
|
14
11
|
disabled?: boolean;
|
|
12
|
+
required?: boolean;
|
|
15
13
|
id?: string;
|
|
16
14
|
}
|
|
17
15
|
declare const TagsInput: import("react").ForwardRefExoticComponent<TagsInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
export type TextareaSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface TextareaProps extends Omit<ComponentPropsWithoutRef<'textarea'>, 'size'> {
|
|
4
|
-
label?: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
6
|
-
error?: ReactNode;
|
|
7
|
-
required?: boolean;
|
|
8
4
|
size?: TextareaSize;
|
|
5
|
+
/** Marks the textarea invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
6
|
+
invalid?: boolean;
|
|
9
7
|
/** Grows the textarea's height to fit its content instead of scrolling. */
|
|
10
8
|
autoResize?: boolean;
|
|
11
9
|
}
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as Popover from '@radix-ui/react-popover';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export type TimePickerProps = Popover.PopoverProps;
|
|
4
|
+
export declare const TimePicker: {
|
|
5
|
+
({ open, defaultOpen, onOpenChange, children, ...rest }: TimePickerProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
export interface TimePickerTriggerProps extends Omit<Popover.PopoverTriggerProps, 'id'> {
|
|
9
|
+
/** Marks the trigger invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const TimePickerTrigger: {
|
|
15
|
+
({ invalid, size, id: idProp, className, ...rest }: TimePickerTriggerProps): import("react").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export type TimePickerValueProps = ComponentPropsWithoutRef<'span'>;
|
|
19
|
+
export declare const TimePickerValue: {
|
|
20
|
+
({ className, ...rest }: TimePickerValueProps): import("react").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
export type TimePickerIconProps = ComponentPropsWithoutRef<'span'>;
|
|
24
|
+
export declare const TimePickerIcon: {
|
|
25
|
+
({ className, children, ...rest }: TimePickerIconProps): import("react").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
export interface TimePickerContentProps {
|
|
3
29
|
/** 24-hour "HH:mm", matching a native `<input type="time">`'s own value format. */
|
|
4
30
|
value?: string;
|
|
5
|
-
defaultValue?: string;
|
|
6
31
|
onValueChange?: (time: string) => void;
|
|
7
|
-
|
|
8
|
-
/** date-fns format string for the trigger's display text. Defaults to 'h:mm a' (e.g. "2:30 PM"). */
|
|
32
|
+
/** date-fns format string for each option's display text. Defaults to 'h:mm a' (e.g. "2:30 PM"). */
|
|
9
33
|
timeFormat?: string;
|
|
10
34
|
/** Interval, in minutes, between generated time options spanning the day. Defaults to 30. */
|
|
11
35
|
stepMinutes?: number;
|
|
12
|
-
label?: ReactNode;
|
|
13
|
-
description?: ReactNode;
|
|
14
|
-
error?: ReactNode;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
size?: 'sm' | 'md' | 'lg';
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Replaces the built-in trigger button entirely — passed straight through
|
|
20
|
-
* to Popover.Trigger's `asChild`, so it keeps the same open/close click
|
|
21
|
-
* and keyboard wiring. The element is responsible for its own styling and
|
|
22
|
-
* accessibility attributes (id, aria-describedby, disabled) since those
|
|
23
|
-
* aren't applied automatically the way they are to the default button.
|
|
24
|
-
*/
|
|
25
|
-
trigger?: ReactNode;
|
|
26
|
-
id?: string;
|
|
27
36
|
}
|
|
28
|
-
declare const
|
|
29
|
-
({ value,
|
|
37
|
+
export declare const TimePickerContent: {
|
|
38
|
+
({ value, onValueChange, timeFormat, stepMinutes, }: TimePickerContentProps): import("react").JSX.Element;
|
|
30
39
|
displayName: string;
|
|
31
40
|
};
|
|
32
|
-
export default TimePicker;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default TimePicker;
|
|
3
|
-
export type { TimePickerProps } from './TimePicker';
|
|
1
|
+
export { TimePicker, TimePickerContent, TimePickerIcon, TimePickerTrigger, TimePickerValue, type TimePickerContentProps, type TimePickerIconProps, type TimePickerProps, type TimePickerTriggerProps, type TimePickerValueProps, } from './TimePicker';
|
package/dist/esm/date-picker.js
CHANGED
|
@@ -1,118 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { CalendarIcon, ChevronLeftIcon, ChevronRightIcon } from "@vinyasa/icons";
|
|
4
|
-
import { format } from "date-fns";
|
|
5
|
-
import { useId, useState } from "react";
|
|
6
|
-
import { DayPicker } from "react-day-picker";
|
|
7
|
-
import { field, describedByIds } from "./4557.js";
|
|
8
|
-
import { fieldControl } from "./2995.js";
|
|
9
|
-
import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
|
|
10
|
-
var content = '_4znv390';
|
|
11
|
-
var day = '_4znv39c';
|
|
12
|
-
var dayButton = '_4znv39d';
|
|
13
|
-
var DatePicker_css_disabled = '_4znv39g';
|
|
14
|
-
var month = '_4znv397';
|
|
15
|
-
var monthCaption = '_4znv398';
|
|
16
|
-
var months = '_4znv396';
|
|
17
|
-
var nav = '_4znv399';
|
|
18
|
-
var navButton = '_4znv39a';
|
|
19
|
-
var outside = '_4znv39f';
|
|
20
|
-
var root = '_4znv395';
|
|
21
|
-
var selected = '_4znv39h';
|
|
22
|
-
var today = '_4znv39e';
|
|
23
|
-
var DatePicker_css_trigger = '_4znv391';
|
|
24
|
-
var triggerIcon = '_4znv394';
|
|
25
|
-
var triggerPlaceholder = '_4znv392';
|
|
26
|
-
var triggerText = '_4znv393';
|
|
27
|
-
var weekday = '_4znv39b';
|
|
28
|
-
const DatePicker = ({ value, defaultValue, onValueChange, placeholder = 'Pick a date', dateFormat = 'PPP', label, description, error, required, size, disabled, trigger, id: idProp })=>{
|
|
29
|
-
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
30
|
-
const isControlled = void 0 !== value;
|
|
31
|
-
const currentValue = isControlled ? value : internalValue;
|
|
32
|
-
const [open, setOpen] = useState(false);
|
|
33
|
-
const generatedId = useId();
|
|
34
|
-
const id = idProp ?? generatedId;
|
|
35
|
-
const handleSelect = (date)=>{
|
|
36
|
-
if (!isControlled) setInternalValue(date);
|
|
37
|
-
onValueChange?.(date);
|
|
38
|
-
setOpen(false);
|
|
39
|
-
};
|
|
40
|
-
return /*#__PURE__*/ jsx(field, {
|
|
41
|
-
id: id,
|
|
42
|
-
label: label,
|
|
43
|
-
description: description,
|
|
44
|
-
error: error,
|
|
45
|
-
required: required,
|
|
46
|
-
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
|
|
47
|
-
open: open,
|
|
48
|
-
onOpenChange: setOpen,
|
|
49
|
-
children: [
|
|
50
|
-
/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
|
|
51
|
-
asChild: true,
|
|
52
|
-
children: trigger ?? /*#__PURE__*/ jsxs("button", {
|
|
53
|
-
type: "button",
|
|
54
|
-
id: id,
|
|
55
|
-
disabled: disabled,
|
|
56
|
-
className: `${fieldControl({
|
|
57
|
-
size,
|
|
58
|
-
invalid: Boolean(error)
|
|
59
|
-
})} ${DatePicker_css_trigger}`,
|
|
60
|
-
"aria-describedby": describedByIds(id, {
|
|
61
|
-
description,
|
|
62
|
-
error
|
|
63
|
-
}),
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ jsx("span", {
|
|
66
|
-
className: currentValue ? triggerText : `${triggerText} ${triggerPlaceholder}`,
|
|
67
|
-
children: currentValue ? format(currentValue, dateFormat) : placeholder
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ jsx("span", {
|
|
70
|
-
className: triggerIcon,
|
|
71
|
-
"aria-hidden": "true",
|
|
72
|
-
children: /*#__PURE__*/ jsx(CalendarIcon, {})
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
77
|
-
/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
|
|
78
|
-
className: content,
|
|
79
|
-
align: "start",
|
|
80
|
-
sideOffset: 4,
|
|
81
|
-
onOpenAutoFocus: (event)=>{
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
},
|
|
84
|
-
children: /*#__PURE__*/ jsx(DayPicker, {
|
|
85
|
-
mode: "single",
|
|
86
|
-
selected: currentValue,
|
|
87
|
-
onSelect: handleSelect,
|
|
88
|
-
defaultMonth: currentValue,
|
|
89
|
-
classNames: {
|
|
90
|
-
root: root,
|
|
91
|
-
months: months,
|
|
92
|
-
month: month,
|
|
93
|
-
month_caption: monthCaption,
|
|
94
|
-
nav: nav,
|
|
95
|
-
button_previous: navButton,
|
|
96
|
-
button_next: navButton,
|
|
97
|
-
weekday: weekday,
|
|
98
|
-
day: day,
|
|
99
|
-
day_button: dayButton,
|
|
100
|
-
today: today,
|
|
101
|
-
outside: outside,
|
|
102
|
-
disabled: DatePicker_css_disabled,
|
|
103
|
-
selected: selected
|
|
104
|
-
},
|
|
105
|
-
components: {
|
|
106
|
-
Chevron: ({ orientation })=>'left' === orientation ? /*#__PURE__*/ jsx(ChevronLeftIcon, {}) : /*#__PURE__*/ jsx(ChevronRightIcon, {})
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
})
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
DatePicker.displayName = 'DatePicker';
|
|
115
|
-
const date_picker_DatePicker = DatePicker;
|
|
116
|
-
const date_picker = date_picker_DatePicker;
|
|
117
|
-
export default date_picker;
|
|
118
|
-
export { date_picker as DatePicker };
|
|
1
|
+
export { DatePicker, DatePickerContent, DatePickerIcon, DatePickerTrigger, DatePickerValue } from "./2692.js";
|
package/dist/esm/dropzone.js
CHANGED
|
@@ -1,137 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { PaperclipIcon, UploadIcon, XIcon } from "@vinyasa/icons";
|
|
4
|
-
import { useId, useState } from "react";
|
|
5
|
-
import { useDropzone } from "react-dropzone";
|
|
6
|
-
import { field, describedByIds } from "./4557.js";
|
|
7
|
-
import { fileName, rejectionText, fileRemove, fileSize, fileNameIcon, fileList, fileRow, fileNameText, fileMeta, fileListWrapper } from "./2942.js";
|
|
8
|
-
var Dropzone_css_area = 'rnivxt0';
|
|
9
|
-
var areaActive = 'rnivxt1';
|
|
10
|
-
var hint = 'rnivxt3';
|
|
11
|
-
var icon = 'rnivxt2';
|
|
12
|
-
const formatFileSize = (bytes)=>{
|
|
13
|
-
if (bytes < 1024) return `${String(bytes)} B`;
|
|
14
|
-
if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
15
|
-
return `${(bytes / 1048576).toFixed(1)} MB`;
|
|
16
|
-
};
|
|
17
|
-
const Dropzone = ({ value, onValueChange, accept, maxFiles, maxSize, label, description, error, required, disabled, id: idProp })=>{
|
|
18
|
-
const [internalFiles, setInternalFiles] = useState([]);
|
|
19
|
-
const isControlled = void 0 !== value;
|
|
20
|
-
const currentFiles = isControlled ? value : internalFiles;
|
|
21
|
-
const [rejectionMessage, setRejectionMessage] = useState();
|
|
22
|
-
const generatedId = useId();
|
|
23
|
-
const id = idProp ?? generatedId;
|
|
24
|
-
const setFiles = (next)=>{
|
|
25
|
-
if (!isControlled) setInternalFiles(next);
|
|
26
|
-
onValueChange?.(next);
|
|
27
|
-
};
|
|
28
|
-
const removeFile = (file)=>{
|
|
29
|
-
setFiles(currentFiles.filter((entry)=>entry !== file));
|
|
30
|
-
};
|
|
31
|
-
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
32
|
-
accept,
|
|
33
|
-
maxFiles,
|
|
34
|
-
maxSize,
|
|
35
|
-
disabled,
|
|
36
|
-
onDrop: (acceptedFiles, fileRejections)=>{
|
|
37
|
-
fileRejections.length > 0 ? setRejectionMessage(fileRejections[0]?.errors[0]?.message) : setRejectionMessage(void 0);
|
|
38
|
-
if (acceptedFiles.length > 0) setFiles([
|
|
39
|
-
...currentFiles,
|
|
40
|
-
...acceptedFiles
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return /*#__PURE__*/ jsxs(field, {
|
|
45
|
-
id: id,
|
|
46
|
-
label: label,
|
|
47
|
-
description: description,
|
|
48
|
-
error: error,
|
|
49
|
-
required: required,
|
|
50
|
-
children: [
|
|
51
|
-
/*#__PURE__*/ jsxs("div", {
|
|
52
|
-
...getRootProps({
|
|
53
|
-
id,
|
|
54
|
-
'data-disabled': disabled
|
|
55
|
-
}),
|
|
56
|
-
className: isDragActive ? `${Dropzone_css_area} ${areaActive}` : Dropzone_css_area,
|
|
57
|
-
"aria-describedby": describedByIds(id, {
|
|
58
|
-
description,
|
|
59
|
-
error
|
|
60
|
-
}),
|
|
61
|
-
children: [
|
|
62
|
-
/*#__PURE__*/ jsx("input", {
|
|
63
|
-
...getInputProps()
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ jsx("span", {
|
|
66
|
-
className: icon,
|
|
67
|
-
"aria-hidden": "true",
|
|
68
|
-
children: /*#__PURE__*/ jsx(UploadIcon, {})
|
|
69
|
-
}),
|
|
70
|
-
/*#__PURE__*/ jsx("span", {
|
|
71
|
-
children: isDragActive ? 'Drop the files here…' : 'Drag files here, or click to browse'
|
|
72
|
-
}),
|
|
73
|
-
maxSize ? /*#__PURE__*/ jsxs("span", {
|
|
74
|
-
className: hint,
|
|
75
|
-
children: [
|
|
76
|
-
"Up to ",
|
|
77
|
-
formatFileSize(maxSize),
|
|
78
|
-
" per file"
|
|
79
|
-
]
|
|
80
|
-
}) : null
|
|
81
|
-
]
|
|
82
|
-
}),
|
|
83
|
-
rejectionMessage ? /*#__PURE__*/ jsx("p", {
|
|
84
|
-
className: rejectionText,
|
|
85
|
-
children: rejectionMessage
|
|
86
|
-
}) : null,
|
|
87
|
-
currentFiles.length > 0 ? /*#__PURE__*/ jsx("div", {
|
|
88
|
-
className: fileListWrapper,
|
|
89
|
-
children: /*#__PURE__*/ jsx("ul", {
|
|
90
|
-
className: fileList,
|
|
91
|
-
children: currentFiles.map((file)=>/*#__PURE__*/ jsxs("li", {
|
|
92
|
-
className: fileRow,
|
|
93
|
-
children: [
|
|
94
|
-
/*#__PURE__*/ jsxs("span", {
|
|
95
|
-
className: fileName,
|
|
96
|
-
children: [
|
|
97
|
-
/*#__PURE__*/ jsx(PaperclipIcon, {
|
|
98
|
-
"aria-hidden": "true",
|
|
99
|
-
className: fileNameIcon
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsx("span", {
|
|
102
|
-
className: fileNameText,
|
|
103
|
-
title: file.name,
|
|
104
|
-
children: file.name
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
}),
|
|
108
|
-
/*#__PURE__*/ jsxs("span", {
|
|
109
|
-
className: fileMeta,
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ jsx("span", {
|
|
112
|
-
className: fileSize,
|
|
113
|
-
children: formatFileSize(file.size)
|
|
114
|
-
}),
|
|
115
|
-
/*#__PURE__*/ jsx("button", {
|
|
116
|
-
type: "button",
|
|
117
|
-
className: fileRemove,
|
|
118
|
-
"aria-label": `Remove ${file.name}`,
|
|
119
|
-
onClick: ()=>{
|
|
120
|
-
removeFile(file);
|
|
121
|
-
},
|
|
122
|
-
children: /*#__PURE__*/ jsx(XIcon, {})
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
}, `${file.name}-${String(file.lastModified)}`))
|
|
128
|
-
})
|
|
129
|
-
}) : null
|
|
130
|
-
]
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
Dropzone.displayName = 'Dropzone';
|
|
134
|
-
const dropzone_Dropzone = Dropzone;
|
|
135
|
-
const dropzone = dropzone_Dropzone;
|
|
136
|
-
export default dropzone;
|
|
137
|
-
export { dropzone as Dropzone };
|
|
1
|
+
export { Dropzone, DropzoneFileItem, DropzoneFileList, DropzoneRejection, DropzoneTrigger, formatFileSize, useDropzoneContext } from "./9559.js";
|
package/dist/esm/field.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
id: string;
|
|
4
|
-
label?: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
6
|
-
error?: ReactNode;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Omits `htmlFor` on the label — for a control whose real interactive
|
|
11
|
-
* element doesn't actually carry `id` (e.g. Combobox/Autocomplete, where
|
|
12
|
-
* cmdk's Command.Input always overwrites `id` with its own internally
|
|
13
|
-
* generated one). A `htmlFor` pointing at a nonexistent id wouldn't just
|
|
14
|
-
* be inert — clicking that label would silently fail to focus anything,
|
|
15
|
-
* for real users too, not only in tests.
|
|
16
|
-
*/
|
|
17
|
-
disableLabelFor?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const describedByIds: (id: string, { description, error }: {
|
|
20
|
-
description?: ReactNode;
|
|
21
|
-
error?: ReactNode;
|
|
22
|
-
}) => string | undefined;
|
|
23
|
-
declare const FieldChrome: ({ id, label, description, error, required, children, disableLabelFor, }: FieldChromeProps) => import("react").JSX.Element;
|
|
24
|
-
export default FieldChrome;
|
|
1
|
+
export * from './components/field/index';
|
|
2
|
+
export { default } from './components/field/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel, useFieldContext, useResolvedFieldProps } from "./2315.js";
|