@dreamcommerce/aurora 3.0.0-203 → 3.0.0-205

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 (37) hide show
  1. package/build/cjs/packages/aurora/src/components/controls/multiselect_control/multiselect_control.js +2 -1
  2. package/build/cjs/packages/aurora/src/components/controls/multiselect_control/multiselect_control.js.map +1 -1
  3. package/build/cjs/packages/aurora/src/components/controls/radio_group_control/radio_group_control.js +1 -1
  4. package/build/cjs/packages/aurora/src/components/controls/select_control/select_control.js +1 -1
  5. package/build/cjs/packages/aurora/src/components/error_list/error_list.js +1 -0
  6. package/build/cjs/packages/aurora/src/components/error_list/error_list.js.map +1 -1
  7. package/build/cjs/packages/aurora/src/components/input/input.js +6 -2
  8. package/build/cjs/packages/aurora/src/components/input/input.js.map +1 -1
  9. package/build/cjs/packages/aurora/src/components/multiselect/multiselect.js +3 -3
  10. package/build/cjs/packages/aurora/src/components/radio_group/components/radio_group_item.js +1 -1
  11. package/build/cjs/packages/aurora/src/components/select/components/select_content.js +6 -5
  12. package/build/cjs/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  13. package/build/cjs/packages/aurora/src/components/select/select.js +3 -3
  14. package/build/cjs/packages/aurora/src/components/switch/switch.js +1 -1
  15. package/build/cjs/packages/aurora/src/components/text_area/text_area.js +1 -1
  16. package/build/esm/packages/aurora/src/components/controls/multiselect_control/multiselect_control.js +2 -1
  17. package/build/esm/packages/aurora/src/components/controls/multiselect_control/multiselect_control.js.map +1 -1
  18. package/build/esm/packages/aurora/src/components/controls/radio_group_control/radio_group_control.js +1 -1
  19. package/build/esm/packages/aurora/src/components/controls/select_control/select_control.js +1 -1
  20. package/build/esm/packages/aurora/src/components/error_list/error_list.d.ts +1 -1
  21. package/build/esm/packages/aurora/src/components/error_list/error_list.js +1 -0
  22. package/build/esm/packages/aurora/src/components/error_list/error_list.js.map +1 -1
  23. package/build/esm/packages/aurora/src/components/input/input.js +6 -2
  24. package/build/esm/packages/aurora/src/components/input/input.js.map +1 -1
  25. package/build/esm/packages/aurora/src/components/multiselect/multiselect.d.ts +1 -1
  26. package/build/esm/packages/aurora/src/components/multiselect/multiselect.js +3 -3
  27. package/build/esm/packages/aurora/src/components/multiselect/multiselect_types.d.ts +1 -1
  28. package/build/esm/packages/aurora/src/components/radio_group/components/radio_group_item.js +1 -1
  29. package/build/esm/packages/aurora/src/components/radio_group/radio_group_types.d.ts +1 -1
  30. package/build/esm/packages/aurora/src/components/select/components/select_content.js +7 -6
  31. package/build/esm/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  32. package/build/esm/packages/aurora/src/components/select/select.d.ts +1 -1
  33. package/build/esm/packages/aurora/src/components/select/select.js +3 -3
  34. package/build/esm/packages/aurora/src/components/select/select_types.d.ts +1 -0
  35. package/build/esm/packages/aurora/src/components/switch/switch.js +1 -1
  36. package/build/esm/packages/aurora/src/components/text_area/text_area.js +1 -1
  37. package/package.json +2 -2
