mautourco-components 0.2.32 → 0.2.34

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 (26) hide show
  1. package/dist/components/atoms/Inputs/Input/Input.d.ts +1 -0
  2. package/dist/components/atoms/Inputs/Input/Input.js +2 -2
  3. package/dist/components/atoms/SelectedValue/SelectedValue.d.ts +3 -1
  4. package/dist/components/atoms/SelectedValue/SelectedValue.js +3 -3
  5. package/dist/components/molecules/Toast/Toast.d.ts +2 -0
  6. package/dist/components/molecules/Toast/Toast.js +2 -2
  7. package/dist/components/organisms/DialogQuoteRename/DialogQuoteRename.d.ts +7 -0
  8. package/dist/components/organisms/DialogQuoteRename/DialogQuoteRename.js +14 -0
  9. package/dist/components/organisms/DialogSendingMail/DialogSendingMail.d.ts +2 -1
  10. package/dist/components/organisms/DialogSendingMail/DialogSendingMail.js +3 -1
  11. package/dist/components/organisms/DialogSendingMail/DialogSendingMailContent.js +1 -1
  12. package/dist/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.css +2088 -0
  13. package/dist/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.d.ts +17 -0
  14. package/dist/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.js +115 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/styles/components/selected-value.css +18 -6
  17. package/package.json +1 -1
  18. package/src/components/atoms/Inputs/Input/Input.tsx +3 -0
  19. package/src/components/atoms/SelectedValue/SelectedValue.tsx +15 -12
  20. package/src/components/molecules/Toast/Toast.tsx +8 -3
  21. package/src/components/organisms/DialogQuoteRename/DialogQuoteRename.tsx +48 -0
  22. package/src/components/organisms/DialogSendingMail/DialogSendingMail.tsx +3 -1
  23. package/src/components/organisms/DialogSendingMail/DialogSendingMailContent.tsx +1 -0
  24. package/src/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.css +7 -0
  25. package/src/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.tsx +143 -0
  26. package/src/styles/components/selected-value.css +17 -6
@@ -12,6 +12,7 @@ export interface InputProps {
12
12
  icon?: IconName;
13
13
  iconPosition?: 'leading' | 'trailing';
14
14
  type?: HTMLInputTypeAttribute;
15
+ id?: string;
15
16
  }
16
17
  declare const Input: React.FC<InputProps>;
17
18
  export default Input;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Icon from '../../Icon/Icon';
