@dreamcommerce/aurora 3.0.0-63 → 3.0.0-64

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 (91) hide show
  1. package/build/cjs/packages/aurora/src/components/controls/input_control/input_control.js +6 -1
  2. package/build/cjs/packages/aurora/src/components/controls/input_control/input_control.js.map +1 -1
  3. package/build/cjs/packages/aurora/src/components/controls/switch_control/switch_control.js +2 -1
  4. package/build/cjs/packages/aurora/src/components/controls/switch_control/switch_control.js.map +1 -1
  5. package/build/cjs/packages/aurora/src/constants/css_tokens/css_icon_color_tokens.js +1 -1
  6. package/build/esm/packages/aurora/src/assets/icons/delete_bin_icon.d.ts +1 -0
  7. package/build/esm/packages/aurora/src/assets/icons/delete_bin_icon.js +3 -0
  8. package/build/esm/packages/aurora/src/assets/icons/delete_bin_icon.js.map +1 -0
  9. package/build/esm/packages/aurora/src/assets/icons/image_edit_icon.d.ts +1 -0
  10. package/build/esm/packages/aurora/src/assets/icons/image_edit_icon.js +3 -0
  11. package/build/esm/packages/aurora/src/assets/icons/image_edit_icon.js.map +1 -0
  12. package/build/esm/packages/aurora/src/assets/icons/layout_bottom_line_icon.d.ts +1 -0
  13. package/build/esm/packages/aurora/src/assets/icons/layout_bottom_line_icon.js +3 -0
  14. package/build/esm/packages/aurora/src/assets/icons/layout_bottom_line_icon.js.map +1 -0
  15. package/build/esm/packages/aurora/src/assets/icons/upload_icon.d.ts +1 -0
  16. package/build/esm/packages/aurora/src/assets/icons/upload_icon.js +3 -0
  17. package/build/esm/packages/aurora/src/assets/icons/upload_icon.js.map +1 -0
  18. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumb_child.d.ts +3 -0
  19. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumb_child.js +14 -0
  20. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumb_child.js.map +1 -0
  21. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs.d.ts +6 -0
  22. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs.js +35 -0
  23. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs.js.map +1 -0
  24. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs_types.d.ts +10 -0
  25. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs_types.js +2 -0
  26. package/build/esm/packages/aurora/src/components/breadcrumbs/breadcrumbs_types.js.map +1 -0
  27. package/build/esm/packages/aurora/src/components/control/control_types.d.ts +2 -1
  28. package/build/esm/packages/aurora/src/components/control/control_types.js +1 -1
  29. package/build/esm/packages/aurora/src/components/controls/controls_group/controls_group.d.ts +3 -0
  30. package/build/esm/packages/aurora/src/components/controls/controls_group/controls_group.js +7 -0
  31. package/build/esm/packages/aurora/src/components/controls/controls_group/controls_group.js.map +1 -0
  32. package/build/esm/packages/aurora/src/components/controls/input_control/input_control.js +6 -1
  33. package/build/esm/packages/aurora/src/components/controls/input_control/input_control.js.map +1 -1
  34. package/build/esm/packages/aurora/src/components/controls/input_control/input_control_types.d.ts +1 -0
  35. package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control.js +2 -1
  36. package/build/esm/packages/aurora/src/components/controls/switch_control/switch_control.js.map +1 -1
  37. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control.d.ts +3 -0
  38. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control.js +17 -0
  39. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control.js.map +1 -0
  40. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control_types.d.ts +8 -0
  41. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control_types.js +3 -0
  42. package/build/esm/packages/aurora/src/components/controls/text_area_control/text_area_control_types.js.map +1 -0
  43. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control.d.ts +3 -0
  44. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control.js +24 -0
  45. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control.js.map +1 -0
  46. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control_types.d.ts +15 -0
  47. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control_types.js +5 -0
  48. package/build/esm/packages/aurora/src/components/controls/xhr_image_picker_control/xhr_image_picker_control_types.js.map +1 -0
  49. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_input.d.ts +9 -0
  50. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_input.js +19 -0
  51. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_input.js.map +1 -0
  52. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_preview.d.ts +9 -0
  53. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_preview.js +6 -0
  54. package/build/esm/packages/aurora/src/components/image_picker/components/image_picker_preview.js.map +1 -0
  55. package/build/esm/packages/aurora/src/components/image_picker/components/uploaded_image_picker_item.d.ts +9 -0
  56. package/build/esm/packages/aurora/src/components/image_picker/components/uploaded_image_picker_item.js +19 -0
  57. package/build/esm/packages/aurora/src/components/image_picker/components/uploaded_image_picker_item.js.map +1 -0
  58. package/build/esm/packages/aurora/src/components/image_picker/image_picker.d.ts +3 -0
  59. package/build/esm/packages/aurora/src/components/image_picker/image_picker.js +76 -0
  60. package/build/esm/packages/aurora/src/components/image_picker/image_picker.js.map +1 -0
  61. package/build/esm/packages/aurora/src/components/image_picker/image_picker_constants.d.ts +35 -0
  62. package/build/esm/packages/aurora/src/components/image_picker/image_picker_constants.js +36 -0
  63. package/build/esm/packages/aurora/src/components/image_picker/image_picker_constants.js.map +1 -0
  64. package/build/esm/packages/aurora/src/components/image_picker/image_picker_types.d.ts +59 -0
  65. package/build/esm/packages/aurora/src/components/image_picker/image_picker_types.js +4 -0
  66. package/build/esm/packages/aurora/src/components/image_picker/image_picker_types.js.map +1 -0
  67. package/build/esm/packages/aurora/src/components/image_picker/image_picker_utils.d.ts +1 -0
  68. package/build/esm/packages/aurora/src/components/image_picker/image_picker_utils.js +6 -0
  69. package/build/esm/packages/aurora/src/components/image_picker/image_picker_utils.js.map +1 -0
  70. package/build/esm/packages/aurora/src/components/image_picker/use_image_picker.d.ts +2 -0
  71. package/build/esm/packages/aurora/src/components/image_picker/use_image_picker.js +117 -0
  72. package/build/esm/packages/aurora/src/components/image_picker/use_image_picker.js.map +1 -0
  73. package/build/esm/packages/aurora/src/components/text_area/text_area.d.ts +3 -0
  74. package/build/esm/packages/aurora/src/components/text_area/text_area.js +7 -0
  75. package/build/esm/packages/aurora/src/components/text_area/text_area.js.map +1 -0
  76. package/build/esm/packages/aurora/src/components/text_area/text_area_types.d.ts +4 -0
  77. package/build/esm/packages/aurora/src/components/text_area/text_area_types.js +2 -0
  78. package/build/esm/packages/aurora/src/components/text_area/text_area_types.js.map +1 -0
  79. package/build/esm/packages/aurora/src/components/text_area/text_area_variants.d.ts +1 -0
  80. package/build/esm/packages/aurora/src/components/text_area/text_area_variants.js +3 -0
  81. package/build/esm/packages/aurora/src/components/text_area/text_area_variants.js.map +1 -0
  82. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker.d.ts +3 -0
  83. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker.js +102 -0
  84. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker.js.map +1 -0
  85. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker_types.d.ts +17 -0
  86. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker_types.js +2 -0
  87. package/build/esm/packages/aurora/src/components/xhr_image_picker/xhr_image_picker_types.js.map +1 -0
  88. package/build/esm/packages/aurora/src/constants/css_tokens/css_icon_color_tokens.d.ts +1 -1
  89. package/build/esm/packages/aurora/src/constants/css_tokens/css_icon_color_tokens.js +1 -1
  90. package/build/index.css +1 -1
  91. package/package.json +1 -1
