@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
@@ -0,0 +1,179 @@
1
+ import "./9559.css";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { PaperclipIcon, UploadIcon, XIcon } from "@vinyasa/icons";
4
+ import { createContext, useContext, useState } from "react";
5
+ import { useDropzone } from "react-dropzone";
6
+ import { useFieldContext, useResolvedFieldProps } from "./2315.js";
7
+ var fileList = '_3ltn2y2';
8
+ var fileListWrapper = '_3ltn2y1';
9
+ var fileMeta = '_3ltn2y7';
10
+ var fileName = '_3ltn2y4';
11
+ var fileNameIcon = '_3ltn2y5';
12
+ var fileNameText = '_3ltn2y6';
13
+ var fileRemove = '_3ltn2y9';
14
+ var fileRow = '_3ltn2y3';
15
+ var fileSize = '_3ltn2y8';
16
+ var rejectionText = '_3ltn2ya';
17
+ var trigger = '_3ltn2y0';
18
+ var Dropzone_css_area = 'rnivxt0';
19
+ var areaActive = 'rnivxt1';
20
+ var hint = 'rnivxt3';
21
+ var icon = 'rnivxt2';
22
+ const formatFileSize = (bytes)=>{
23
+ if (bytes < 1024) return `${String(bytes)} B`;
24
+ if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`;
25
+ return `${(bytes / 1048576).toFixed(1)} MB`;
26
+ };
27
+ const DropzoneContext = /*#__PURE__*/ createContext(null);
28
+ const useDropzoneContext = ()=>useContext(DropzoneContext);
29
+ const Dropzone = ({ value, onValueChange, accept, maxFiles, maxSize, invalid, disabled, id: idProp, children })=>{
30
+ const [internalFiles, setInternalFiles] = useState([]);
31
+ const isControlled = void 0 !== value;
32
+ const currentFiles = isControlled ? value : internalFiles;
33
+ const [rejectionMessage, setRejectionMessage] = useState();
34
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
35
+ id: idProp,
36
+ invalid
37
+ });
38
+ const labelId = useFieldContext()?.labelId;
39
+ const setFiles = (next)=>{
40
+ if (!isControlled) setInternalFiles(next);
41
+ onValueChange?.(next);
42
+ };
43
+ const removeFile = (file)=>{
44
+ setFiles(currentFiles.filter((entry)=>entry !== file));
45
+ };
46
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
47
+ accept,
48
+ maxFiles,
49
+ maxSize,
50
+ disabled,
51
+ onDrop: (acceptedFiles, fileRejections)=>{
52
+ fileRejections.length > 0 ? setRejectionMessage(fileRejections[0]?.errors[0]?.message) : setRejectionMessage(void 0);
53
+ if (acceptedFiles.length > 0) setFiles([
54
+ ...currentFiles,
55
+ ...acceptedFiles
56
+ ]);
57
+ }
58
+ });
59
+ return /*#__PURE__*/ jsx(DropzoneContext.Provider, {
60
+ value: {
61
+ getRootProps,
62
+ getInputProps,
63
+ isDragActive,
64
+ files: currentFiles,
65
+ removeFile,
66
+ rejectionMessage,
67
+ maxSize,
68
+ id,
69
+ invalid: isInvalid,
70
+ describedBy,
71
+ labelId,
72
+ disabled
73
+ },
74
+ children: children
75
+ });
76
+ };
77
+ Dropzone.displayName = 'Dropzone';
78
+ const DropzoneTrigger = ({ className, ...rest })=>{
79
+ const { getRootProps, getInputProps, isDragActive = false, id, disabled, invalid, describedBy, labelId, maxSize } = useContext(DropzoneContext) ?? {};
80
+ const base = isDragActive ? `${Dropzone_css_area} ${areaActive}` : Dropzone_css_area;
81
+ const promptText = isDragActive ? 'Drop the files here…' : 'Drag files here, or click to browse';
82
+ return /*#__PURE__*/ jsxs("div", {
83
+ ...getRootProps?.({
84
+ id,
85
+ 'data-disabled': disabled
86
+ }),
87
+ "aria-labelledby": labelId,
88
+ "aria-invalid": invalid,
89
+ "aria-describedby": describedBy,
90
+ className: className ? `${base} ${className}` : base,
91
+ ...rest,
92
+ children: [
93
+ /*#__PURE__*/ jsx("input", {
94
+ ...getInputProps?.()
95
+ }),
96
+ /*#__PURE__*/ jsx("span", {
97
+ className: icon,
98
+ "aria-hidden": "true",
99
+ children: /*#__PURE__*/ jsx(UploadIcon, {})
100
+ }),
101
+ /*#__PURE__*/ jsx("span", {
102
+ children: promptText
103
+ }),
104
+ maxSize ? /*#__PURE__*/ jsxs("span", {
105
+ className: hint,
106
+ children: [
107
+ "Up to ",
108
+ formatFileSize(maxSize),
109
+ " per file"
110
+ ]
111
+ }) : null
112
+ ]
113
+ });
114
+ };
115
+ DropzoneTrigger.displayName = 'DropzoneTrigger';
116
+ const DropzoneRejection = ()=>{
117
+ const context = useContext(DropzoneContext);
118
+ if (!context?.rejectionMessage) return null;
119
+ return /*#__PURE__*/ jsx("p", {
120
+ className: rejectionText,
121
+ children: context.rejectionMessage
122
+ });
123
+ };
124
+ DropzoneRejection.displayName = 'DropzoneRejection';
125
+ const DropzoneFileItem = ({ file, onRemove })=>{
126
+ const context = useContext(DropzoneContext);
127
+ const handleRemove = onRemove ?? (()=>context?.removeFile(file));
128
+ return /*#__PURE__*/ jsxs("li", {
129
+ className: fileRow,
130
+ children: [
131
+ /*#__PURE__*/ jsxs("span", {
132
+ className: fileName,
133
+ children: [
134
+ /*#__PURE__*/ jsx(PaperclipIcon, {
135
+ "aria-hidden": "true",
136
+ className: fileNameIcon
137
+ }),
138
+ /*#__PURE__*/ jsx("span", {
139
+ className: fileNameText,
140
+ title: file.name,
141
+ children: file.name
142
+ })
143
+ ]
144
+ }),
145
+ /*#__PURE__*/ jsxs("span", {
146
+ className: fileMeta,
147
+ children: [
148
+ /*#__PURE__*/ jsx("span", {
149
+ className: fileSize,
150
+ children: formatFileSize(file.size)
151
+ }),
152
+ /*#__PURE__*/ jsx("button", {
153
+ type: "button",
154
+ className: fileRemove,
155
+ "aria-label": `Remove ${file.name}`,
156
+ onClick: handleRemove,
157
+ children: /*#__PURE__*/ jsx(XIcon, {})
158
+ })
159
+ ]
160
+ })
161
+ ]
162
+ });
163
+ };
164
+ DropzoneFileItem.displayName = 'DropzoneFileItem';
165
+ const DropzoneFileList = ()=>{
166
+ const context = useContext(DropzoneContext);
167
+ if (!context || 0 === context.files.length) return null;
168
+ return /*#__PURE__*/ jsx("div", {
169
+ className: fileListWrapper,
170
+ children: /*#__PURE__*/ jsx("ul", {
171
+ className: fileList,
172
+ children: context.files.map((file)=>/*#__PURE__*/ jsx(DropzoneFileItem, {
173
+ file: file
174
+ }, `${file.name}-${String(file.lastModified)}`))
175
+ })
176
+ });
177
+ };
178
+ DropzoneFileList.displayName = 'DropzoneFileList';
179
+ export { Dropzone, DropzoneFileItem, DropzoneFileList, DropzoneRejection, DropzoneTrigger, formatFileSize, trigger, useDropzoneContext };
@@ -1,95 +1,2 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Command } from "cmdk";
3
- import { useId, useState } from "react";
4
- import { field, describedByIds } from "./4557.js";
5
- import { fieldControl } from "./2995.js";
6
- import { empty, list, content, item } from "./6720.js";
7
- import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
8
- const Autocomplete = ({ suggestions, value, defaultValue = '', onValueChange, placeholder, label, description, error, required, size, emptyMessage = 'No suggestions.', id: idProp })=>{
9
- const [internalValue, setInternalValue] = useState(defaultValue);
10
- const isControlled = void 0 !== value;
11
- const currentValue = isControlled ? value : internalValue;
12
- const [open, setOpen] = useState(false);
13
- const generatedId = useId();
14
- const id = idProp ?? generatedId;
15
- const setValue = (next)=>{
16
- if (!isControlled) setInternalValue(next);
17
- onValueChange?.(next);
18
- };
19
- return /*#__PURE__*/ jsx(field, {
20
- id: id,
21
- label: label,
22
- description: description,
23
- error: error,
24
- required: required,
25
- disableLabelFor: true,
26
- children: /*#__PURE__*/ jsx(Command, {
27
- loop: true,
28
- shouldFilter: true,
29
- label: 'string' == typeof label ? label : void 0,
30
- children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
31
- open: open,
32
- onOpenChange: setOpen,
33
- children: [
34
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
35
- asChild: true,
36
- children: /*#__PURE__*/ jsx(Command.Input, {
37
- id: id,
38
- value: currentValue,
39
- onClick: (event)=>{
40
- event.preventDefault();
41
- },
42
- onValueChange: (next)=>{
43
- setValue(next);
44
- setOpen(true);
45
- },
46
- onFocus: ()=>{
47
- setOpen(true);
48
- },
49
- placeholder: placeholder,
50
- className: fieldControl({
51
- size,
52
- invalid: Boolean(error)
53
- }),
54
- "aria-describedby": describedByIds(id, {
55
- description,
56
- error
57
- })
58
- })
59
- }),
60
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
61
- className: content,
62
- align: "start",
63
- sideOffset: 4,
64
- onOpenAutoFocus: (event)=>{
65
- event.preventDefault();
66
- },
67
- children: /*#__PURE__*/ jsxs(Command.List, {
68
- className: list,
69
- children: [
70
- /*#__PURE__*/ jsx(Command.Empty, {
71
- className: empty,
72
- children: emptyMessage
73
- }),
74
- suggestions.map((suggestion)=>/*#__PURE__*/ jsx(Command.Item, {
75
- value: suggestion,
76
- onSelect: ()=>{
77
- setValue(suggestion);
78
- setOpen(false);
79
- },
80
- className: item,
81
- children: suggestion
82
- }, suggestion))
83
- ]
84
- })
85
- })
86
- ]
87
- })
88
- })
89
- });
90
- };
91
- Autocomplete.displayName = 'Autocomplete';
92
- const autocomplete_Autocomplete = Autocomplete;
93
- const autocomplete = autocomplete_Autocomplete;
94
- export default autocomplete;
95
- export { autocomplete as Autocomplete };
1
+ export { Autocomplete, AutocompleteContent, AutocompleteInput, AutocompleteItem } from "./345.js";
2
+ export { AutocompleteEmpty, AutocompleteList } from "./8479.js";
@@ -1,38 +1 @@
1
- import "./checkbox.css";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { CheckIcon } from "@vinyasa/icons";
4
- import { forwardRef, useId } from "react";
5
- import { controlRow, controlLabel } from "./2995.js";
6
- import * as __rspack_external__radix_ui_react_checkbox_76684228 from "@radix-ui/react-checkbox";
7
- var indicator = '_7ele601';
8
- var root = '_7ele600';
9
- const Checkbox = /*#__PURE__*/ forwardRef(({ label, id: idProp, className, ...rest }, ref)=>{
10
- const generatedId = useId();
11
- const id = idProp ?? generatedId;
12
- const classes = className ? `${root} ${className}` : root;
13
- return /*#__PURE__*/ jsxs("div", {
14
- className: controlRow,
15
- children: [
16
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_checkbox_76684228.Root, {
17
- ref: ref,
18
- id: id,
19
- className: classes,
20
- ...rest,
21
- children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_checkbox_76684228.Indicator, {
22
- className: indicator,
23
- children: /*#__PURE__*/ jsx(CheckIcon, {})
24
- })
25
- }),
26
- label ? /*#__PURE__*/ jsx("label", {
27
- htmlFor: id,
28
- className: controlLabel,
29
- children: label
30
- }) : null
31
- ]
32
- });
33
- });
34
- Checkbox.displayName = 'Checkbox';
35
- const checkbox_Checkbox = Checkbox;
36
- const components_checkbox = checkbox_Checkbox;
37
- export default components_checkbox;
38
- export { components_checkbox as Checkbox };
1
+ export { Checkbox, CheckboxIndicator } from "./9167.js";
@@ -1,130 +1 @@
1
- import "./color-picker.css";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useId, useState } from "react";
4
- import { HexColorInput, HexColorPicker } from "react-colorful";
5
- import { field, describedByIds } from "./4557.js";
6
- import { fieldControl } from "./2995.js";
7
- import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
8
- var content = '_1o9um0f3';
9
- var hexInput = '_1o9um0f7';
10
- var hexRow = '_1o9um0f6';
11
- var pickerCard = '_1o9um0f4';
12
- var pickerWrapper = '_1o9um0f5';
13
- var presetSwatch = '_1o9um0fa';
14
- var presetsLabel = '_1o9um0f8';
15
- var presetsRow = '_1o9um0f9';
16
- var swatch = '_1o9um0f2';
17
- var ColorPicker_css_trigger = '_1o9um0f0';
18
- var triggerText = '_1o9um0f1';
19
- const ColorPicker = ({ value, defaultValue = '#4f46e5', onValueChange, label, description, error, required, size, disabled, presets, trigger, id: idProp })=>{
20
- const [internalValue, setInternalValue] = useState(defaultValue);
21
- const isControlled = void 0 !== value;
22
- const currentValue = isControlled ? value : internalValue;
23
- const [open, setOpen] = useState(false);
24
- const generatedId = useId();
25
- const id = idProp ?? generatedId;
26
- const setValue = (next)=>{
27
- if (!isControlled) setInternalValue(next);
28
- onValueChange?.(next);
29
- };
30
- return /*#__PURE__*/ jsx(field, {
31
- id: id,
32
- label: label,
33
- description: description,
34
- error: error,
35
- required: required,
36
- children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
37
- open: open,
38
- onOpenChange: setOpen,
39
- children: [
40
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
41
- asChild: true,
42
- children: trigger ?? /*#__PURE__*/ jsxs("button", {
43
- type: "button",
44
- id: id,
45
- disabled: disabled,
46
- className: `${fieldControl({
47
- size,
48
- invalid: Boolean(error)
49
- })} ${ColorPicker_css_trigger}`,
50
- "aria-describedby": describedByIds(id, {
51
- description,
52
- error
53
- }),
54
- children: [
55
- /*#__PURE__*/ jsx("span", {
56
- className: swatch,
57
- style: {
58
- backgroundColor: currentValue
59
- },
60
- "aria-hidden": "true"
61
- }),
62
- /*#__PURE__*/ jsx("span", {
63
- className: triggerText,
64
- children: currentValue.toUpperCase()
65
- })
66
- ]
67
- })
68
- }),
69
- /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
70
- className: content,
71
- align: "start",
72
- sideOffset: 4,
73
- onOpenAutoFocus: (event)=>{
74
- event.preventDefault();
75
- },
76
- children: [
77
- /*#__PURE__*/ jsxs("div", {
78
- className: pickerCard,
79
- children: [
80
- /*#__PURE__*/ jsx("div", {
81
- className: pickerWrapper,
82
- children: /*#__PURE__*/ jsx(HexColorPicker, {
83
- color: currentValue,
84
- onChange: setValue
85
- })
86
- }),
87
- /*#__PURE__*/ jsx("div", {
88
- className: hexRow,
89
- children: /*#__PURE__*/ jsx(HexColorInput, {
90
- color: currentValue,
91
- onChange: setValue,
92
- prefixed: true,
93
- className: hexInput
94
- })
95
- })
96
- ]
97
- }),
98
- presets && presets.length > 0 ? /*#__PURE__*/ jsxs("div", {
99
- children: [
100
- /*#__PURE__*/ jsx("p", {
101
- className: presetsLabel,
102
- children: "Presets"
103
- }),
104
- /*#__PURE__*/ jsx("div", {
105
- className: presetsRow,
106
- children: presets.map((preset)=>/*#__PURE__*/ jsx("button", {
107
- type: "button",
108
- className: presetSwatch,
109
- style: {
110
- backgroundColor: preset
111
- },
112
- "aria-label": preset,
113
- onClick: ()=>{
114
- setValue(preset);
115
- }
116
- }, preset))
117
- })
118
- ]
119
- }) : null
120
- ]
121
- })
122
- ]
123
- })
124
- });
125
- };
126
- ColorPicker.displayName = 'ColorPicker';
127
- const color_picker_ColorPicker = ColorPicker;
128
- const color_picker = color_picker_ColorPicker;
129
- export default color_picker;
130
- export { color_picker as ColorPicker };
1
+ export { ColorPicker, ColorPickerContent, ColorPickerSwatch, ColorPickerTrigger, ColorPickerValue } from "./7678.js";
@@ -1,126 +1 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { CheckIcon, ChevronDownIcon, SearchIcon } from "@vinyasa/icons";
3
- import { Command } from "cmdk";
4
- import { useId, useState } from "react";
5
- import { field, describedByIds } from "./4557.js";
6
- import { fieldControl } from "./2995.js";
7
- import { triggerText, empty, triggerIcon, searchIcon, placeholder as selectPopover_css_placeholder, content, searchInput, item, itemIndicator, searchWrapper, trigger as selectPopover_css_trigger, list } from "./6720.js";
8
- import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
9
- const optionText = (option)=>'string' == typeof option.label ? option.label : option.value;
10
- const Combobox = ({ options, value, defaultValue, onValueChange, placeholder = 'Select an option', label, description, error, required, size, disabled, emptyMessage = 'No results found.', trigger, id: idProp })=>{
11
- const [internalValue, setInternalValue] = useState(defaultValue);
12
- const isControlled = void 0 !== value;
13
- const currentValue = isControlled ? value : internalValue;
14
- const selectedOption = options.find((option)=>option.value === currentValue);
15
- const [open, setOpen] = useState(false);
16
- const [search, setSearch] = useState('');
17
- const generatedId = useId();
18
- const id = idProp ?? generatedId;
19
- const handleSelect = (optionValue)=>{
20
- if (!isControlled) setInternalValue(optionValue);
21
- onValueChange?.(optionValue);
22
- setOpen(false);
23
- };
24
- return /*#__PURE__*/ jsx(field, {
25
- id: id,
26
- label: label,
27
- description: description,
28
- error: error,
29
- required: required,
30
- children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
31
- open: open,
32
- onOpenChange: (next)=>{
33
- setOpen(next);
34
- if (!next) setSearch('');
35
- },
36
- children: [
37
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
38
- asChild: true,
39
- children: trigger ?? /*#__PURE__*/ jsxs("button", {
40
- type: "button",
41
- id: id,
42
- disabled: disabled,
43
- className: `${fieldControl({
44
- size,
45
- invalid: Boolean(error)
46
- })} ${selectPopover_css_trigger}`,
47
- "aria-describedby": describedByIds(id, {
48
- description,
49
- error
50
- }),
51
- children: [
52
- /*#__PURE__*/ jsx("span", {
53
- className: selectedOption ? triggerText : `${triggerText} ${selectPopover_css_placeholder}`,
54
- children: selectedOption ? selectedOption.label : placeholder
55
- }),
56
- /*#__PURE__*/ jsx("span", {
57
- className: triggerIcon,
58
- "aria-hidden": "true",
59
- children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
60
- })
61
- ]
62
- })
63
- }),
64
- /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
65
- className: content,
66
- align: "start",
67
- sideOffset: 4,
68
- children: /*#__PURE__*/ jsxs(Command, {
69
- loop: true,
70
- label: 'string' == typeof label ? label : 'Search options',
71
- children: [
72
- /*#__PURE__*/ jsxs("div", {
73
- className: searchWrapper,
74
- children: [
75
- /*#__PURE__*/ jsx("span", {
76
- className: searchIcon,
77
- "aria-hidden": "true",
78
- children: /*#__PURE__*/ jsx(SearchIcon, {})
79
- }),
80
- /*#__PURE__*/ jsx(Command.Input, {
81
- autoFocus: true,
82
- value: search,
83
- onValueChange: setSearch,
84
- placeholder: "Search…",
85
- className: searchInput
86
- })
87
- ]
88
- }),
89
- /*#__PURE__*/ jsxs(Command.List, {
90
- className: list,
91
- children: [
92
- /*#__PURE__*/ jsx(Command.Empty, {
93
- className: empty,
94
- children: emptyMessage
95
- }),
96
- options.map((option)=>/*#__PURE__*/ jsxs(Command.Item, {
97
- value: optionText(option),
98
- disabled: option.disabled,
99
- onSelect: ()=>{
100
- handleSelect(option.value);
101
- },
102
- className: item,
103
- "data-selected": option.value === currentValue,
104
- "data-disabled": option.disabled,
105
- children: [
106
- option.label,
107
- option.value === currentValue ? /*#__PURE__*/ jsx("span", {
108
- className: itemIndicator,
109
- children: /*#__PURE__*/ jsx(CheckIcon, {})
110
- }) : null
111
- ]
112
- }, option.value))
113
- ]
114
- })
115
- ]
116
- })
117
- })
118
- ]
119
- })
120
- });
121
- };
122
- Combobox.displayName = 'Combobox';
123
- const combobox_Combobox = Combobox;
124
- const combobox = combobox_Combobox;
125
- export default combobox;
126
- export { combobox as Combobox };
1
+ export { AutocompleteEmpty as ComboboxEmpty, AutocompleteList as ComboboxList, Combobox, ComboboxContent, ComboboxIcon, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxTrigger, ComboboxValue } from "./8479.js";
@@ -1,21 +1,31 @@
1
- import { type ReactNode } from 'react';
1
+ import * as Popover from '@radix-ui/react-popover';
2
+ import { Command } from 'cmdk';
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
4
+ import { ComboboxEmpty, ComboboxList } from '../combobox/Combobox';
2
5
  export interface AutocompleteProps {
3
- /** Suggestions shown while typing — picking one fills the field with it. */
4
- suggestions: string[];
5
- value?: string;
6
- defaultValue?: string;
7
- onValueChange?: (value: string) => void;
8
- placeholder?: string;
9
- label?: ReactNode;
10
- description?: ReactNode;
11
- error?: ReactNode;
12
- required?: boolean;
6
+ children: ReactNode;
7
+ }
8
+ export declare const Autocomplete: {
9
+ ({ children }: AutocompleteProps): import("react").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export interface AutocompleteInputProps extends Omit<ComponentPropsWithoutRef<typeof Command.Input>, 'size'> {
13
+ /** Marks the input invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
14
+ invalid?: boolean;
13
15
  size?: 'sm' | 'md' | 'lg';
14
- emptyMessage?: ReactNode;
15
- id?: string;
16
16
  }
17
- declare const Autocomplete: {
18
- ({ suggestions, value, defaultValue, onValueChange, placeholder, label, description, error, required, size, emptyMessage, id: idProp, }: AutocompleteProps): import("react").JSX.Element;
17
+ export declare const AutocompleteInput: {
18
+ ({ invalid, size, className, onClick, onFocus, ...rest }: AutocompleteInputProps): import("react").JSX.Element;
19
+ displayName: string;
20
+ };
21
+ export type AutocompleteContentProps = Popover.PopoverContentProps;
22
+ export declare const AutocompleteContent: {
23
+ ({ className, onOpenAutoFocus, onCloseAutoFocus, ...rest }: AutocompleteContentProps): import("react").JSX.Element;
24
+ displayName: string;
25
+ };
26
+ export type AutocompleteItemProps = ComponentPropsWithoutRef<typeof Command.Item>;
27
+ export declare const AutocompleteItem: {
28
+ ({ onSelect, ...rest }: AutocompleteItemProps): import("react").JSX.Element;
19
29
  displayName: string;
20
30
  };
21
- export default Autocomplete;
31
+ export { ComboboxEmpty as AutocompleteEmpty, ComboboxList as AutocompleteList };
@@ -1,3 +1 @@
1
- import Autocomplete from './Autocomplete';
2
- export default Autocomplete;
3
- export type { AutocompleteProps } from './Autocomplete';
1
+ export { Autocomplete, AutocompleteContent, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompleteList, type AutocompleteContentProps, type AutocompleteInputProps, type AutocompleteItemProps, type AutocompleteProps, } from './Autocomplete';
@@ -1,7 +1,15 @@
1
1
  import * as RadixCheckbox from '@radix-ui/react-checkbox';
2
2
  import { type ReactNode } from 'react';
3
- export interface CheckboxProps extends RadixCheckbox.CheckboxProps {
4
- label?: ReactNode;
3
+ export interface CheckboxProps extends Omit<RadixCheckbox.CheckboxProps, 'id'> {
4
+ /** Marks the checkbox invalid — falls back to the enclosing `Field`'s own `invalid` when nested in one. */
5
+ invalid?: boolean;
6
+ id?: string;
5
7
  }
6
- declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
7
- export default Checkbox;
8
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
9
+ export interface CheckboxIndicatorProps extends RadixCheckbox.CheckboxIndicatorProps {
10
+ children?: ReactNode;
11
+ }
12
+ export declare const CheckboxIndicator: {
13
+ ({ className, children, ...rest }: CheckboxIndicatorProps): import("react").JSX.Element;
14
+ displayName: string;
15
+ };
@@ -1,3 +1 @@
1
- import Checkbox from './Checkbox';
2
- export default Checkbox;
3
- export type { CheckboxProps } from './Checkbox';
1
+ export { Checkbox, CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxProps, } from './Checkbox';