@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,35 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { UploadIcon } from "@vinyasa/icons";
3
+ import { useDropzoneContext, trigger, Dropzone } from "./9559.js";
4
+ const FileUpload = Dropzone;
5
+ const FileUploadTrigger = ({ className, children, ...rest })=>{
6
+ const context = useDropzoneContext();
7
+ return /*#__PURE__*/ jsxs("button", {
8
+ type: "button",
9
+ ...context?.getRootProps({
10
+ id: context.id,
11
+ role: 'button',
12
+ 'data-disabled': context.disabled,
13
+ disabled: context.disabled
14
+ }),
15
+ "aria-invalid": context?.invalid,
16
+ "aria-describedby": context?.describedBy,
17
+ className: className ? `${trigger} ${className}` : trigger,
18
+ ...rest,
19
+ children: [
20
+ /*#__PURE__*/ jsx("input", {
21
+ ...context?.getInputProps()
22
+ }),
23
+ children ?? /*#__PURE__*/ jsxs(Fragment, {
24
+ children: [
25
+ /*#__PURE__*/ jsx(UploadIcon, {
26
+ "aria-hidden": "true"
27
+ }),
28
+ "Choose files"
29
+ ]
30
+ })
31
+ ]
32
+ });
33
+ };
34
+ FileUploadTrigger.displayName = 'FileUploadTrigger';
35
+ export { FileUpload, FileUploadTrigger };
@@ -0,0 +1,34 @@
1
+ import "./7580.css";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useFieldContext, useResolvedFieldProps } from "./2315.js";
4
+ import * as __rspack_external__radix_ui_react_radio_group_e8f239af from "@radix-ui/react-radio-group";
5
+ var indicator = 'n31tav2';
6
+ var item = 'n31tav1';
7
+ var root = 'n31tav0';
8
+ const RadioGroup = ({ className, invalid, id: idProp, ...rest })=>{
9
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
10
+ id: idProp,
11
+ invalid
12
+ });
13
+ const labelId = useFieldContext()?.labelId;
14
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_radio_group_e8f239af.Root, {
15
+ id: id,
16
+ "aria-labelledby": labelId,
17
+ "aria-invalid": isInvalid,
18
+ "aria-describedby": describedBy,
19
+ className: className ? `${root} ${className}` : root,
20
+ ...rest
21
+ });
22
+ };
23
+ RadioGroup.displayName = 'RadioGroup';
24
+ const RadioGroupItem = ({ className, ...rest })=>/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_radio_group_e8f239af.Item, {
25
+ className: className ? `${item} ${className}` : item,
26
+ ...rest
27
+ });
28
+ RadioGroupItem.displayName = 'RadioGroupItem';
29
+ const RadioGroupIndicator = ({ className, ...rest })=>/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_radio_group_e8f239af.Indicator, {
30
+ className: className ? `${indicator} ${className}` : indicator,
31
+ ...rest
32
+ });
33
+ RadioGroupIndicator.displayName = 'RadioGroupIndicator';
34
+ export { RadioGroup, RadioGroupIndicator, RadioGroupItem };
@@ -0,0 +1,101 @@
1
+ import "./7678.css";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { HexColorInput, HexColorPicker } from "react-colorful";
4
+ import { fieldControl, useResolvedFieldProps } from "./2315.js";
5
+ import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
6
+ var content = '_1o9um0f3';
7
+ var hexInput = '_1o9um0f7';
8
+ var hexRow = '_1o9um0f6';
9
+ var pickerCard = '_1o9um0f4';
10
+ var pickerWrapper = '_1o9um0f5';
11
+ var presetSwatch = '_1o9um0fa';
12
+ var presetsLabel = '_1o9um0f8';
13
+ var presetsRow = '_1o9um0f9';
14
+ var swatch = '_1o9um0f2';
15
+ var trigger = '_1o9um0f0';
16
+ var triggerText = '_1o9um0f1';
17
+ const ColorPicker = __rspack_external__radix_ui_react_popover_e2827c9f.Root;
18
+ const ColorPickerTrigger = ({ invalid, size, id: idProp, className, ...rest })=>{
19
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
20
+ id: idProp,
21
+ invalid
22
+ });
23
+ const base = `${fieldControl({
24
+ size,
25
+ invalid: isInvalid
26
+ })} ${trigger}`;
27
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
28
+ id: id,
29
+ className: className ? `${base} ${className}` : base,
30
+ "aria-invalid": isInvalid,
31
+ "aria-describedby": describedBy,
32
+ ...rest
33
+ });
34
+ };
35
+ ColorPickerTrigger.displayName = 'ColorPickerTrigger';
36
+ const ColorPickerSwatch = ({ className, ...rest })=>/*#__PURE__*/ jsx("span", {
37
+ className: className ? `${swatch} ${className}` : swatch,
38
+ "aria-hidden": "true",
39
+ ...rest
40
+ });
41
+ ColorPickerSwatch.displayName = 'ColorPickerSwatch';
42
+ const ColorPickerValue = ({ className, ...rest })=>/*#__PURE__*/ jsx("span", {
43
+ className: className ? `${triggerText} ${className}` : triggerText,
44
+ ...rest
45
+ });
46
+ ColorPickerValue.displayName = 'ColorPickerValue';
47
+ const ColorPickerContent = ({ value = '#000000', onValueChange, presets })=>/*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
48
+ className: content,
49
+ align: "start",
50
+ sideOffset: 4,
51
+ onOpenAutoFocus: (event)=>{
52
+ event.preventDefault();
53
+ },
54
+ children: [
55
+ /*#__PURE__*/ jsxs("div", {
56
+ className: pickerCard,
57
+ children: [
58
+ /*#__PURE__*/ jsx("div", {
59
+ className: pickerWrapper,
60
+ children: /*#__PURE__*/ jsx(HexColorPicker, {
61
+ color: value,
62
+ onChange: onValueChange
63
+ })
64
+ }),
65
+ /*#__PURE__*/ jsx("div", {
66
+ className: hexRow,
67
+ children: /*#__PURE__*/ jsx(HexColorInput, {
68
+ color: value,
69
+ onChange: onValueChange,
70
+ prefixed: true,
71
+ className: hexInput
72
+ })
73
+ })
74
+ ]
75
+ }),
76
+ presets && presets.length > 0 ? /*#__PURE__*/ jsxs("div", {
77
+ children: [
78
+ /*#__PURE__*/ jsx("p", {
79
+ className: presetsLabel,
80
+ children: "Presets"
81
+ }),
82
+ /*#__PURE__*/ jsx("div", {
83
+ className: presetsRow,
84
+ children: presets.map((preset)=>/*#__PURE__*/ jsx("button", {
85
+ type: "button",
86
+ className: presetSwatch,
87
+ style: {
88
+ backgroundColor: preset
89
+ },
90
+ "aria-label": preset,
91
+ onClick: ()=>{
92
+ onValueChange?.(preset);
93
+ }
94
+ }, preset))
95
+ })
96
+ ]
97
+ }) : null
98
+ ]
99
+ });
100
+ ColorPickerContent.displayName = 'ColorPickerContent';
101
+ export { ColorPicker, ColorPickerContent, ColorPickerSwatch, ColorPickerTrigger, ColorPickerValue };
@@ -0,0 +1,131 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CheckIcon, ClockIcon, SearchIcon } from "@vinyasa/icons";
3
+ import { Command } from "cmdk";
4
+ import { format, parse } from "date-fns";
5
+ import { createContext, useContext, useMemo, useState } from "react";
6
+ import { fieldControl, useResolvedFieldProps } from "./2315.js";
7
+ import { triggerText, empty, triggerIcon, content, searchIcon, item, searchInput, itemIndicator, searchWrapper, trigger, list } from "./6720.js";
8
+ import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
9
+ const REFERENCE_DATE = new Date(2000, 0, 1);
10
+ const parseTime = (time)=>parse(time, 'HH:mm', REFERENCE_DATE);
11
+ const generateTimeOptions = (stepMinutes)=>{
12
+ const options = [];
13
+ for(let minutes = 0; minutes < 1440; minutes += stepMinutes){
14
+ const hours = Math.floor(minutes / 60);
15
+ const mins = minutes % 60;
16
+ options.push(`${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}`);
17
+ }
18
+ return options;
19
+ };
20
+ const TimePickerOpenContext = /*#__PURE__*/ createContext(null);
21
+ const TimePicker = ({ open, defaultOpen, onOpenChange, children, ...rest })=>{
22
+ const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);
23
+ const isControlled = void 0 !== open;
24
+ const currentOpen = isControlled ? open : internalOpen;
25
+ const handleOpenChange = (next)=>{
26
+ if (!isControlled) setInternalOpen(next);
27
+ onOpenChange?.(next);
28
+ };
29
+ return /*#__PURE__*/ jsx(TimePickerOpenContext.Provider, {
30
+ value: handleOpenChange,
31
+ children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
32
+ open: currentOpen,
33
+ onOpenChange: handleOpenChange,
34
+ ...rest,
35
+ children: children
36
+ })
37
+ });
38
+ };
39
+ TimePicker.displayName = 'TimePicker';
40
+ const TimePickerTrigger = ({ invalid, size, id: idProp, className, ...rest })=>{
41
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
42
+ id: idProp,
43
+ invalid
44
+ });
45
+ const base = `${fieldControl({
46
+ size,
47
+ invalid: isInvalid
48
+ })} ${trigger}`;
49
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
50
+ id: id,
51
+ className: className ? `${base} ${className}` : base,
52
+ "aria-invalid": isInvalid,
53
+ "aria-describedby": describedBy,
54
+ ...rest
55
+ });
56
+ };
57
+ TimePickerTrigger.displayName = 'TimePickerTrigger';
58
+ const TimePickerValue = ({ className, ...rest })=>/*#__PURE__*/ jsx("span", {
59
+ className: className ? `${triggerText} ${className}` : triggerText,
60
+ ...rest
61
+ });
62
+ TimePickerValue.displayName = 'TimePickerValue';
63
+ const TimePickerIcon = ({ className, children, ...rest })=>/*#__PURE__*/ jsx("span", {
64
+ className: className ? `${triggerIcon} ${className}` : triggerIcon,
65
+ "aria-hidden": "true",
66
+ ...rest,
67
+ children: children ?? /*#__PURE__*/ jsx(ClockIcon, {})
68
+ });
69
+ TimePickerIcon.displayName = 'TimePickerIcon';
70
+ const TimePickerContent = ({ value, onValueChange, timeFormat = 'h:mm a', stepMinutes = 30 })=>{
71
+ const [search, setSearch] = useState('');
72
+ const setOpen = useContext(TimePickerOpenContext);
73
+ const options = useMemo(()=>generateTimeOptions(stepMinutes), [
74
+ stepMinutes
75
+ ]);
76
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
77
+ className: content,
78
+ align: "start",
79
+ sideOffset: 4,
80
+ children: /*#__PURE__*/ jsxs(Command, {
81
+ loop: true,
82
+ label: "Search times",
83
+ children: [
84
+ /*#__PURE__*/ jsxs("div", {
85
+ className: searchWrapper,
86
+ children: [
87
+ /*#__PURE__*/ jsx("span", {
88
+ className: searchIcon,
89
+ "aria-hidden": "true",
90
+ children: /*#__PURE__*/ jsx(SearchIcon, {})
91
+ }),
92
+ /*#__PURE__*/ jsx(Command.Input, {
93
+ autoFocus: true,
94
+ value: search,
95
+ onValueChange: setSearch,
96
+ placeholder: "Search…",
97
+ className: searchInput
98
+ })
99
+ ]
100
+ }),
101
+ /*#__PURE__*/ jsxs(Command.List, {
102
+ className: list,
103
+ children: [
104
+ /*#__PURE__*/ jsx(Command.Empty, {
105
+ className: empty,
106
+ children: "No matching times."
107
+ }),
108
+ options.map((time)=>/*#__PURE__*/ jsxs(Command.Item, {
109
+ value: format(parseTime(time), timeFormat),
110
+ onSelect: ()=>{
111
+ onValueChange?.(time);
112
+ setOpen?.(false);
113
+ },
114
+ className: item,
115
+ "data-selected": time === value,
116
+ children: [
117
+ format(parseTime(time), timeFormat),
118
+ time === value ? /*#__PURE__*/ jsx("span", {
119
+ className: itemIndicator,
120
+ children: /*#__PURE__*/ jsx(CheckIcon, {})
121
+ }) : null
122
+ ]
123
+ }, time))
124
+ ]
125
+ })
126
+ ]
127
+ })
128
+ });
129
+ };
130
+ TimePickerContent.displayName = 'TimePickerContent';
131
+ export { TimePicker, TimePickerContent, TimePickerIcon, TimePickerTrigger, TimePickerValue };
@@ -0,0 +1,115 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CheckIcon, ChevronDownIcon, SearchIcon } from "@vinyasa/icons";
3
+ import { Command } from "cmdk";
4
+ import { createContext, useContext, useState } from "react";
5
+ import { fieldControl, useResolvedFieldProps } from "./2315.js";
6
+ import { triggerText, triggerIcon, item, content, searchIcon, empty, searchInput, itemIndicator, searchWrapper, trigger, list } from "./6720.js";
7
+ import * as __rspack_external__radix_ui_react_popover_e2827c9f from "@radix-ui/react-popover";
8
+ const ComboboxOpenContext = /*#__PURE__*/ createContext(null);
9
+ const Combobox = ({ open, defaultOpen, onOpenChange, children, ...rest })=>{
10
+ const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);
11
+ const isControlled = void 0 !== open;
12
+ const currentOpen = isControlled ? open : internalOpen;
13
+ const handleOpenChange = (next)=>{
14
+ if (!isControlled) setInternalOpen(next);
15
+ onOpenChange?.(next);
16
+ };
17
+ return /*#__PURE__*/ jsx(ComboboxOpenContext.Provider, {
18
+ value: handleOpenChange,
19
+ children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Root, {
20
+ open: currentOpen,
21
+ onOpenChange: handleOpenChange,
22
+ ...rest,
23
+ children: children
24
+ })
25
+ });
26
+ };
27
+ Combobox.displayName = 'Combobox';
28
+ const ComboboxTrigger = ({ invalid, size, id: idProp, className, ...rest })=>{
29
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
30
+ id: idProp,
31
+ invalid
32
+ });
33
+ const base = `${fieldControl({
34
+ size,
35
+ invalid: isInvalid
36
+ })} ${trigger}`;
37
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Trigger, {
38
+ id: id,
39
+ className: className ? `${base} ${className}` : base,
40
+ "aria-invalid": isInvalid,
41
+ "aria-describedby": describedBy,
42
+ ...rest
43
+ });
44
+ };
45
+ ComboboxTrigger.displayName = 'ComboboxTrigger';
46
+ const ComboboxValue = ({ className, ...rest })=>/*#__PURE__*/ jsx("span", {
47
+ className: className ? `${triggerText} ${className}` : triggerText,
48
+ ...rest
49
+ });
50
+ ComboboxValue.displayName = 'ComboboxValue';
51
+ const ComboboxIcon = ({ className, children, ...rest })=>/*#__PURE__*/ jsx("span", {
52
+ className: className ? `${triggerIcon} ${className}` : triggerIcon,
53
+ "aria-hidden": "true",
54
+ ...rest,
55
+ children: children ?? /*#__PURE__*/ jsx(ChevronDownIcon, {})
56
+ });
57
+ ComboboxIcon.displayName = 'ComboboxIcon';
58
+ const ComboboxContent = ({ className, children, ...rest })=>/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_e2827c9f.Content, {
59
+ className: className ? `${content} ${className}` : content,
60
+ align: "start",
61
+ sideOffset: 4,
62
+ ...rest,
63
+ children: /*#__PURE__*/ jsx(Command, {
64
+ loop: true,
65
+ label: "Search options",
66
+ children: children
67
+ })
68
+ });
69
+ ComboboxContent.displayName = 'ComboboxContent';
70
+ const ComboboxInput = ({ className, ...rest })=>/*#__PURE__*/ jsxs("div", {
71
+ className: searchWrapper,
72
+ children: [
73
+ /*#__PURE__*/ jsx("span", {
74
+ className: searchIcon,
75
+ "aria-hidden": "true",
76
+ children: /*#__PURE__*/ jsx(SearchIcon, {})
77
+ }),
78
+ /*#__PURE__*/ jsx(Command.Input, {
79
+ autoFocus: true,
80
+ placeholder: "Search…",
81
+ className: className ? `${searchInput} ${className}` : searchInput,
82
+ ...rest
83
+ })
84
+ ]
85
+ });
86
+ ComboboxInput.displayName = 'ComboboxInput';
87
+ const ComboboxList = ({ className, ...rest })=>/*#__PURE__*/ jsx(Command.List, {
88
+ className: className ? `${list} ${className}` : list,
89
+ ...rest
90
+ });
91
+ ComboboxList.displayName = 'ComboboxList';
92
+ const ComboboxItem = ({ className, onSelect, ...rest })=>{
93
+ const setOpen = useContext(ComboboxOpenContext);
94
+ return /*#__PURE__*/ jsx(Command.Item, {
95
+ className: className ? `${item} ${className}` : item,
96
+ onSelect: (value)=>{
97
+ onSelect?.(value);
98
+ setOpen?.(false);
99
+ },
100
+ ...rest
101
+ });
102
+ };
103
+ ComboboxItem.displayName = 'ComboboxItem';
104
+ const ComboboxItemIndicator = ({ className, children, ...rest })=>/*#__PURE__*/ jsx("span", {
105
+ className: className ? `${itemIndicator} ${className}` : itemIndicator,
106
+ ...rest,
107
+ children: children ?? /*#__PURE__*/ jsx(CheckIcon, {})
108
+ });
109
+ ComboboxItemIndicator.displayName = 'ComboboxItemIndicator';
110
+ const ComboboxEmpty = ({ className, ...rest })=>/*#__PURE__*/ jsx(Command.Empty, {
111
+ className: className ? `${empty} ${className}` : empty,
112
+ ...rest
113
+ });
114
+ ComboboxEmpty.displayName = 'ComboboxEmpty';
115
+ export { Combobox, ComboboxContent, ComboboxEmpty as AutocompleteEmpty, ComboboxIcon, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxList as AutocompleteList, ComboboxTrigger, ComboboxValue };
@@ -28,6 +28,10 @@
28
28
  cursor: not-allowed;