@@ -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 = ["id", "name", "label", "helperText", "preElement", "postElement", "errors", "disabled", "defaultValue", "value", "placeholder", "readOnly", "type", "onChange", "onKeyDown", "onKeyUp"];
17
+ var _excluded = ["id", "name", "label", "helperText", "preElement", "postElement", "errors", "disabled", "defaultValue", "value", "placeholder", "readOnly", "type", "required", "tooltip", "onChange", "onKeyDown", "onKeyUp"];
18
18
  var InputControl = function InputControl(_ref) {
19
19
  var id = _ref.id,
20
20
  name = _ref.name,
@@ -29,6 +29,8 @@ var InputControl = function InputControl(_ref) {
29
29
  placeholder = _ref.placeholder,
30
30
  readOnly = _ref.readOnly,
31
31
  type = _ref.type,
32
+ required = _ref.required,
33
+ tooltip = _ref.tooltip,
32
34
  onChange = _ref.onChange,
33
35
  onKeyDown = _ref.onKeyDown,
34
36
  onKeyUp = _ref.onKeyUp,
@@ -37,6 +39,9 @@ var InputControl = function InputControl(_ref) {
37
39
  classname: "aurora-flex-col"
38
40
  }, label$1 && (/*#__PURE__*/React__default['default'].createElement(label.Label, {
39
41
  htmlFor: id,
42
+ required: required,
43
+ tooltip: tooltip,
44
+ disabled: disabled,
40
45
  className: "aurora-pb-1 aurora-text"
41
46
  }, label$1)), /*#__PURE__*/React__default['default'].createElement(input.Input, _rollupPluginBabelHelpers.objectSpread2({
42
47
  id: id,
@@ -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;"}
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;"}
@@ -46,7 +46,8 @@ var SwitchControl = function SwitchControl(_ref) {
46
46
  className: "aurora-ml-2 aurora-mt-1 aurora-flex aurora-flex-col aurora-gap-1"
47
47
  }, label$1 && (/*#__PURE__*/React__default['default'].createElement(label.Label, {
48
48
  required: required,
49
- tooltip: tooltip
49
+ tooltip: tooltip,
50
+ disabled: disabled
50
51
  }, label$1)), helperText && /*#__PURE__*/React__default['default'].createElement(helper_text.HelperText, null, helperText), errors && /*#__PURE__*/React__default['default'].createElement(error_list.ErrorList, {
51
52
  errors: errors
52
53
  })));
@@ -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;"}
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;"}
@@ -6,7 +6,7 @@ var css_color_tokens_values = require('./css_color_tokens_values.js');
6
6
 
7
7
  var CSS_ICON_COLOR_TOKENS_VALUES = {
8
8
  base: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.neutral900,
9
- subtle: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.neutral500,
9
+ subtle: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.neutral600,
10
10
  disabled: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.neutral200,
11
11
  inverse: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.neutral0,
12
12
  inverseSubtle: css_color_tokens_values.CSS_COLOR_TOKENS_VALUES.lightTransparent20,
@@ -0,0 +1 @@
1
+ export declare const DeleteBinLineIcon: import("@remixicon/react").RemixiconComponentType;
@@ -0,0 +1,3 @@
1
+ import { RiDeleteBinLine } from '@remixicon/react';
2
+ export const DeleteBinLineIcon = RiDeleteBinLine;
3
+ //# sourceMappingURL=delete_bin_icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_bin_icon.js","sourceRoot":"","sources":["../../../../../../../src/assets/icons/delete_bin_icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const ImageEditLineIcon: import("@remixicon/react").RemixiconComponentType;
@@ -0,0 +1,3 @@
1
+ import { RiImageEditLine } from '@remixicon/react';
2
+ export const ImageEditLineIcon = RiImageEditLine;
3
+ //# sourceMappingURL=image_edit_icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_edit_icon.js","sourceRoot":"","sources":["../../../../../../../src/assets/icons/image_edit_icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const LayoutBottomLineIcon: import("@remixicon/react").RemixiconComponentType;
@@ -0,0 +1,3 @@
1
+ import { RiLayoutBottomLine } from '@remixicon/react';
2
+ export const LayoutBottomLineIcon = RiLayoutBottomLine;
3
+ //# sourceMappingURL=layout_bottom_line_icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout_bottom_line_icon.js","sourceRoot":"","sources":["../../../../../../../src/assets/icons/layout_bottom_line_icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const UploadLineIcon: import("@remixicon/react").RemixiconComponentType;
@@ -0,0 +1,3 @@
1
+ import { RiUploadLine } from '@remixicon/react';
2
+ export const UploadLineIcon = RiUploadLine;
3
+ //# sourceMappingURL=upload_icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload_icon.js","sourceRoot":"","sources":["../../../../../../../src/assets/icons/upload_icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TBreadcrumbChildProps } from './breadcrumbs_types';
3
+ export declare const BreadcrumbChild: ({ children, attributes }: TBreadcrumbChildProps) => React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './breadcrumbs_types';
3
+ export const BreadcrumbChild = ({ children, attributes }) => {
4
+ const breadcrumbRef = React.useRef(null);
5
+ React.useEffect(() => {
6
+ if (!breadcrumbRef.current || !attributes)
7
+ return;
8
+ Object.entries(attributes).forEach(([key, value]) => {
9
+ breadcrumbRef.current?.setAttribute(key, value);
10
+ });
11
+ }, []);
12
+ return (React.createElement("li", { ref: breadcrumbRef }, children));
13
+ };
14
+ //# sourceMappingURL=breadcrumb_child.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb_child.js","sourceRoot":"","sources":["../../../../../../../src/components/breadcrumbs/breadcrumb_child.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAsC,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAyB,EAAE,EAAE;IAC/E,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAExD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,UAAU;YAAE,OAAO;QAElD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAChD,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,4BAAI,GAAG,EAAE,aAAa,IACjB,QAAQ,CACR,CACR,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { TBreadcrumbsProps } from './breadcrumbs_types';
3
+ export declare const Breadcrumbs: ({ classname, as, children, attributes, withoutSeparator }: TBreadcrumbsProps) => React.ReactElement<{
4
+ className: string | undefined;
5
+ }, string | React.JSXElementConstructor<any>>;
6
+ export default Breadcrumbs;
@@ -0,0 +1,35 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { Stack } from '@auroraComponents/stack/stack';
3
+ import { BreadcrumbChild } from './breadcrumb_child';
4
+ import { ArrowRightSLineIcon } from '@auroraAssets/icons/arrow_right_s_line_icon';
5
+ import './breadcrumbs_types';
6
+ import { CSS_ICON_COLOR_TOKENS_VALUES } from '@auroraConstants/css_tokens/css_icon_color_tokens';
7
+ export const Breadcrumbs = ({ classname, as = 'nav', children, attributes, withoutSeparator = false }) => {
8
+ const breadcrumbRef = useRef(null);
9
+ const allItems = React.Children.toArray(children).map((child, index) => (React.createElement(BreadcrumbChild, { attributes: {
10
+ 'data-test-breadcrumb-index': index
11
+ }, key: `child-${index}` }, child)));
12
+ useEffect(() => {
13
+ if (!breadcrumbRef.current || !attributes)
14
+ return;
15
+ Object.entries(attributes).forEach(([key, value]) => {
16
+ breadcrumbRef.current?.setAttribute(key, value);
17
+ });
18
+ }, []);
19
+ return React.createElement(as, {
20
+ className: classname
21
+ }, React.createElement(Stack, { ref: breadcrumbRef, attributes: {
22
+ 'aria-label': 'breadcrumbs'
23
+ }, align: "center", as: "ol", spacing: "1" }, withoutSeparator
24
+ ? allItems
25
+ : allItems.map((item, index) => {
26
+ if (index === allItems.length - 1)
27
+ return item;
28
+ return (React.createElement(React.Fragment, { key: index },
29
+ item,
30
+ React.createElement("li", { "aria-hidden": "true" },
31
+ React.createElement(ArrowRightSLineIcon, { size: 16, color: CSS_ICON_COLOR_TOKENS_VALUES.subtle }))));
32
+ })));
33
+ };
34
+ export default Breadcrumbs;
35
+ //# sourceMappingURL=breadcrumbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../../../../../src/components/breadcrumbs/breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAkC,qBAAqB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAEjG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,GAAG,KAAK,EAAqB,EAAE,EAAE;IACxH,MAAM,aAAa,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACpE,oBAAC,eAAe,IACZ,UAAU,EAAE;YACR,4BAA4B,EAAE,KAAK;SACtC,EACD,GAAG,EAAE,SAAS,KAAK,EAAE,IAEpB,KAAK,CACQ,CACrB,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,UAAU;YAAE,OAAO;QAElD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAChD,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,KAAK,CAAC,aAAa,CACtB,EAAE,EACF;QACI,SAAS,EAAE,SAAS;KACvB,EACD,oBAAC,KAAK,IACF,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE;YACR,YAAY,EAAE,aAAa;SAC9B,EACD,KAAK,EAAC,QAAQ,EACd,EAAE,EAAC,IAAI,EACP,OAAO,EAAC,GAAG,IAEV,gBAAgB;QACb,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACzB,IAAI,KAAK,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE/C,OAAO,CACH,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK;gBACrB,IAAI;gBACL,2CAAgB,MAAM;oBAClB,oBAAC,mBAAmB,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,4BAA4B,CAAC,MAAM,GAAI,CAC5E,CACQ,CACpB,CAAC;QACN,CAAC,CAAC,CACJ,CACX,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export declare type TBreadcrumbsProps = React.PropsWithChildren<{
3
+ withoutSeparator?: boolean;
4
+ classname?: string;
5
+ as?: string;
6
+ attributes?: Record<string, any>;
7
+ }>;
8
+ export declare type TBreadcrumbChildProps = React.PropsWithChildren<{
9
+ attributes?: Record<string, any>;
10
+ }>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=breadcrumbs_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs_types.js","sourceRoot":"","sources":["../../../../../../../src/components/breadcrumbs/breadcrumbs_types.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export interface IControlProps {
3
3
  children: React.ReactNode;
4
4
  classname?: string;
5
5
  }
6
+ export declare type TControlErrors = string | string[] | null;
@@ -1,2 +1,2 @@
1
- import "react";
1
+ import 'react';
2
2
  //# sourceMappingURL=control_types.js.map
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export declare const ControlsGroup: ({ children }: PropsWithChildren) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import 'react';
2
+ import { Stack } from '@auroraComponents/stack/stack';
3
+ import React from 'react';
4
+ export const ControlsGroup = ({ children }) => {
5
+ return (React.createElement(Stack, { spacing: "4", direction: "column" }, children));
6
+ };
7
+ //# sourceMappingURL=controls_group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls_group.js","sourceRoot":"","sources":["../../../../../../../../src/components/controls/controls_group/controls_group.tsx"],"names":[],"mappings":"AAAA,OAAkC,OAAO,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC7D,OAAO,CACH,oBAAC,KAAK,IAAC,OAAO,EAAC,GAAG,EAAC,SAAS,EAAC,QAAQ,IAChC,QAAQ,CACL,CACX,CAAC;AACN,CAAC,CAAC"}
@@ -6,7 +6,7 @@ import { ErrorList } from '../../error_list/error_list.js';
6
6
  import { Control } from '../../control/control.js';
7
7
  import { Input } from '../../input/input.js';
8
8
 
9
- var _excluded = ["id", "name", "label", "helperText", "preElement", "postElement", "errors", "disabled", "defaultValue", "value", "placeholder", "readOnly", "type", "onChange", "onKeyDown", "onKeyUp"];
9
+ var _excluded = ["id", "name", "label", "helperText", "preElement", "postElement", "errors", "disabled", "defaultValue", "value", "placeholder", "readOnly", "type", "required", "tooltip", "onChange", "onKeyDown", "onKeyUp"];
10
10
  var InputControl = function InputControl(_ref) {
11
11
  var id = _ref.id,
12
12
  name = _ref.name,
@@ -21,6 +21,8 @@ var InputControl = function InputControl(_ref) {
21
21
  placeholder = _ref.placeholder,
22
22
  readOnly = _ref.readOnly,
23
23
  type = _ref.type,
24
+ required = _ref.required,
25
+ tooltip = _ref.tooltip,
24
26
  onChange = _ref.onChange,
25
27
  onKeyDown = _ref.onKeyDown,
26
28
  onKeyUp = _ref.onKeyUp,
@@ -29,6 +31,9 @@ var InputControl = function InputControl(_ref) {
29
31
  classname: "aurora-flex-col"
30
32
  }, label && (/*#__PURE__*/React__default.createElement(Label, {
31
33
  htmlFor: id,
34
+ required: required,
35
+ tooltip: tooltip,
36
+ disabled: disabled,
32
37
  className: "aurora-pb-1 aurora-text"
33
38
  }, label)), /*#__PURE__*/React__default.createElement(Input, _objectSpread2({
34
39
  id: id,
@@ -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;"}
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;"}
@@ -4,4 +4,5 @@ export declare type TInputControlProps = TInputProps & {
4
4
  label?: string | React.ReactNode;
5
5
  helperText?: string | React.ReactNode;
6
6
  errors?: string | string[];
7
+ tooltip?: string | React.ReactNode;
7
8
  };
@@ -38,7 +38,8 @@ var SwitchControl = function SwitchControl(_ref) {
38
38
  className: "aurora-ml-2 aurora-mt-1 aurora-flex aurora-flex-col aurora-gap-1"
39
39
  }, label && (/*#__PURE__*/React__default.createElement(Label, {
40
40
  required: required,
41
- tooltip: tooltip
41
+ tooltip: tooltip,
42
+ disabled: disabled
42
43
  }, label)), helperText && /*#__PURE__*/React__default.createElement(HelperText, null, helperText), errors && /*#__PURE__*/React__default.createElement(ErrorList, {
43
44
  errors: errors
44
45
  })));
@@ -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;"}
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;"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TTextAreaControlProps } from './text_area_control_types';
3
+ export declare const TextAreaControl: React.FC<TTextAreaControlProps>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Label } from '@auroraComponents/label/label';
3
+ import { ErrorList } from '@auroraComponents/error_list/error_list';
4
+ import { Control } from '@auroraComponents/control/control';
5
+ import classnames from 'classnames';
6
+ import './text_area_control_types';
7
+ import { TextArea } from '@auroraComponents/text_area/text_area';
8
+ import { HelperText } from '@auroraComponents/helper_text/helper_text';
9
+ export const TextAreaControl = ({ id, name, label, errors, placeholder, disabled, readOnly, value, defaultValue, helperText, required = false, tooltip, onChange, ...props }) => {
10
+ return (React.createElement(Control, { classname: "aurora-flex aurora-flex-col aurora-gap-2" },
11
+ label && (React.createElement(Label, { htmlFor: id, required: required, tooltip: tooltip, disabled: disabled, className: classnames('aurora-text-base aurora-text aurora-font-medium', disabled && 'aurora-text-subtle-light') }, label)),
12
+ React.createElement(TextArea, { id: id, name: name, placeholder: placeholder, value: value, defaultValue: defaultValue, disabled: disabled, readOnly: readOnly, errors: errors, onChange: onChange, ...props }),
13
+ helperText && React.createElement(HelperText, null, helperText),
14
+ errors && React.createElement(ErrorList, { errors: errors })));
15
+ };
16
+ TextAreaControl.displayName = 'TextAreaControl';
17
+ //# sourceMappingURL=text_area_control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text_area_control.js","sourceRoot":"","sources":["../../../../../../../../src/components/controls/text_area_control/text_area_control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAsC,2BAA2B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAoC,CAAC,EAC7D,EAAE,EACF,IAAI,EACJ,KAAK,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE;IACD,OAAO,CACH,oBAAC,OAAO,IAAC,SAAS,EAAC,0CAA0C;QACxD,KAAK,IAAI,CACN,oBAAC,KAAK,IAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,iDAAiD,EAAE,QAAQ,IAAI,0BAA0B,CAAC,IACzL,KAAK,CACF,CACX;QAED,oBAAC,QAAQ,IACL,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,KACd,KAAK,GACX;QACD,UAAU,IAAI,oBAAC,UAAU,QAAE,UAAU,CAAc;QACnD,MAAM,IAAI,oBAAC,SAAS,IAAC,MAAM,EAAE,MAAM,GAAI,CAClC,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TTextAreaProps } from "../../text_area/text_area_types";
2
+ import React from "react";
3
+ export interface TTextAreaControlProps extends TTextAreaProps {
4
+ label?: string | React.ReactNode;
5
+ errors?: string | string[];
6
+ helperText?: string | React.ReactNode;
7
+ tooltip?: string | React.ReactNode;
8
+ }
@@ -0,0 +1,3 @@
1
+ import "@auroraComponents/text_area/text_area_types";
2
+ import "react";
3
+ //# sourceMappingURL=text_area_control_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text_area_control_types.js","sourceRoot":"","sources":["../../../../../../../../src/components/controls/text_area_control/text_area_control_types.ts"],"names":[],"mappings":"AAAA,OAA+B,6CAA6C,CAAC;AAC7E,OAAkB,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IXhrImagePickerControl } from './xhr_image_picker_control_types';
3
+ export declare const XhrImagePickerControl: React.FC<IXhrImagePickerControl>;
@@ -0,0 +1,24 @@
1
+ import React, { useState } from 'react';
2
+ import { Control } from '@auroraComponents/control/control';
3
+ import { Label } from '@auroraComponents/label/label';
4
+ import { ErrorList } from '@auroraComponents/error_list/error_list';
5
+ import '@auroraComponents/control/control_types';
6
+ import './xhr_image_picker_control_types';
7
+ import { XhrImagePicker } from '@auroraComponents/xhr_image_picker/xhr_image_picker';
8
+ import '@auroraComponents/image_picker/image_picker_types';
9
+ export const XhrImagePickerControl = ({ url, label, required, id, name, onChange, allowedExtensions, initialFile, className, errors, tooltip, onUploaded, onImageSizeUpdated, ImageEditor }) => {
10
+ const [, setErrors] = useState(errors);
11
+ const handleControlError = (errors) => {
12
+ setErrors(errors);
13
+ };
14
+ const handleControlChange = (file) => {
15
+ const { fileList, fileAsDataUrl } = file;
16
+ setErrors(null);
17
+ onChange?.({ fileList, fileAsDataUrl });
18
+ };
19
+ return (React.createElement(Control, { classname: "aurora-flex-col" },
20
+ label && (React.createElement(Label, { htmlFor: id, required: required, tooltip: tooltip }, label)),
21
+ React.createElement(XhrImagePicker, { url: url, id: id, name: name, onChange: handleControlChange, onError: handleControlError, allowedExtensions: allowedExtensions, initialFile: initialFile, className: className, errors: errors, onUploaded: onUploaded, onImageSizeUpdated: onImageSizeUpdated, ImageEditor: ImageEditor }),
22
+ errors && React.createElement(ErrorList, { errors: errors })));
23
+ };
24
+ //# sourceMappingURL=xhr_image_picker_control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xhr_image_picker_control.js","sourceRoot":"","sources":["../../../../../../../../src/components/controls/xhr_image_picker_control/xhr_image_picker_control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAA+B,yCAAyC,CAAC;AACzE,OAAuC,kCAAkC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAuC,mDAAmD,CAAC;AAE3F,MAAM,CAAC,MAAM,qBAAqB,GAAqC,CAAC,EACpE,GAAG,EACH,KAAK,EACL,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,MAAM,EACN,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,WAAW,EACd,EAAE,EAAE;IACD,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAwB,MAA+B,CAAC,CAAC;IAEvF,MAAM,kBAAkB,GAAG,CAAC,MAAgB,EAAE,EAAE;QAC5C,SAAS,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,CAAC,IAA4B,EAAE,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;QACzC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEhB,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC;IAEF,OAAO,CACH,oBAAC,OAAO,IAAC,SAAS,EAAC,iBAAiB;QAC/B,KAAK,IAAI,CACN,oBAAC,KAAK,IAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,IACnD,KAAK,CACF,CACX;QACD,oBAAC,cAAc,IACX,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,WAAW,GAC1B;QACD,MAAM,IAAI,oBAAC,SAAS,IAAC,MAAM,EAAE,MAAM,GAAI,CAClC,CACb,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { TControlErrors } from "../../control/control_types";
2
+ import { IImagePicker, IUseFilePickerOnChange, TImageSize } from "../../image_picker/image_picker_types";
3
+ import { TUploadedImageData } from "../../xhr_image_picker/xhr_image_picker_types";
4
+ import { ReactNode } from 'react';
5
+ export interface IXhrImagePickerControl extends IImagePicker {
6
+ url: string;
7
+ label?: string;
8
+ onChange?: (file: IUseFilePickerOnChange, size?: TImageSize) => void;
9
+ labelAdditionalInfo?: string | ReactNode;
10
+ onUploaded?: (data: TUploadedImageData) => void;
11
+ ImageEditor?: React.FunctionComponent;
12
+ errors?: TControlErrors;
13
+ required?: boolean;
14
+ tooltip?: string | ReactNode;
15
+ }
@@ -0,0 +1,5 @@
1
+ import '@auroraComponents/control/control_types';
2
+ import '@auroraComponents/image_picker/image_picker_types';
3
+ import '@auroraComponents/xhr_image_picker/xhr_image_picker_types';
4
+ import 'react';
5
+ //# sourceMappingURL=xhr_image_picker_control_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xhr_image_picker_control_types.js","sourceRoot":"","sources":["../../../../../../../../src/components/controls/xhr_image_picker_control/xhr_image_picker_control_types.ts"],"names":[],"mappings":"AAAA,OAA+B,yCAAyC,CAAC;AACzE,OAAiE,mDAAmD,CAAC;AACrH,OAAmC,2DAA2D,CAAC;AAC/F,OAA0B,OAAO,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const ImagePickerInput: React.FC<{
3
+ id: string;
4
+ onDropFile: (event: React.DragEvent<HTMLLabelElement>) => void;
5
+ onDragOver: (event: React.DragEvent<HTMLLabelElement>) => void;
6
+ onDragLeave: (event: React.DragEvent<HTMLLabelElement>) => void;
7
+ allowedExtensions: string[];
8
+ isDragOver: boolean;
9
+ }>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { UploadLineIcon } from '@auroraAssets/icons/upload_icon';
4
+ import { cn } from '@auroraUtilities/cn';
5
+ export const ImagePickerInput = ({ id, onDropFile, onDragOver, onDragLeave, allowedExtensions, isDragOver }) => {
6
+ const [t] = useTranslation();
7
+ return (React.createElement("label", { htmlFor: id, onDrop: onDropFile, onDragOver: onDragOver, onDragLeave: onDragLeave, className: "aurora-relative aurora-flex aurora-items-center aurora-justify-center aurora-w-full aurora-h-full aurora-cursor-pointer aurora-p-1 aurora-pb-2 aurora-group" },
8
+ isDragOver && (React.createElement("div", { className: cn('aurora-absolute aurora-inset-0 aurora-bg-neutral-0 aurora-border-2 aurora-border-primary aurora-rounded-8 aurora-z-1 aurora-pointer-events-none') },
9
+ React.createElement("div", { className: " aurora-w-full aurora-h-full aurora-bg-primary-transparent aurora-flex aurora-items-center aurora-justify-center" },
10
+ React.createElement("span", { className: "aurora-text-xs aurora-text-interactive" }, `${t('Drop file here')}`)))),
11
+ React.createElement("div", { className: cn('aurora-flex aurora-flex-col aurora-items-center aurora-w-full aurora-h-full aurora-pt-4 aurora-pb-3 aurora-px-1') },
12
+ React.createElement(UploadLineIcon, { className: "aurora-w-5 aurora-h-5 aurora-fill-subtle group-hover:aurora-fill-primary aurora-mb-2" }),
13
+ React.createElement("div", { className: "aurora-text-xs aurora-text-interactive aurora-font-semibold" }, `${t('Drag a file here or browse')}`),
14
+ React.createElement("span", { className: "aurora-text-xs aurora-text-subtle-light aurora-font-normal aurora-text-center" },
15
+ `${t('supported format')}`,
16
+ ": ",
17
+ allowedExtensions.map((extension) => `*.${extension}`).join(', ')))));
18
+ };
19
+ //# sourceMappingURL=image_picker_input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_picker_input.js","sourceRoot":"","sources":["../../../../../../../../src/components/image_picker/components/image_picker_input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAOxB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,EAAE,EAAE;IAChF,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAE7B,OAAO,CACH,+BACI,OAAO,EAAE,EAAE,EACX,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAC,6JAA6J;QAEtK,UAAU,IAAI,CACX,6BACI,SAAS,EAAE,EAAE,CACT,iJAAiJ,CACpJ;YAED,6BAAK,SAAS,EAAC,kHAAkH;gBAC7H,8BAAM,SAAS,EAAC,wCAAwC,IAAE,GAAG,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAQ,CACxF,CACJ,CACT;QAED,6BACI,SAAS,EAAE,EAAE,CAAC,iHAAiH,CAAC;YAEhI,oBAAC,cAAc,IAAC,SAAS,EAAC,sFAAsF,GAAG;YACnH,6BAAK,SAAS,EAAC,6DAA6D,IAAE,GAAG,CAAC,CAAC,4BAA4B,CAAC,EAAE,CAAO;YACzH,8BAAM,SAAS,EAAC,+EAA+E;gBAC1F,GAAG,CAAC,CAAC,kBAAkB,CAAC,EAAE;;gBAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC7F,CACL,CACF,CACX,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { TImagePickerFile } from '../image_picker_types';
3
+ declare type TImagePickerPreviewProps = {
4
+ file: TImagePickerFile;
5
+ onError: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
6
+ onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
7
+ };
8
+ export declare const ImagePickerPreview: ({ file, onError, onLoad }: TImagePickerPreviewProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import '../image_picker_types';
3
+ export const ImagePickerPreview = ({ file, onError, onLoad }) => {
4
+ return (React.createElement("img", { className: "aurora-rounded-4 aurora-w-full aurora-h-full", alt: file.fileName, src: file?.fileUrl || '', onError: onError, onLoad: onLoad }));
5
+ };
6
+ //# sourceMappingURL=image_picker_preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_picker_preview.js","sourceRoot":"","sources":["../../../../../../../../src/components/image_picker/components/image_picker_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAiC,uBAAuB,CAAC;AAQzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAA4B,EAAE,EAAE;IACtF,OAAO,CACH,6BACI,SAAS,EAAC,8CAA8C,EACxD,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,GAAG,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE,EACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GAChB,CACL,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ declare type TUploadedImagePickerItemProps = {
3
+ file: any;
4
+ isValid: boolean;
5
+ imageSize: any;
6
+ onFileDelete: () => void;
7
+ };
8
+ export declare const UploadedImagePickerItem: ({ imageSize, onFileDelete, isValid, file }: TUploadedImagePickerItemProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,19 @@
1
+ import { DeleteBinLineIcon } from '@auroraAssets/icons/delete_bin_icon';
2
+ import { FileUtils } from '@dreamcommerce/utilities';
3
+ import React from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ export const UploadedImagePickerItem = ({ imageSize, onFileDelete, isValid, file }) => {
6
+ const [t] = useTranslation();
7
+ const imageName = FileUtils.getFileName(file.fileName);
8
+ const imageExtension = FileUtils.getFileExtension(file.fileName);
9
+ const imageWidth = imageSize && imageSize.width;
10
+ const imageHeight = imageSize && imageSize.height;
11
+ return (React.createElement("div", { className: 'aurora-flex aurora-justify-between aurora-items-center aurora-pt-2 aurora-px-1 aurora-gap-1' },
12
+ React.createElement("div", { className: 'aurora-text-xs aurora-text-subtle aurora-overflow-hidden aurora-text-ellipsis' }, isValid && (React.createElement(React.Fragment, null,
13
+ imageName,
14
+ `.${imageExtension} (${imageWidth}x${imageHeight}px)`))),
15
+ React.createElement("button", { "data-test-id": "image-picker-remove-button", onClick: onFileDelete, className: 'aurora-flex aurora-items-center aurora-gap-1 aurora-border aurora-border-danger aurora-rounded-full aurora-px-3 aurora-py-[6px]' },
16
+ React.createElement(DeleteBinLineIcon, { className: "aurora-w-4 aurora-h-4 aurora-fill-danger" }),
17
+ React.createElement("span", { className: 'aurora-text-xs aurora-text-danger aurora-font-semibold' }, `${t('Remove')}`))));
18
+ };
19
+ //# sourceMappingURL=uploaded_image_picker_item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploaded_image_picker_item.js","sourceRoot":"","sources":["../../../../../../../../src/components/image_picker/components/uploaded_image_picker_item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAS/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAiC,EAAE,EAAE;IACjH,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC;IAChD,MAAM,WAAW,GAAG,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC;IAElD,OAAO,CACH,6BAAK,SAAS,EAAC,6FAA6F;QACxG,6BAAK,SAAS,EAAC,+EAA+E,IACzF,OAAO,IAAI,CACR;YACK,SAAS;YACT,IAAI,cAAc,KAAK,UAAU,IAAI,WAAW,KAAK,CACvD,CACN,CACC;QAEN,gDAAqB,4BAA4B,EAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAC,iIAAiI;YAChN,oBAAC,iBAAiB,IAAC,SAAS,EAAC,0CAA0C,GAAG;YAC1E,8BAAM,SAAS,EAAC,wDAAwD,IAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAQ,CAC7F,CACP,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IImagePicker } from './image_picker_types';
3
+ export declare const ImagePicker: React.FC<IImagePicker>;
@@ -0,0 +1,76 @@
1
+ import React, { createRef, memo, useEffect, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { ErrorList } from '@auroraComponents/error_list/error_list';
4
+ import { ImagePickerPreview } from './components/image_picker_preview';
5
+ import { IMAGE_PICKER_EXTENSIONS } from './image_picker_constants';
6
+ import './image_picker_types';
7
+ import { ImagePickerInput } from './components/image_picker_input';
8
+ import { UploadedImagePickerItem } from './components/uploaded_image_picker_item';
9
+ import { getAcceptFilesParametersFromAllowedExtensions } from './image_picker_utils';
10
+ import { useImagePicker } from './use_image_picker';
11
+ import { cn } from '@auroraUtilities/cn';
12
+ export const ImagePicker = memo(({ id, onChange, onError, errors: initialErrors, allowedExtensions = [
13
+ IMAGE_PICKER_EXTENSIONS.WEBP,
14
+ IMAGE_PICKER_EXTENSIONS.JPG,
15
+ IMAGE_PICKER_EXTENSIONS.PNG,
16
+ IMAGE_PICKER_EXTENSIONS.GIF,
17
+ IMAGE_PICKER_EXTENSIONS.SVG,
18
+ IMAGE_PICKER_EXTENSIONS.JPEG
19
+ ], initialFile, name, onImageSizeUpdated, topButtons, editedImageResult }) => {
20
+ const [t] = useTranslation();
21
+ const inputRef = createRef();
22
+ const handleOnChange = (ev) => {
23
+ onChange?.(ev);
24
+ if (ev.fileList?.length) {
25
+ setImageSizeBasedOnUrl(URL.createObjectURL(ev.fileList[0]));
26
+ }
27
+ };
28
+ const { onDropFile, onFileChange, onDragOver, onDragLeave, onFileDelete, onPreviewError, changeFile, file, errors, isPreview, isDragOver } = useImagePicker({ initialFile, onChange: handleOnChange, allowedExtensions, initialErrors, onError, inputRef });
29
+ const [imageSize, setImageSize] = useState(undefined);
30
+ const acceptFiles = getAcceptFilesParametersFromAllowedExtensions(allowedExtensions);
31
+ useEffect(() => {
32
+ onImageSizeUpdated?.(imageSize);
33
+ }, [imageSize]);
34
+ useEffect(() => {
35
+ initialFile && setImageSizeBasedOnUrl(initialFile?.fileUrl);
36
+ }, [initialFile]);
37
+ useEffect(() => {
38
+ if (!editedImageResult)
39
+ return;
40
+ const fileList = createFileList(editedImageResult);
41
+ changeFile(fileList);
42
+ }, [editedImageResult]);
43
+ const createFileList = (file) => {
44
+ const fileArray = [];
45
+ fileArray.push(file);
46
+ return fileArray;
47
+ };
48
+ const setImageSizeBasedOnUrl = (fileUrl) => {
49
+ createImageFromUrl(fileUrl).then((image) => {
50
+ setImageSize({ width: image.naturalWidth, height: image.naturalHeight });
51
+ });
52
+ };
53
+ const createImageFromUrl = async (url) => {
54
+ const img = new Image();
55
+ img.src = url;
56
+ await img.decode();
57
+ return img;
58
+ };
59
+ const handleOnFileDelete = () => {
60
+ onFileDelete();
61
+ setImageSize(undefined);
62
+ };
63
+ return (React.createElement("div", { className: "aurora-mb-1" },
64
+ React.createElement("div", { className: cn('aurora-rounded-8 aurora-relative hover:aurora-border-active', {
65
+ 'aurora-border aurora-border-dashed': !(errors && errors.length > 0 && !isDragOver),
66
+ 'aurora-border-2 aurora-border-danger aurora-border-solid hover:aurora-border-danger': errors && errors.length > 0,
67
+ 'aurora-border-none': isDragOver
68
+ }) },
69
+ file && !errors?.length ? (isPreview ? (React.createElement("div", { className: "aurora-p-1 aurora-pb-2 aurora-relative" },
70
+ topButtons && React.createElement("div", null, topButtons),
71
+ React.createElement(ImagePickerPreview, { file: file, onError: onPreviewError }),
72
+ React.createElement(UploadedImagePickerItem, { imageSize: imageSize, file: file, isValid: !errors?.length, onFileDelete: handleOnFileDelete }))) : (React.createElement("div", null, `${t('No preview')}`))) : (React.createElement(ImagePickerInput, { onDragLeave: onDragLeave, onDragOver: onDragOver, isDragOver: isDragOver, allowedExtensions: allowedExtensions, id: id, onDropFile: onDropFile })),
73
+ React.createElement("input", { className: "aurora-hidden", onChange: onFileChange, id: id, ref: inputRef, type: "file", name: name, accept: acceptFiles })),
74
+ errors && React.createElement(ErrorList, { errors: errors })));
75
+ });
76
+ //# sourceMappingURL=image_picker.js.map