3
3
  var Input = function (_a) {
4
- var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? 'Input text' : _c, value = _a.value, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.className, className = _e === void 0 ? '' : _e, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, icon = _a.icon, _f = _a.iconPosition, iconPosition = _f === void 0 ? 'trailing' : _f, _g = _a.type, type = _g === void 0 ? 'text' : _g;
4
+ var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? 'Input text' : _c, value = _a.value, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.className, className = _e === void 0 ? '' : _e, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, icon = _a.icon, _f = _a.iconPosition, iconPosition = _f === void 0 ? 'trailing' : _f, _g = _a.type, type = _g === void 0 ? 'text' : _g, id = _a.id;
5
5
  var baseClasses = 'input-field';
6
6
  var variantClasses = {
7
7
  default: 'input-field--default',
@@ -11,6 +11,6 @@ var Input = function (_a) {
11
11
  disabled: 'input-field--disabled',
12
12
  };
13
13
  var inputClasses = "".concat(baseClasses, " ").concat(variantClasses[variant], " ").concat(icon ? "input-field--with-icon input-field--icon-".concat(iconPosition) : '', " ").concat(className).trim();
14
- return (_jsxs("div", { className: "input-wrapper ".concat(icon ? 'input-wrapper--with-icon' : '').trim(), children: [icon && iconPosition === 'leading' && (_jsx("span", { className: "input-icon input-icon--leading", children: _jsx(Icon, { name: icon, size: "sm" }) })), _jsx("input", { type: type, className: inputClasses, placeholder: placeholder, value: value, disabled: disabled || variant === 'disabled', onChange: onChange, onFocus: onFocus, onBlur: onBlur }), icon && iconPosition === 'trailing' && (_jsx("span", { className: "input-icon input-icon--trailing", children: _jsx(Icon, { name: icon, size: "sm" }) }))] }));
14
+ return (_jsxs("div", { className: "input-wrapper ".concat(icon ? 'input-wrapper--with-icon' : '').trim(), children: [icon && iconPosition === 'leading' && (_jsx("span", { className: "input-icon input-icon--leading", children: _jsx(Icon, { name: icon, size: "sm" }) })), _jsx("input", { id: id, type: type, className: inputClasses, placeholder: placeholder, value: value, disabled: disabled || variant === 'disabled', onChange: onChange, onFocus: onFocus, onBlur: onBlur }), icon && iconPosition === 'trailing' && (_jsx("span", { className: "input-icon input-icon--trailing", children: _jsx(Icon, { name: icon, size: "sm" }) }))] }));
15
15
  };
16
16
  export default Input;
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  interface SelectedValueProps {
3
3
  value: string;
4
- onRemove?: () => void;
5
4
  className?: string;
6
5
  iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
6
  size?: 'xs' | 'sm' | 'md' | 'lg';
8
7
  variant?: 'filled' | 'text';
8
+ color?: 'accent' | 'neutral';
9
+ onRemove?: () => void;
10
+ onSelect?: () => void;
9
11
  }
10
12
  declare const SelectedValue: React.FC<SelectedValueProps>;
11
13
  export default SelectedValue;
@@ -2,17 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Icon from '../Icon/Icon';
3
3
  import { Text } from '../Typography/Typography';
4
4
  var SelectedValue = function (_a) {
5
- var value = _a.value, onRemove = _a.onRemove, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.iconSize, iconSize = _c === void 0 ? 'xs' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'filled' : _e;
5
+ var value = _a.value, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.iconSize, iconSize = _c === void 0 ? 'xs' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.variant, variant = _e === void 0 ? 'filled' : _e, _f = _a.color, color = _f === void 0 ? 'accent' : _f, onRemove = _a.onRemove, onSelect = _a.onSelect;
6
6
  var handleRemove = function (event) {
7
7
  event.stopPropagation();
8
8
  if (onRemove) {
9
9
  onRemove();
10
10
  }
11
11
  };
12
- var classes = "selected-value selected-value--".concat(size, " selected-value--").concat(variant, " ").concat(className).trim();
12
+ var classes = "selected-value selected-value--".concat(size, " selected-value--").concat(color, " selected-value--").concat(variant, " ").concat(className, " ").concat(onSelect ? 'cursor-pointer' : '').trim();
13
13
  var getTextSize = function () {
14
14
  return size; // Utilise directement la taille passée en prop
15
15
  };
16
- return (_jsxs("div", { className: classes, children: [_jsx(Text, { size: getTextSize(), variant: "medium", leading: "4", className: "selected-value__text", children: value }), variant !== 'text' && onRemove && (_jsx("button", { type: "button", className: "selected-value__remove", onClick: handleRemove, "aria-label": "Remove ".concat(value), children: _jsx(Icon, { name: "close", size: iconSize, className: "selected-value__remove-icon" }) }))] }));
16
+ return (_jsxs("div", { className: classes, onClick: onSelect, children: [_jsx(Text, { size: getTextSize(), variant: "medium", leading: "4", className: "selected-value__text", children: value }), variant !== 'text' && onRemove && (_jsx("button", { type: "button", className: "selected-value__remove", onClick: handleRemove, "aria-label": "Remove ".concat(value), children: _jsx(Icon, { name: "close", size: iconSize, className: "selected-value__remove-icon" }) }))] }));
17
17
  };
18
18
  export default SelectedValue;
@@ -11,6 +11,8 @@ export interface ToastProps {
11
11
  className?: string;
12
12
  /** Icon name */
13
13
  iconName?: IconName;
14
+ /** Show icon */
15
+ showIcon?: boolean;
14
16
  }
15
17
  /**
16
18
  * Toast component - A brief, auto-dismissing message that appears to notify the user.
@@ -12,7 +12,7 @@ import { Text } from '../../atoms/Typography/Typography';
12
12
  * @returns
13
13
  */
14
14
  var Toast = function (_a) {
15
- var text = _a.text, _b = _a.type, type = _b === void 0 ? 'informational' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.iconName, iconName = _d === void 0 ? 'badge-alert' : _d;
16
- return (_jsx("div", { className: "toast toast--".concat(type, " ").concat(className).trim(), children: _jsxs("div", { className: "toast__container", children: [_jsx("div", { className: "toast__icon-wrapper", children: _jsx(Icon, { name: iconName, size: "md", className: "toast__icon" }) }), _jsx(Text, { size: "sm", variant: "bold", leading: "5", className: "toast__text", children: text })] }) }));
15
+ var text = _a.text, _b = _a.type, type = _b === void 0 ? 'informational' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.iconName, iconName = _d === void 0 ? 'badge-alert' : _d, _e = _a.showIcon, showIcon = _e === void 0 ? true : _e;
16
+ return (_jsx("div", { className: "toast toast--".concat(type, " ").concat(className).trim(), children: _jsxs("div", { className: "toast__container", children: [showIcon && (_jsx("div", { className: "toast__icon-wrapper", children: _jsx(Icon, { name: iconName, size: "md", className: "toast__icon" }) })), _jsx(Text, { size: "sm", variant: "bold", leading: "5", className: "toast__text", children: text })] }) }));
17
17
  };
18
18
  export default Toast;
@@ -0,0 +1,7 @@
1
+ export interface DialogQuoteRenameProps {
2
+ open: boolean;
3
+ setOpen: (open: boolean) => void;
4
+ quoteName: string;
5
+ onSubmit: (quoteName: string) => void;
6
+ }
7
+ export declare const DialogQuoteRename: (props: DialogQuoteRenameProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import Button from '../../atoms/Button/Button';
4
+ import Input from '../../atoms/Inputs/Input/Input';
5
+ import { Text } from '../../atoms/Typography/Typography';
6
+ import { DialogBookingConfirm } from '../DialogBookingConfirm';
7
+ export var DialogQuoteRename = function (props) {
8
+ var open = props.open, setOpen = props.setOpen, quoteName = props.quoteName, onSubmit = props.onSubmit;
9
+ var _a = useState(quoteName), value = _a[0], setValue = _a[1];
10
+ var handleQuoteNameChange = function (e) {
11
+ setValue(e.target.value);
12
+ };
13
+ return (_jsx(DialogBookingConfirm, { open: open, setOpen: setOpen, title: "Rename Quotation", className: "!max-w-[500px]", children: _jsxs("div", { className: "space-y-9", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "quote-name", children: _jsx(Text, { as: "span", size: "sm", children: "Quotation name" }) }), _jsx(Input, { id: "quote-name", value: value, onChange: handleQuoteNameChange })] }), _jsxs("div", { className: "grid grid-cols-2 gap-x-4 pb-2", children: [_jsx(Button, { variant: "outline-secondary", onClick: function () { return setOpen(false); }, size: "sm", children: "Cancel" }), _jsx(Button, { variant: "secondary", onClick: function () { return onSubmit(value); }, size: "sm", children: "Save changes" })] })] }) }));
14
+ };
@@ -7,5 +7,6 @@ export interface DialogSendingMailProps {
7
7
  }