29
29
  }
30
30
 
31
+ ._7ele600[aria-invalid="true"] {
32
+ border-color: var(--vinyasa-error);
33
+ }
34
+
31
35
  ._7ele601 {
32
36
  color: var(--vinyasa-on-primary);
33
37
  font-size: .75rem;
@@ -0,0 +1,30 @@
1
+ import "./9167.css";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { CheckIcon } from "@vinyasa/icons";
4
+ import { forwardRef } from "react";
5
+ import { useResolvedFieldProps } from "./2315.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(({ className, invalid, id: idProp, ...rest }, ref)=>{
10
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
11
+ id: idProp,
12
+ invalid
13
+ });
14
+ return /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_checkbox_76684228.Root, {
15
+ ref: ref,
16
+ id: id,
17
+ "aria-invalid": isInvalid,
18
+ "aria-describedby": describedBy,
19
+ className: className ? `${root} ${className}` : root,
20
+ ...rest
21
+ });
22
+ });
23
+ Checkbox.displayName = 'Checkbox';
24
+ const CheckboxIndicator = ({ className, children, ...rest })=>/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_checkbox_76684228.Indicator, {
25
+ className: className ? `${indicator} ${className}` : indicator,
26
+ ...rest,
27
+ children: children ?? /*#__PURE__*/ jsx(CheckIcon, {})
28
+ });
29
+ CheckboxIndicator.displayName = 'CheckboxIndicator';
30
+ export { Checkbox, CheckboxIndicator };
@@ -0,0 +1,118 @@
1
+ import "./9545.css";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { EditorContent, useEditor, useEditorState } from "@tiptap/react";
4
+ import starter_kit from "@tiptap/starter-kit";
5
+ import { createContext, useContext, useEffect } from "react";
6
+ import { useFieldContext, useResolvedFieldProps } from "./2315.js";
7
+ import { toggle_button_ToggleButton } from "./3876.js";
8
+ var content = '_1lw5bep4';
9
+ var divider = '_1lw5bep3';
10
+ var toolbar = '_1lw5bep2';
11
+ var wrapper = '_1lw5bep0';
12
+ var wrapperInvalid = '_1lw5bep1';
13
+ const buildEditorAttributes = (params)=>({
14
+ id: params.id,
15
+ class: content,
16
+ 'aria-invalid': String(params.invalid),
17
+ ...params.describedBy ? {
18
+ 'aria-describedby': params.describedBy
19
+ } : {},
20
+ ...params.labelId ? {
21
+ 'aria-labelledby': params.labelId
22
+ } : {}
23
+ });
24
+ const RichTextEditorContext = /*#__PURE__*/ createContext(null);
25
+ const useRichTextEditorContext = ()=>useContext(RichTextEditorContext)?.editor ?? null;
26
+ const useRichTextEditorActive = (name, attributes)=>{
27
+ const editor = useRichTextEditorContext();
28
+ const isActive = useEditorState({
29
+ editor,
30
+ selector: ({ editor: snapshotEditor })=>snapshotEditor?.isActive(name, attributes) ?? false
31
+ });
32
+ return isActive ?? false;
33
+ };
34
+ const useRichTextEditorDisabled = ()=>{
35
+ const editor = useRichTextEditorContext();
36
+ const disabled = useEditorState({
37
+ editor,
38
+ selector: ({ editor: snapshotEditor })=>!(snapshotEditor?.isEditable ?? true)
39
+ });
40
+ return disabled ?? false;
41
+ };
42
+ const RichTextEditor = ({ value, defaultValue = '', onValueChange, invalid, disabled, id: idProp, children })=>{
43
+ const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
44
+ id: idProp,
45
+ invalid
46
+ });
47
+ const labelId = useFieldContext()?.labelId;
48
+ const editor = useEditor({
49
+ extensions: [
50
+ starter_kit
51
+ ],
52
+ content: value ?? defaultValue,
53
+ editable: !disabled,
54
+ immediatelyRender: false,
55
+ onUpdate: ({ editor: currentEditor })=>{
56
+ onValueChange?.(currentEditor.getHTML());
57
+ },
58
+ editorProps: {
59
+ attributes: buildEditorAttributes({
60
+ id,
61
+ invalid: isInvalid,
62
+ describedBy,
63
+ labelId
64
+ })
65
+ }
66
+ });
67
+ useEffect(()=>{
68
+ if (void 0 === value || !editor || value === editor.getHTML()) return;
69
+ editor.commands.setContent(value, {
70
+ emitUpdate: false
71
+ });
72
+ }, [
73
+ value,
74
+ editor
75
+ ]);
76
+ useEffect(()=>{
77
+ editor?.setEditable(!disabled);
78
+ }, [
79
+ disabled,
80
+ editor
81
+ ]);
82
+ return /*#__PURE__*/ jsx(RichTextEditorContext.Provider, {
83
+ value: {
84
+ editor
85
+ },
86
+ children: /*#__PURE__*/ jsx("div", {
87
+ className: isInvalid ? `${wrapper} ${wrapperInvalid}` : wrapper,
88
+ children: children
89
+ })
90
+ });
91
+ };
92
+ RichTextEditor.displayName = 'RichTextEditor';
93
+ const RichTextEditorToolbar = ({ children })=>/*#__PURE__*/ jsx("div", {
94
+ className: toolbar,
95
+ children: children
96
+ });
97
+ RichTextEditorToolbar.displayName = 'RichTextEditorToolbar';
98
+ const RichTextEditorDivider = ()=>/*#__PURE__*/ jsx("span", {
99
+ className: divider,
100
+ "aria-hidden": "true"
101
+ });
102
+ RichTextEditorDivider.displayName = 'RichTextEditorDivider';
103
+ const RichTextEditorToolbarButton = (props)=>/*#__PURE__*/ jsx(toggle_button_ToggleButton, {
104
+ size: "sm",
105
+ unpressedVariant: "ghost",
106
+ pressedVariant: "secondary",
107
+ ...props
108
+ });
109
+ RichTextEditorToolbarButton.displayName = 'RichTextEditorToolbarButton';
110
+ const RichTextEditorContent = ()=>{
111
+ const editor = useRichTextEditorContext();
112
+ if (!editor) return null;
113
+ return /*#__PURE__*/ jsx(EditorContent, {
114
+ editor: editor
115
+ });
116
+ };
117
+ RichTextEditorContent.displayName = 'RichTextEditorContent';
118
+ export { RichTextEditor, RichTextEditorContent, RichTextEditorDivider, RichTextEditorToolbar, RichTextEditorToolbarButton, useRichTextEditorActive, useRichTextEditorContext, useRichTextEditorDisabled };
@@ -109,3 +109,46 @@
109
109
  margin-top: var(--vinyasa-space1);
