@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.
Files changed (140) hide show
  1. package/dist/cjs/autocomplete.cjs +709 -309
  2. package/dist/cjs/autocomplete.css +1 -1
  3. package/dist/cjs/checkbox.cjs +399 -244
  4. package/dist/cjs/checkbox.css +5 -1
  5. package/dist/cjs/color-picker.cjs +478 -325
  6. package/dist/cjs/color-picker.css +1 -1
  7. package/dist/cjs/combobox.cjs +574 -359
  8. package/dist/cjs/combobox.css +1 -1
  9. package/dist/cjs/date-picker.cjs +522 -322
  10. package/dist/cjs/date-picker.css +1 -1
  11. package/dist/cjs/dropzone.cjs +562 -391
  12. package/dist/cjs/dropzone.css +1 -1
  13. package/dist/cjs/field.cjs +353 -0
  14. package/dist/cjs/field.css +139 -0
  15. package/dist/cjs/file-upload.cjs +667 -380
  16. package/dist/cjs/file-upload.css +44 -1
  17. package/dist/cjs/index.cjs +3066 -2546
  18. package/dist/cjs/index.css +9 -1
  19. package/dist/cjs/input.cjs +220 -74
  20. package/dist/cjs/input.css +1 -1
  21. package/dist/cjs/multi-select.cjs +756 -400
  22. package/dist/cjs/multi-select.css +1 -1
  23. package/dist/cjs/number-input.cjs +267 -125
  24. package/dist/cjs/number-input.css +1 -1
  25. package/dist/cjs/otp-input.cjs +232 -85
  26. package/dist/cjs/otp-input.css +1 -1
  27. package/dist/cjs/password-input.cjs +239 -93
  28. package/dist/cjs/password-input.css +1 -1
  29. package/dist/cjs/radio-group.cjs +388 -246
  30. package/dist/cjs/radio-group.css +1 -1
  31. package/dist/cjs/range-slider.cjs +106 -62
  32. package/dist/cjs/rich-text-editor.cjs +549 -517
  33. package/dist/cjs/rich-text-editor.css +1 -1
  34. package/dist/cjs/search-input.cjs +244 -98
  35. package/dist/cjs/search-input.css +1 -1
  36. package/dist/cjs/select.cjs +485 -353
  37. package/dist/cjs/select.css +1 -1
  38. package/dist/cjs/slider.cjs +129 -155
  39. package/dist/cjs/switch.cjs +376 -239
  40. package/dist/cjs/switch.css +5 -1
  41. package/dist/cjs/tags-input.cjs +264 -113
  42. package/dist/cjs/tags-input.css +1 -1
  43. package/dist/cjs/textarea.cjs +225 -79
  44. package/dist/cjs/textarea.css +1 -1
  45. package/dist/cjs/time-picker.cjs +546 -371
  46. package/dist/cjs/time-picker.css +1 -1
  47. package/dist/cjs/toggle-button.cjs +18 -15
  48. package/dist/esm/{switch.css → 1485.css} +4 -0
  49. package/dist/esm/1485.js +28 -0
  50. package/dist/esm/{2995.css → 2315.css} +1 -1
  51. package/dist/esm/{2995.js → 2315.js} +96 -4
  52. package/dist/esm/2692.js +114 -0
  53. package/dist/esm/27.js +23 -27
  54. package/dist/esm/345.js +81 -0
  55. package/dist/esm/5074.js +66 -0
  56. package/dist/esm/5333.js +72 -0
  57. package/dist/esm/6982.js +35 -0
  58. package/dist/esm/7580.js +34 -0
  59. package/dist/esm/7678.js +101 -0
  60. package/dist/esm/7800.js +131 -0
  61. package/dist/esm/8479.js +115 -0
  62. package/dist/esm/{checkbox.css → 9167.css} +4 -0
  63. package/dist/esm/9167.js +30 -0
  64. package/dist/esm/9545.js +118 -0
  65. package/dist/esm/{2942.css → 9559.css} +43 -0
  66. package/dist/esm/9559.js +179 -0
  67. package/dist/esm/autocomplete.js +2 -95
  68. package/dist/esm/checkbox.js +1 -38
  69. package/dist/esm/color-picker.js +1 -130
  70. package/dist/esm/combobox.js +1 -126
  71. package/dist/esm/components/autocomplete/Autocomplete.d.ts +26 -16
  72. package/dist/esm/components/autocomplete/index.d.ts +1 -3
  73. package/dist/esm/components/checkbox/Checkbox.d.ts +12 -4
  74. package/dist/esm/components/checkbox/index.d.ts +1 -3
  75. package/dist/esm/components/color-picker/ColorPicker.d.ts +28 -21
  76. package/dist/esm/components/color-picker/index.d.ts +1 -3
  77. package/dist/esm/components/combobox/Combobox.d.ts +55 -29
  78. package/dist/esm/components/combobox/index.d.ts +1 -3
  79. package/dist/esm/components/date-picker/DatePicker.d.ts +28 -24
  80. package/dist/esm/components/date-picker/index.d.ts +1 -3
  81. package/dist/esm/components/dropzone/Dropzone.d.ts +52 -9
  82. package/dist/esm/components/dropzone/index.d.ts +1 -3
  83. package/dist/esm/components/field/Field.d.ts +106 -0
  84. package/dist/esm/components/field/index.d.ts +1 -0
  85. package/dist/esm/components/file-upload/FileUpload.d.ts +11 -18
  86. package/dist/esm/components/file-upload/index.d.ts +1 -3
  87. package/dist/esm/components/icon-button/IconButton.d.ts +1 -1
  88. package/dist/esm/components/input/Input.d.ts +3 -5
  89. package/dist/esm/components/multi-select/MultiSelect.d.ts +37 -30
  90. package/dist/esm/components/multi-select/index.d.ts +1 -3
  91. package/dist/esm/components/number-input/NumberInput.d.ts +3 -5
  92. package/dist/esm/components/otp-input/OtpInput.d.ts +2 -4
  93. package/dist/esm/components/password-input/PasswordInput.d.ts +3 -5
  94. package/dist/esm/components/radio-group/RadioGroup.d.ts +18 -10
  95. package/dist/esm/components/radio-group/index.d.ts +1 -3
  96. package/dist/esm/components/range-slider/RangeSlider.d.ts +1 -1
  97. package/dist/esm/components/rich-text-editor/RichTextEditor.d.ts +44 -7
  98. package/dist/esm/components/rich-text-editor/index.d.ts +1 -3
  99. package/dist/esm/components/search-input/SearchInput.d.ts +3 -5
  100. package/dist/esm/components/select/Select.d.ts +36 -23
  101. package/dist/esm/components/select/index.d.ts +1 -3
  102. package/dist/esm/components/slider/Slider.d.ts +17 -10
  103. package/dist/esm/components/slider/index.d.ts +1 -3
  104. package/dist/esm/components/switch/Switch.d.ts +10 -5
  105. package/dist/esm/components/switch/index.d.ts +1 -3
  106. package/dist/esm/components/tags-input/TagsInput.d.ts +3 -5
  107. package/dist/esm/components/textarea/Textarea.d.ts +3 -5
  108. package/dist/esm/components/time-picker/TimePicker.d.ts +31 -23
  109. package/dist/esm/components/time-picker/index.d.ts +1 -3
  110. package/dist/esm/date-picker.js +1 -118
  111. package/dist/esm/dropzone.js +1 -137
  112. package/dist/esm/field.d.ts +2 -24
  113. package/dist/esm/field.js +1 -0
  114. package/dist/esm/file-upload.js +2 -123
  115. package/dist/esm/index.d.ts +15 -14
  116. package/dist/esm/index.js +15 -14
  117. package/dist/esm/input.js +16 -25
  118. package/dist/esm/multi-select.js +2 -164
  119. package/dist/esm/number-input.js +65 -78
  120. package/dist/esm/otp-input.js +31 -38
  121. package/dist/esm/password-input.js +32 -41
  122. package/dist/esm/radio-group.js +1 -44
  123. package/dist/esm/range-slider.js +15 -8
  124. package/dist/esm/rich-text-editor.js +1 -212
  125. package/dist/esm/search-input.js +35 -44
  126. package/dist/esm/select.js +1 -87
  127. package/dist/esm/slider.js +1 -4
  128. package/dist/esm/switch.js +1 -36
  129. package/dist/esm/tags-input.js +51 -59
  130. package/dist/esm/textarea.js +22 -31
  131. package/dist/esm/time-picker.js +1 -137
  132. package/package.json +18 -9
  133. package/dist/esm/2942.js +0 -13
  134. package/dist/esm/4557.js +0 -39
  135. package/dist/esm/dropzone.css +0 -43
  136. /package/dist/esm/{date-picker.css → 2692.css} +0 -0
  137. /package/dist/esm/{select.css → 5333.css} +0 -0
  138. /package/dist/esm/{radio-group.css → 7580.css} +0 -0
  139. /package/dist/esm/{color-picker.css → 7678.css} +0 -0
  140. /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' | 'label' | 'minStepsBetweenThumbs'> {
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
- label?: ReactNode;
8
- description?: ReactNode;
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, label, description, error, required, disabled, id: idProp, }: RichTextEditorProps): import("react").JSX.Element | null;
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
- import RichTextEditor from './RichTextEditor';
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, type ReactNode } from 'react';
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 interface SelectOption {
4
- value: string;
5
- label: ReactNode;
6
- disabled?: boolean;
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
- * Replaces the built-in trigger button entirely — passed straight through
18
- * to Select.Trigger's `asChild`, so it keeps the same open/close click
19
- * and keyboard wiring. A custom trigger loses `RadixSelect.Value`'s
20
- * automatic selected-item display; import `@radix-ui/react-select`
21
- * directly to compose `Select.Value`/`Select.Icon` inside it if needed.
22
- */
23
- trigger?: ReactNode;
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 Select: {
26
- ({ options, placeholder: placeholderText, label, description, error, required, size, trigger, ...rest }: SelectProps): import("react").JSX.Element;
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
- import Select from './Select';
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 interface SliderProps extends Omit<RadixSlider.SliderProps, 'defaultValue'> {
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 & import("react").RefAttributes<HTMLSpanElement>>;
12
- export default Slider;
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,3 +1 @@
1
- import Slider from './Slider';
2
- export default Slider;
3
- export type { SliderProps } from './Slider';
1
+ export { Slider, SliderRange, SliderThumb, SliderTrack, type SliderProps, type SliderRangeProps, type SliderThumbProps, type SliderTrackProps, } from './Slider';
@@ -1,7 +1,12 @@
1
1
  import * as RadixSwitch from '@radix-ui/react-switch';
2
- import { type ReactNode } from 'react';
3
- export interface SwitchProps extends RadixSwitch.SwitchProps {
4
- label?: ReactNode;
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 default Switch;
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,3 +1 @@
1
- import Switch from './Switch';
2
- export default Switch;
3
- export type { SwitchProps } from './Switch';
1
+ export { Switch, SwitchThumb, type SwitchProps, type SwitchThumbProps } from './Switch';
@@ -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
- label?: ReactNode;
8
- description?: ReactNode;
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, type ReactNode } from 'react';
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 { type ReactNode } from 'react';
2
- export interface TimePickerProps {
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
- placeholder?: string;
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 TimePicker: {
29
- ({ value, defaultValue, onValueChange, placeholder, timeFormat, stepMinutes, label, description, error, required, size, disabled, trigger, id: idProp, }: TimePickerProps): import("react").JSX.Element;
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
- import TimePicker from './TimePicker';
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';
@@ -1,118 +1 @@
1
- import "./date-picker.css";
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";
@@ -1,137 +1 @@
1
- import "./dropzone.css";
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";
@@ -1,24 +1,2 @@
1
- import type { ReactNode } from 'react';
2
- export interface FieldChromeProps {
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";