8
8
  export declare const DialogSendingMail: {
9
9
  (props: DialogSendingMailProps): import("react/jsx-runtime").JSX.Element;
10
- Content: React.FC<import("./DialogSendingMailContent").DialogSendingMailContentProps>;
10
+ SingleQuote: React.FC<import("./DialogSendingMailContent").DialogSendingMailContentProps>;
11
+ MultipleQuotes: React.FC<import("./DialogSendingMailMultiple/DialogSendingMailMultiple").DialogSendingMailMultipleProps>;
11
12
  };
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { DialogBookingConfirm } from '../DialogBookingConfirm';
3
3
  import { DialogSendingMailContent } from './DialogSendingMailContent';
4
+ import { DialogSendingMailMultiple } from './DialogSendingMailMultiple/DialogSendingMailMultiple';
4
5
  export var DialogSendingMail = function (props) {
5
6
  var open = props.open, setOpen = props.setOpen, children = props.children, _a = props.type, type = _a === void 0 ? 'booking' : _a;
6
7
  return (_jsx(DialogBookingConfirm, { open: open, title: "Send ".concat(type, " via mail"), setOpen: setOpen, className: "!max-w-[800px]", closeOnOverlayClick: true, children: children }));
7
8
  };
8
- DialogSendingMail.Content = DialogSendingMailContent;
9
+ DialogSendingMail.SingleQuote = DialogSendingMailContent;
10
+ DialogSendingMail.MultipleQuotes = DialogSendingMailMultiple;
@@ -45,5 +45,5 @@ export var DialogSendingMailContent = function (props) {
45
45
  } }), _jsx(FormField, { control: form.control, name: "message", rules: { required: true }, render: function (_a) {
46
46
  var field = _a.field;
47
47
  return (_jsx(FormItem, { children: _jsxs("div", { className: "relative", children: [_jsx(FormControl, { children: _jsx(Textarea, __assign({ placeholder: "Write your email here... *" }, field)) }), _jsx(FormMessage, { className: "absolute bottom-0 translate-y-4" })] }) }));
48
- } }), _jsx(Button, { type: "button", size: "sm", onClick: onPreviewAttachment, children: "Preview Attachment" })] }), _jsx(Toast, { type: "warning", className: "mt-8", text: "Disclaimer: Email formatting may appear distorted in certain older email clients (e.g Outlook Classic ). Content will remain intact, but the visual layout may differ from the original" }), _jsxs("div", { className: "flex justify-end gap-4 [&>*]:w-[250px] pb-2 pt-9", children: [_jsx(Button, { type: "button", variant: "outline-secondary", size: "sm", onClick: onCancel, children: "Cancel" }), _jsx(Button, { type: "submit", variant: "secondary", size: "sm", children: "Send" })] })] }) })));
48
+ } }), _jsx(Button, { type: "button", size: "sm", onClick: onPreviewAttachment, children: "Preview Attachment" })] }), _jsx(Toast, { showIcon: false, type: "warning", className: "mt-8", text: "Disclaimer: Email formatting may appear distorted in certain older email clients (e.g Outlook Classic ). Content will remain intact, but the visual layout may differ from the original" }), _jsxs("div", { className: "flex justify-end gap-4 [&>*]:w-[250px] pb-2 pt-9", children: [_jsx(Button, { type: "button", variant: "outline-secondary", size: "sm", onClick: onCancel, children: "Cancel" }), _jsx(Button, { type: "submit", variant: "secondary", size: "sm", children: "Send" })] })] }) })));
49
49
  };