@@ -40,7 +40,8 @@ var MultiSelectControl = function MultiSelectControl(_ref) {
40
40
  options: options,
41
41
  placeholder: placeholder,
42
42
  disabled: disabled,
43
- onValueChange: onValueChange
43
+ onValueChange: onValueChange,
44
+ errors: errors
44
45
  }, props)), helperText ? /*#__PURE__*/React__default['default'].createElement(helper_text.HelperText, {
45
46
  color: disabled ? css_text_color_tokens.CSS_TEXT_COLOR_TOKENS.subtleLight : undefined
46
47
  }, helperText) : null, errors ? /*#__PURE__*/React__default['default'].createElement(error_list.ErrorList, {
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -60,7 +60,7 @@ var RadioGroupControl = function RadioGroupControl(_ref) {
60
60
  key: "radio-button-".concat(item.value),
61
61
  value: item.value,
62
62
  id: item.id,
63
- errors: !!errors,
63
+ errors: errors,
64
64
  disabled: disabled,
65
65
  label: item.label,
66
66
  helperText: item.helperText,
@@ -52,7 +52,7 @@ var SelectControl = function SelectControl(_ref) {
52
52
  searchPlaceholder: searchPlaceholder,
53
53
  innerAdditionalContent: innerAdditionalContent,
54
54
  hasClearValueButton: hasClearValueButton,
55
- hasError: !!errors,
55
+ errors: errors,
56
56
  onValueChange: onValueChange,
57
57
  onScroll: onScroll
58
58
  }, props)), helperText ? /*#__PURE__*/React__default['default'].createElement(helper_text.HelperText, {
@@ -14,6 +14,7 @@ var ErrorList = function ErrorList(_ref) {
14
14
  className = _ref.className,
15
15
  props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
16
16
  var singleError = typeof errors === 'string';
17
+ if (!(errors !== null && errors !== void 0 && errors.length)) return null;
17
18
  return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.objectSpread2({
18
19
  className: cn.cn(error_list_variants.errorListVariants(), className)
19
20
  }, props), singleError ? (/*#__PURE__*/React.createElement(error_list_item.ErrorListItem, null, errors)) : errors.map(function (error, index) {
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -49,7 +49,11 @@ var Input = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, re
49
49
  }
50
50
  }, [preElement, postElement]);
51
51
  return /*#__PURE__*/React__default['default'].createElement("div", {
52
- className: cn.cn(input_variants.inputVariants(), errors && 'aurora-border-danger aurora-border-2', disabled && 'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed', type === 'number' && 'aurora-appearance-none')
52
+ className: cn.cn(input_variants.inputVariants(), {
53
+ 'aurora-border-danger aurora-border-2': !!(errors !== null && errors !== void 0 && errors.length),
54
+ 'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed': disabled,
55
+ 'aurora-appearance-none': type === 'number'
56
+ })
53
57
  }, preElement && (/*#__PURE__*/React__default['default'].createElement("div", {
54
58
  ref: preElRef,
55
59
  className: 'aurora-absolute aurora-flex aurora-h-full aurora-items-center aurora-pointer-events-none aurora-pl-2'
@@ -66,7 +70,7 @@ var Input = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, re
66
70
  onKeyDown: onKeyDown,
67
71
  onKeyUp: onKeyUp,
68
72
  type: type,
69
- className: cn.cn("aurora-h-[40px] aurora-w-full focus:aurora-outline-none focus:aurora-shadow-none aurora-px-3 aurora-rounded-6", className),
73
+ className: cn.cn('aurora-h-[40px] aurora-w-full focus:aurora-outline-none focus:aurora-shadow-none aurora-px-3 aurora-rounded-6', className),
70
74
  style: {
71
75
  paddingLeft: preElWidth ? "".concat(preElWidth, "px") : '',
72
76
  paddingRight: postElWidth ? "".concat(postElWidth, "px") : ''
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
 
13
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
- var _excluded = ["id", "options", "placeholder", "disabled", "hasSearch", "searchPlaceholder", "hasErrors", "onValueChange"];
15
+ var _excluded = ["id", "options", "placeholder", "disabled", "hasSearch", "searchPlaceholder", "onValueChange", "errors"];
16
16
  var MultiSelect = function MultiSelect(_ref) {
17
17
  var id = _ref.id,
18
18
  options = _ref.options,
@@ -20,8 +20,8 @@ var MultiSelect = function MultiSelect(_ref) {
20
20
  disabled = _ref.disabled,
21
21
  hasSearch = _ref.hasSearch,
22
22
  searchPlaceholder = _ref.searchPlaceholder,
23
- hasErrors = _ref.hasErrors,
24
23
  onValueChange = _ref.onValueChange,
24
+ errors = _ref.errors,
25
25
  props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
26
26
  var _React$useState = React__default['default'].useState([]),
27
27
  _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
@@ -62,7 +62,7 @@ var MultiSelect = function MultiSelect(_ref) {
62
62
  placeholder: placeholder,
63
63
  disabled: disabled,
64
64
  ref: triggerRef,
65
- hasErrors: hasErrors
65
+ hasErrors: !!(errors !== null && errors !== void 0 && errors.length)
66
66
  }), /*#__PURE__*/React__default['default'].createElement(DropdownMenuPrimitive.Portal, null, /*#__PURE__*/React__default['default'].createElement(multiselect_content.MultiSelectContent, {
67
67
  options: options,
68
68
  selectedOptions: selectedOptions,
@@ -35,7 +35,7 @@ var RadioGroupItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
35
  required: required,
36
36
  className: cn.cn('aurora-transition-[background-color] aurora-shrink-0 aurora-h-5 aurora-w-5 aurora-rounded-full aurora-border focus data-[state=checked]:aurora-bg-primary', {
37
37
  '!aurora-bg-active aurora-cursor-not-allowed': disabled,
38
- '!aurora-bg-neutral-0 aurora-border-danger aurora-border-2': errors
38
+ '!aurora-bg-neutral-0 aurora-border-danger aurora-border-2': !!(errors !== null && errors !== void 0 && errors.length)
39
39
  }, className)
40
40
  }, props), /*#__PURE__*/React.createElement(RadioGroupPrimitive.Indicator, {
41
41
  className: "aurora-flex aurora-items-center aurora-justify-center"
@@ -40,12 +40,13 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
40
40
  _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
41
41
  isHovered = _useState4[0],
42
42
  setIsHovered = _useState4[1];
43
- React.useEffect(function () {
43
+ React.useLayoutEffect(function () {
44
44
  if (triggerRef.current) {
45
- setTriggerWidth(triggerRef.current.getBoundingClientRect().width);
45
+ var rect = triggerRef.current.getBoundingClientRect();
46
+ setTriggerWidth(rect.width);
46
47
  }
47
- }, [triggerRef]);
48
- return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Portal, null, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Content, _rollupPluginBabelHelpers.objectSpread2({
48
+ }, []);
49
+ return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Portal, null, triggerWidth && (/*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Content, _rollupPluginBabelHelpers.objectSpread2({
49
50
  ref: ref,
50
51
  style: {
51
52
  width: triggerWidth ? "".concat(triggerWidth, "px") : 'auto'
@@ -102,7 +103,7 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
102
103
  className: cn.cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200', _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, 'aurora-pt-16', hasSearch), 'aurora-opacity-75', isHovered), 'aurora-opacity-0', !isHovered))
103
104
  }, /*#__PURE__*/React__default['default'].createElement(index.Thumb, {
104
105
  className: "aurora-bg-neutral-700 aurora-rounded-full"
105
- })))));
106
+ }))))));
106
107
  });
107
108
  SelectContent.displayName = SelectPrimitive.Content.displayName;
108
109
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
14
14
 
15
15
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
 
17
- var _excluded = ["children", "id", "defaultValue", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "hasError", "onValueChange", "onScroll"];
17
+ var _excluded = ["children", "id", "defaultValue", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "errors", "onValueChange", "onScroll"];
18
18
  var Select = function Select(_ref) {
19
19
  var children = _ref.children,
20
20
  id = _ref.id,
@@ -26,7 +26,7 @@ var Select = function Select(_ref) {
26
26
  searchPlaceholder = _ref.searchPlaceholder,
27
27
  hasClearValueButton = _ref.hasClearValueButton,
28
28
  innerAdditionalContent = _ref.innerAdditionalContent,
29
- hasError = _ref.hasError,
29
+ errors = _ref.errors,
30
30
  onValueChange = _ref.onValueChange,
31
31
  onScroll = _ref.onScroll,
32
32
  props = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
@@ -73,7 +73,7 @@ var Select = function Select(_ref) {
73
73
  }, /*#__PURE__*/React__default['default'].createElement(select_trigger.SelectTrigger, {
74
74
  ref: triggerRef,
75
75
  id: id,
76
- hasError: hasError
76
+ hasError: !!(errors !== null && errors !== void 0 && errors.length)
77
77
  }, /*#__PURE__*/React__default['default'].createElement(select_value.SelectValue, {
78
78
  placeholder: placeholder
79
79
  }, selectedValue ? getSelectedLabel(options, selectedValue) : placeholder !== null && placeholder !== void 0 ? placeholder : '')), selectedValue && hasClearValueButton && (/*#__PURE__*/React__default['default'].createElement("div", {
@@ -31,7 +31,7 @@ var Switch = /*#__PURE__*/React__default['default'].forwardRef(function (_ref, r
31
31
  ref: ref,
32
32
  className: cn.cn('aurora-inline-flex aurora-items-center aurora-relative aurora-w-[36px] aurora-h-[20px] aurora-rounded-full aurora-bg-active hover:aurora-ring-2 hover:aurora-ring-subtle focus:aurora-ring-2 focus:aurora-ring-primary focus:aurora-outline-none focus:aurora-ring-offset aurora-cursor-pointer aurora-transition-all data-[state=checked]:aurora-bg-primary aurora-shrink-0', {
33
33
  'aurora-cursor-not-allowed aurora-pointer-events-none aurora-bg-neutral-300 data-[state=checked]:!aurora-bg-active': disabled,
34
- 'aurora-ring-danger aurora-ring-2': errors && errors.length > 0
34
+ 'aurora-ring-danger aurora-ring-2': !!(errors !== null && errors !== void 0 && errors.length)
35
35
  }, className),
36
36
  disabled: disabled,
37
37
  defaultChecked: defaultChecked,
@@ -40,7 +40,7 @@ var TextArea = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
40
40
  onKeyDown: onKeyDown,
41
41
  onKeyUp: onKeyUp,
42
42
  className: cn.cn('aurora-rounded-6 aurora-h-[72px] focus aurora-border aurora-bg aurora-text-s aurora-placeholder-neutral-500 aurora-text aurora-px-3 aurora-py-2 hover:aurora-border-strong active:aurora-border-active disabled:aurora-opacity-50 aurora-w-full', {
43
- 'aurora-border-danger': errors,
43
+ 'aurora-border-danger': !!(errors !== null && errors !== void 0 && errors.length),
44
44
  'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed': disabled
45
45
  }, className)
46
46
  }));
@@ -32,7 +32,8 @@ var MultiSelectControl = function MultiSelectControl(_ref) {
32
32
  options: options,
33
33
  placeholder: placeholder,
34
34
  disabled: disabled,
35
- onValueChange: onValueChange
35
+ onValueChange: onValueChange,
36
+ errors: errors
36
37
  }, props)), helperText ? /*#__PURE__*/React.createElement(HelperText, {
37
38
  color: disabled ? CSS_TEXT_COLOR_TOKENS.subtleLight : undefined
38
39
  }, helperText) : null, errors ? /*#__PURE__*/React.createElement(ErrorList, {
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -52,7 +52,7 @@ var RadioGroupControl = function RadioGroupControl(_ref) {
52
52
  key: "radio-button-".concat(item.value),
53
53
  value: item.value,
54
54
  id: item.id,
55
- errors: !!errors,
55
+ errors: errors,
56
56
  disabled: disabled,
57
57
  label: item.label,
58
58
  helperText: item.helperText,
@@ -44,7 +44,7 @@ var SelectControl = function SelectControl(_ref) {
44
44
  searchPlaceholder: searchPlaceholder,
45
45
  innerAdditionalContent: innerAdditionalContent,
46
46
  hasClearValueButton: hasClearValueButton,
47
- hasError: !!errors,
47
+ errors: errors,
48
48
  onValueChange: onValueChange,
49
49
  onScroll: onScroll
50
50
  }, props)), helperText ? /*#__PURE__*/React.createElement(HelperText, {
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
3
  import { TErrorListProps } from './error_list_types';
4
- export declare const ErrorList: ({ errors, className, ...props }: PropsWithChildren<TErrorListProps>) => React.JSX.Element;
4
+ export declare const ErrorList: ({ errors, className, ...props }: PropsWithChildren<TErrorListProps>) => React.JSX.Element | null;
@@ -10,6 +10,7 @@ var ErrorList = function ErrorList(_ref) {
10
10
  className = _ref.className,
11
11
  props = _objectWithoutProperties(_ref, _excluded);
12
12
  var singleError = typeof errors === 'string';
13
+ if (!(errors !== null && errors !== void 0 && errors.length)) return null;
13
14
  return /*#__PURE__*/createElement("ul", _objectSpread2({
14
15
  className: cn(errorListVariants(), className)
15
16
  }, props), singleError ? (/*#__PURE__*/createElement(ErrorListItem, null, errors)) : errors.map(function (error, index) {
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -41,7 +41,11 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
41
41
  }
42
42
  }, [preElement, postElement]);
43
43
  return /*#__PURE__*/React.createElement("div", {
44
- className: cn(inputVariants(), errors && 'aurora-border-danger aurora-border-2', disabled && 'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed', type === 'number' && 'aurora-appearance-none')
44
+ className: cn(inputVariants(), {
45
+ 'aurora-border-danger aurora-border-2': !!(errors !== null && errors !== void 0 && errors.length),
46
+ 'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed': disabled,
47
+ 'aurora-appearance-none': type === 'number'
48
+ })
45
49
  }, preElement && (/*#__PURE__*/React.createElement("div", {
46
50
  ref: preElRef,
47
51
  className: 'aurora-absolute aurora-flex aurora-h-full aurora-items-center aurora-pointer-events-none aurora-pl-2'
@@ -58,7 +62,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
58
62
  onKeyDown: onKeyDown,
59
63
  onKeyUp: onKeyUp,
60
64
  type: type,
61
- className: cn("aurora-h-[40px] aurora-w-full focus:aurora-outline-none focus:aurora-shadow-none aurora-px-3 aurora-rounded-6", className),
65
+ className: cn('aurora-h-[40px] aurora-w-full focus:aurora-outline-none focus:aurora-shadow-none aurora-px-3 aurora-rounded-6', className),
62
66
  style: {
63
67
  paddingLeft: preElWidth ? "".concat(preElWidth, "px") : '',
64
68
  paddingRight: postElWidth ? "".concat(postElWidth, "px") : ''
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,6 +1,6 @@
1
1
  import { TMultiSelectProps } from './multiselect_types';
2
2
  import React, { PropsWithChildren } from 'react';
3
3
  export declare const MultiSelect: {
4
- ({ id, options, placeholder, disabled, hasSearch, searchPlaceholder, hasErrors, onValueChange, ...props }: PropsWithChildren<TMultiSelectProps>): React.JSX.Element;
4
+ ({ id, options, placeholder, disabled, hasSearch, searchPlaceholder, onValueChange, errors, ...props }: PropsWithChildren<TMultiSelectProps>): React.JSX.Element;
5
5
  displayName: string;
6
6
  };
@@ -4,7 +4,7 @@ import { Root, Portal } from '@radix-ui/react-dropdown-menu';
4
4
  import { MultiSelectContent } from './components/multiselect_content.js';
5
5
  import { MultiSelectTrigger } from './components/multiselect_trigger.js';
6
6
 
7
- var _excluded = ["id", "options", "placeholder", "disabled", "hasSearch", "searchPlaceholder", "hasErrors", "onValueChange"];
7
+ var _excluded = ["id", "options", "placeholder", "disabled", "hasSearch", "searchPlaceholder", "onValueChange", "errors"];
8
8
  var MultiSelect = function MultiSelect(_ref) {
9
9
  var id = _ref.id,
10
10
  options = _ref.options,
@@ -12,8 +12,8 @@ var MultiSelect = function MultiSelect(_ref) {
12
12
  disabled = _ref.disabled,
13
13
  hasSearch = _ref.hasSearch,
14
14
  searchPlaceholder = _ref.searchPlaceholder,
15
- hasErrors = _ref.hasErrors,
16
15
  onValueChange = _ref.onValueChange,
16
+ errors = _ref.errors,
17
17
  props = _objectWithoutProperties(_ref, _excluded);
18
18
  var _React$useState = React.useState([]),
19
19
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -54,7 +54,7 @@ var MultiSelect = function MultiSelect(_ref) {
54
54
  placeholder: placeholder,
55
55
  disabled: disabled,
56
56
  ref: triggerRef,
57
- hasErrors: hasErrors
57
+ hasErrors: !!(errors !== null && errors !== void 0 && errors.length)
58
58
  }), /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(MultiSelectContent, {
59
59
  options: options,
60
60
  selectedOptions: selectedOptions,
@@ -15,7 +15,7 @@ export interface TMultiSelectProps extends React.ComponentPropsWithoutRef<typeof
15
15
  disabled?: boolean;
16
16
  hasSearch?: boolean;
17
17
  searchPlaceholder?: string;
18
- hasErrors?: boolean;
18
+ errors?: string | string[];
19
19
  onValueChange?: (selectedOption: Option[]) => void;
20
20
  }
21
21
  export interface TMultiSelectTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenu.Trigger> {
@@ -31,7 +31,7 @@ var RadioGroupItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
31
31
  required: required,
32
32
  className: cn('aurora-transition-[background-color] aurora-shrink-0 aurora-h-5 aurora-w-5 aurora-rounded-full aurora-border focus data-[state=checked]:aurora-bg-primary', {
33
33
  '!aurora-bg-active aurora-cursor-not-allowed': disabled,
34
- '!aurora-bg-neutral-0 aurora-border-danger aurora-border-2': errors
34
+ '!aurora-bg-neutral-0 aurora-border-danger aurora-border-2': !!(errors !== null && errors !== void 0 && errors.length)
35
35
  }, className)
36
36
  }, props), /*#__PURE__*/createElement(Indicator, {
37
37
  className: "aurora-flex aurora-items-center aurora-justify-center"
@@ -7,5 +7,5 @@ export interface TRadioGroupItemProps extends React.ComponentPropsWithoutRef<typ
7
7
  label?: string | React.ReactNode;
8
8
  tooltip?: string | React.ReactNode;
9
9
  helperText?: string | React.ReactNode;
10
- errors?: boolean;
10
+ errors?: string | string[];
11
11
  }
@@ -1,4 +1,4 @@
1
- import React, { useRef, useState, useEffect } from 'react';
1
+ import React, { useRef, useState, useLayoutEffect } from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
3
  import { cn } from '../../../utilities/cn.js';
4
4
  import { Input } from '../../input/input.js';
@@ -32,12 +32,13 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
32
  _useState4 = _slicedToArray(_useState3, 2),
33
33
  isHovered = _useState4[0],
34
34
  setIsHovered = _useState4[1];
35
- useEffect(function () {
35
+ useLayoutEffect(function () {
36
36
  if (triggerRef.current) {
37
- setTriggerWidth(triggerRef.current.getBoundingClientRect().width);
37
+ var rect = triggerRef.current.getBoundingClientRect();
38
+ setTriggerWidth(rect.width);
38
39
  }
39
- }, [triggerRef]);
40
- return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Content, _objectSpread2({
40
+ }, []);
41
+ return /*#__PURE__*/React.createElement(Portal, null, triggerWidth && (/*#__PURE__*/React.createElement(Content, _objectSpread2({
41
42
  ref: ref,
42
43
  style: {
43
44
  width: triggerWidth ? "".concat(triggerWidth, "px") : 'auto'
@@ -94,7 +95,7 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
94
95
  className: cn('aurora-w-2 aurora-absolute aurora-right-0 aurora-top-0 aurora-bottom-0 aurora-py-1 aurora-pr-[2px] aurora-transition-opacity aurora-duration-200', _defineProperty(_defineProperty(_defineProperty({}, 'aurora-pt-16', hasSearch), 'aurora-opacity-75', isHovered), 'aurora-opacity-0', !isHovered))
95
96
  }, /*#__PURE__*/React.createElement(Thumb, {
96
97
  className: "aurora-bg-neutral-700 aurora-rounded-full"
97
- })))));
98
+ }))))));
98
99
  });
99
100
  SelectContent.displayName = Content.displayName;
100
101
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,+DAA+D,0EAA8E;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,+DAA+D,0EAA8E;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,6 +1,6 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { TSelectProps } from './select_types';
3
3
  export declare const Select: {
4
- ({ children, id, defaultValue, options, disabled, placeholder, hasSearch, searchPlaceholder, hasClearValueButton, innerAdditionalContent, hasError, onValueChange, onScroll, ...props }: PropsWithChildren<TSelectProps>): React.JSX.Element;
4
+ ({ children, id, defaultValue, options, disabled, placeholder, hasSearch, searchPlaceholder, hasClearValueButton, innerAdditionalContent, errors, onValueChange, onScroll, ...props }: PropsWithChildren<TSelectProps>): React.JSX.Element;
5
5
  displayName: string | undefined;
6
6
  };
@@ -6,7 +6,7 @@ import { SelectContent } from './components/select_content.js';
6
6
  import { SelectTrigger } from './components/select_trigger.js';
7
7
  import { SelectValue } from './components/select_value.js';
8
8
 
9
- var _excluded = ["children", "id", "defaultValue", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "hasError", "onValueChange", "onScroll"];
9
+ var _excluded = ["children", "id", "defaultValue", "options", "disabled", "placeholder", "hasSearch", "searchPlaceholder", "hasClearValueButton", "innerAdditionalContent", "errors", "onValueChange", "onScroll"];
10
10
  var Select = function Select(_ref) {
11
11
  var children = _ref.children,
12
12
  id = _ref.id,
@@ -18,7 +18,7 @@ var Select = function Select(_ref) {
18
18
  searchPlaceholder = _ref.searchPlaceholder,
19
19
  hasClearValueButton = _ref.hasClearValueButton,
20
20
  innerAdditionalContent = _ref.innerAdditionalContent,
21
- hasError = _ref.hasError,
21
+ errors = _ref.errors,
22
22
  onValueChange = _ref.onValueChange,
23
23
  onScroll = _ref.onScroll,
24
24
  props = _objectWithoutProperties(_ref, _excluded);
@@ -65,7 +65,7 @@ var Select = function Select(_ref) {
65
65
  }, /*#__PURE__*/React.createElement(SelectTrigger, {
66
66
  ref: triggerRef,
67
67
  id: id,
68
- hasError: hasError
68
+ hasError: !!(errors !== null && errors !== void 0 && errors.length)
69
69
  }, /*#__PURE__*/React.createElement(SelectValue, {
70
70
  placeholder: placeholder
71
71
  }, selectedValue ? getSelectedLabel(options, selectedValue) : placeholder !== null && placeholder !== void 0 ? placeholder : '')), selectedValue && hasClearValueButton && (/*#__PURE__*/React.createElement("div", {
@@ -34,6 +34,7 @@ export interface TSelectProps extends React.ComponentPropsWithoutRef<typeof Sele
34
34
  searchPlaceholder?: string;
35
35
  innerAdditionalContent?: ReactNode;
36
36
  hasClearValueButton?: boolean;
37
+ errors?: string | string[];
37
38
  hasError?: boolean;
38
39
  onScroll?: (event: React.UIEvent<HTMLElement>) => void;
39
40
  }
@@ -23,7 +23,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
23
  ref: ref,
24
24
  className: cn('aurora-inline-flex aurora-items-center aurora-relative aurora-w-[36px] aurora-h-[20px] aurora-rounded-full aurora-bg-active hover:aurora-ring-2 hover:aurora-ring-subtle focus:aurora-ring-2 focus:aurora-ring-primary focus:aurora-outline-none focus:aurora-ring-offset aurora-cursor-pointer aurora-transition-all data-[state=checked]:aurora-bg-primary aurora-shrink-0', {
25
25
  'aurora-cursor-not-allowed aurora-pointer-events-none aurora-bg-neutral-300 data-[state=checked]:!aurora-bg-active': disabled,
26
- 'aurora-ring-danger aurora-ring-2': errors && errors.length > 0
26
+ 'aurora-ring-danger aurora-ring-2': !!(errors !== null && errors !== void 0 && errors.length)
27
27
  }, className),
28
28
  disabled: disabled,
29
29
  defaultChecked: defaultChecked,
@@ -32,7 +32,7 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
32
  onKeyDown: onKeyDown,
33
33
  onKeyUp: onKeyUp,
34
34
  className: cn('aurora-rounded-6 aurora-h-[72px] focus aurora-border aurora-bg aurora-text-s aurora-placeholder-neutral-500 aurora-text aurora-px-3 aurora-py-2 hover:aurora-border-strong active:aurora-border-active disabled:aurora-opacity-50 aurora-w-full', {
35
- 'aurora-border-danger': errors,
35
+ 'aurora-border-danger': !!(errors !== null && errors !== void 0 && errors.length),
36
36
  'aurora-bg-subtle aurora-text-subtle-light aurora-pointer-events-none aurora-cursor-not-allowed': disabled
37
37
  }, className)
38
38
  }));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "3.0.0-203",
5
+ "version": "3.0.0-205",
6
6
  "description": "aurora",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "update-visuals": "jest -c .config/jest/jest.config.visual.js --updateSnapshot"
57
57
  },
58
58
  "devDependencies": {
59
- "@dreamcommerce/utilities": "^1.19.2",
59
+ "@dreamcommerce/utilities": "^1.20.0",
60
60
  "@radix-ui/react-accordion": "1.1.0",
61
61
  "@radix-ui/react-checkbox": "1.1.3",
62
62
  "@radix-ui/react-dropdown-menu": "2.1.2",