110
110
  }
111
111
 
112
+ .rnivxt0 {
113
+ justify-content: center;
114
+ align-items: center;
115
+ gap: var(--vinyasa-space2);
116
+ width: 100%;
117
+ padding: var(--vinyasa-space6);
118
+ border: 2px dashed var(--vinyasa-border-color-default);
119
+ border-radius: var(--vinyasa-radius-md);
120
+ color: var(--vinyasa-text-muted);
121
+ font-family: var(--vinyasa-font-family-sans);
122
+ font-size: var(--vinyasa-font-size-sm);
123
+ text-align: center;
124
+ cursor: pointer;
125
+ transition: border-color var(--vinyasa-motion-duration-fast) var(--vinyasa-motion-easing-standard), background-color var(--vinyasa-motion-duration-fast) var(--vinyasa-motion-easing-standard);
126
+ background-color: #0000;
127
+ flex-direction: column;
128
+ display: flex;
129
+ }
130
+
131
+ .rnivxt0:focus-visible {
132
+ border-color: var(--vinyasa-focus);
133
+ box-shadow: 0 0 0 1px var(--vinyasa-focus), 0 0 0 4px color-mix(in srgb, var(--vinyasa-focus) 16%, transparent);
134
+ outline: none;
135
+ }
136
+
137
+ .rnivxt0[data-disabled="true"] {
138
+ opacity: var(--vinyasa-opacity-disabled);
139
+ cursor: not-allowed;
140
+ }
141
+
142
+ .rnivxt1 {
143
+ border-color: var(--vinyasa-focus);
144
+ background-color: var(--vinyasa-secondary);
145
+ }
146
+
147
+ .rnivxt2 {
148
+ font-size: 1.5rem;
149
+ }
150
+
151
+ .rnivxt3 {
152
+ font-size: var(--vinyasa-font-size-xs);
153
+ }
154
+