@appquality/unguess-design-system 3.1.53 → 3.1.55

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # v3.1.55 (Fri Dec 22 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - add-bug-comments-components [#280](https://github.com/AppQuality/unguess-design-system/pull/280) ([@cannarocks](https://github.com/cannarocks) [@iDome89](https://github.com/iDome89))
6
+ - Bugcomments components [#279](https://github.com/AppQuality/unguess-design-system/pull/279) ([@cannarocks](https://github.com/cannarocks) [@marcbon](https://github.com/marcbon))
7
+
8
+ #### Authors: 3
9
+
10
+ - [@iDome89](https://github.com/iDome89)
11
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
12
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
13
+
14
+ ---
15
+
16
+ # v3.1.54 (Tue Nov 14 2023)
17
+
18
+ #### 🐛 Bug Fix
19
+
20
+ - chore(styled-components): update to 6.1.1 [#278](https://github.com/AppQuality/unguess-design-system/pull/278) ([@cannarocks](https://github.com/cannarocks))
21
+
22
+ #### Authors: 1
23
+
24
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
25
+
26
+ ---
27
+
1
28
  # v3.1.53 (Thu Nov 09 2023)
2
29
 
3
30
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -644,7 +644,7 @@ const UgAvatar = styled__default["default"](reactAvatars.Avatar) `
644
644
  - To visually represent a person, brand, or product
645
645
  */
646
646
  const Avatar = (props) => {
647
- const fixedBadge = props.badge && props.badge > 9 ? "9+" : props.badge;
647
+ const fixedBadge = props.badge && Number(props.badge) > 9 ? "9+" : props.badge;
648
648
  const wrapChildren = (type) => {
649
649
  if (type === "icon")
650
650
  return props.children;
@@ -2578,6 +2578,208 @@ const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
2578
2578
  : (_a = i18n === null || i18n === void 0 ? void 0 : i18n.noItems) !== null && _a !== void 0 ? _a : "No items" }))] }), jsxRuntime.jsx(Menu, Object.assign({ isCompact: isCompact }, { children: matchingOptions.length === 0 ? (jsxRuntime.jsx(Item$1, Object.assign({ disabled: true }, { children: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.noMatches) !== null && _b !== void 0 ? _b : "No matches found" }))) : (matchingOptions.map((option) => (jsxRuntime.jsx(Item$1, Object.assign({ value: option }, option, { children: jsxRuntime.jsx("span", { children: option.label }) }), option.itemId)))) }))] })) }));
2579
2579
  };
2580
2580
 
2581
+ var _path$o;
2582
+ function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
2583
+ var SvgBoldFill = function SvgBoldFill(props) {
2584
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
2585
+ xmlns: "http://www.w3.org/2000/svg",
2586
+ width: 16,
2587
+ height: 16,
2588
+ focusable: "false",
2589
+ viewBox: "0 0 16 16"
2590
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
2591
+ fill: "currentColor",
2592
+ d: "M7.5 0C9.952 0 12 2.048 12 4.5a4.483 4.483 0 01-1.27 3.108C12.078 8.39 13 9.855 13 11.5c0 2.452-2.048 4.5-4.5 4.5H4a1 1 0 01-1-1V1a1 1 0 011-1h3.5zM5 14h3.5c1.348 0 2.5-1.152 2.5-2.5S9.848 9 8.5 9H5v5zM7.5 2H5v5h2.5C8.848 7 10 5.848 10 4.5S8.848 2 7.5 2z"
2593
+ })));
2594
+ };
2595
+
2596
+ var _path$n;
2597
+ function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
2598
+ var SvgItalicFill = function SvgItalicFill(props) {
2599
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
2600
+ xmlns: "http://www.w3.org/2000/svg",
2601
+ width: 16,
2602
+ height: 16,
2603
+ focusable: "false",
2604
+ viewBox: "0 0 16 16"
2605
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
2606
+ fill: "none",
2607
+ stroke: "currentColor",
2608
+ strokeLinecap: "round",
2609
+ strokeWidth: 2,
2610
+ d: "M8 1h3M9.5 1l-3 14M5 15h3"
2611
+ })));
2612
+ };
2613
+
2614
+ var _path$m, _path2$6;
2615
+ function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
2616
+ var SvgQuoteFill = function SvgQuoteFill(props) {
2617
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
2618
+ xmlns: "http://www.w3.org/2000/svg",
2619
+ width: 16,
2620
+ height: 16,
2621
+ focusable: "false",
2622
+ viewBox: "0 0 16 16"
2623
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
2624
+ fill: "currentColor",
2625
+ d: "M7 8H4c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1zm6 0h-3c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1z"
2626
+ })), _path2$6 || (_path2$6 = /*#__PURE__*/React__namespace.createElement("path", {
2627
+ fill: "none",
2628
+ stroke: "currentColor",
2629
+ strokeLinecap: "round",
2630
+ strokeWidth: 2,
2631
+ d: "M5.5 12C6.5 11 7 9.5 7 8V6m4.5 6c1-1 1.5-2.5 1.5-4V6"
2632
+ })));
2633
+ };
2634
+
2635
+ var _g$4;
2636
+ function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
2637
+ var SvgH1Fill = function SvgH1Fill(props) {
2638
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
2639
+ xmlns: "http://www.w3.org/2000/svg",
2640
+ width: 16,
2641
+ height: 16,
2642
+ focusable: "false",
2643
+ viewBox: "0 0 16 16"
2644
+ }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2645
+ transform: "translate(-464 -332)"
2646
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
2647
+ width: 16,
2648
+ height: 16,
2649
+ transform: "translate(464 332)",
2650
+ fill: "none"
2651
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2652
+ d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2653
+ transform: "translate(462 333.5)",
2654
+ fill: "none",
2655
+ stroke: "currentColor",
2656
+ strokeLinecap: "round",
2657
+ strokeWidth: 2
2658
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2659
+ fill: "currentColor",
2660
+ d: "M1.755,15A.731.731,0,0,1,1,14.375a.7.7,0,0,1,.617-.739l.136-.011H2.51V6.346l-.22.2a.81.81,0,0,1-1.018.043.646.646,0,0,1-.137-.92l.086-.1L2.731,4.2l.063-.051.094-.058.091-.041.094-.028.082-.016L3.2,4l.082,0a.734.734,0,0,1,.094.007L3.265,4l.08,0,.113.019.1.028.115.055.083.055L3.8,4.2l.056.056.063.085.045.082.03.085.023.113,0,.063v8.937h.755a.731.731,0,0,1,.753.625.7.7,0,0,1-.617.739L4.775,15Z",
2661
+ transform: "translate(474.469 331)"
2662
+ }))));
2663
+ };
2664
+
2665
+ var _g$3;
2666
+ function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
2667
+ var SvgH2Fill = function SvgH2Fill(props) {
2668
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
2669
+ xmlns: "http://www.w3.org/2000/svg",
2670
+ width: 16,
2671
+ height: 16,
2672
+ focusable: "false",
2673
+ viewBox: "0 0 16 16"
2674
+ }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2675
+ transform: "translate(-464 -332)"
2676
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
2677
+ width: 16,
2678
+ height: 16,
2679
+ transform: "translate(464 332)",
2680
+ fill: "none"
2681
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2682
+ d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2683
+ transform: "translate(462 333.5)",
2684
+ fill: "none",
2685
+ stroke: "currentColor",
2686
+ strokeLinecap: "round",
2687
+ strokeWidth: 2
2688
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2689
+ fill: "currentColor",
2690
+ d: "M5.5,6.75a2.576,2.576,0,1,1,5.141,0,4.961,4.961,0,0,1-1.1,3l-.256.348-1,1.291a8.564,8.564,0,0,0-1.222,2.047l-.071.191H10a.656.656,0,0,1,.632.564l.01.124a.677.677,0,0,1-.527.676L10,15H6.143a.627.627,0,0,1-.5-.252.723.723,0,0,1-.133-.57,8.183,8.183,0,0,1,1.753-3.637L8.24,9.292l.085-.111A3.975,3.975,0,0,0,9.355,6.75a1.288,1.288,0,1,0-2.57,0,.644.644,0,1,1-1.285,0Z",
2691
+ transform: "translate(469.359 331)"
2692
+ }))));
2693
+ };
2694
+
2695
+ var _g$2;
2696
+ function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
2697
+ var SvgH3Fill = function SvgH3Fill(props) {
2698
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
2699
+ xmlns: "http://www.w3.org/2000/svg",
2700
+ width: 16,
2701
+ height: 16,
2702
+ focusable: "false",
2703
+ viewBox: "0 0 16 16"
2704
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
2705
+ transform: "translate(-464 -332)"
2706
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
2707
+ width: 16,
2708
+ height: 16,
2709
+ transform: "translate(464 332)",
2710
+ fill: "none"
2711
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2712
+ d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2713
+ transform: "translate(462 333.5)",
2714
+ fill: "none",
2715
+ stroke: "currentColor",
2716
+ strokeLinecap: "round",
2717
+ strokeWidth: 2
2718
+ }), /*#__PURE__*/React__namespace.createElement("path", {
2719
+ fill: "currentColor",
2720
+ d: "M15.375,4A.658.658,0,0,1,16,4.688a3.531,3.531,0,0,1-.744,1.665l-.3.44-.171.238-.384.514-.438.568-.136.168.145.043a2.839,2.839,0,0,1,1.95,2.5l.031.225.015.151.021.294.01.334,0,.424a3.323,3.323,0,0,1-.3,1.339A2.286,2.286,0,0,1,13.5,15c-1.6,0-2.5-1-2.5-2.75a.628.628,0,1,1,1.25,0c0,1,.345,1.375,1.25,1.375a1.053,1.053,0,0,0,1.081-.652,1.9,1.9,0,0,0,.169-.723l0-.378-.015-.415-.021-.238c-.134-1.172-.653-1.719-2.149-1.719a.625.625,0,0,1-.571-.407.741.741,0,0,1,.106-.739l.494-.61.446-.564.4-.518.347-.465.3-.41.282-.411H11.625a.645.645,0,0,1-.615-.564L11,4.688a.673.673,0,0,1,.512-.676L11.625,4Z",
2721
+ transform: "translate(464.001 331)"
2722
+ }))));
2723
+ };
2724
+
2725
+ const StyledIconButton = styled__default["default"](IconButton) ``;
2726
+ const MenuContainer = styled__default["default"](Card) `
2727
+ padding: ${({ theme }) => theme.space.xxs};
2728
+
2729
+ ${StyledIconButton} {
2730
+ :first-child {
2731
+ border-top-right-radius: 0;
2732
+ border-bottom-right-radius: 0;
2733
+ }
2734
+
2735
+ :last-child {
2736
+ border-top-left-radius: 0;
2737
+ border-bottom-left-radius: 0;
2738
+ }
2739
+
2740
+ :not(:first-child):not(:last-child) {
2741
+ border-radius: 0;
2742
+ }
2743
+ }
2744
+ `;
2745
+ const FloatingMenu = (props) => {
2746
+ const { editor } = props;
2747
+ if (!editor) {
2748
+ return null;
2749
+ }
2750
+ return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
2751
+ };
2752
+
2753
+ const Header$1 = styled__default["default"].div `
2754
+ display: flex;
2755
+ flex-direction: column;
2756
+ padding: ${({ theme }) => theme.space.xs} ${({ theme }) => theme.space.md};
2757
+ border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
2758
+ `;
2759
+ const Title$1 = styled__default["default"](MD) `
2760
+ ${props => reactTheming.retrieveComponentStyles("text.primary", props)}
2761
+ ${props => props.validation === "success" && reactTheming.retrieveComponentStyles("text.success", props)}
2762
+ ${props => props.validation === "warning" && reactTheming.retrieveComponentStyles("text.warning", props)}
2763
+ ${props => props.validation === "error" && reactTheming.retrieveComponentStyles("text.danger", props)}
2764
+ `;
2765
+ const EditorHeader = (props) => {
2766
+ const { title, validation } = props;
2767
+ return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title$1, Object.assign({ isBold: true, validation: validation }, { children: title || "Write" })) }));
2768
+ };
2769
+
2770
+ const Footer$2 = styled__default["default"].div `
2771
+ display: flex;
2772
+ flex-direction: row;
2773
+ padding: ${({ theme }) => theme.space.sm} 16px;
2774
+ background-color: ${({ theme }) => theme.palette.grey[100]};
2775
+ `;
2776
+ const Text = styled__default["default"](SM) `
2777
+ line-height: 1.7;
2778
+ `;
2779
+ const EditorFooter = ({ saveText }) => {
2780
+ return jsxRuntime.jsxs(Footer$2, { children: [jsxRuntime.jsxs(Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text, { children: saveText || "to save" })] });
2781
+ };
2782
+
2581
2783
  const editorStyle = styled.css `
2582
2784
  > * + * {
2583
2785
  margin-top: 0.75em;
@@ -2832,208 +3034,6 @@ const editorStyle = styled.css `
2832
3034
  }
2833
3035
  `;
2834
3036
 
2835
- var _path$o;
2836
- function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
2837
- var SvgBoldFill = function SvgBoldFill(props) {
2838
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
2839
- xmlns: "http://www.w3.org/2000/svg",
2840
- width: 16,
2841
- height: 16,
2842
- focusable: "false",
2843
- viewBox: "0 0 16 16"
2844
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
2845
- fill: "currentColor",
2846
- d: "M7.5 0C9.952 0 12 2.048 12 4.5a4.483 4.483 0 01-1.27 3.108C12.078 8.39 13 9.855 13 11.5c0 2.452-2.048 4.5-4.5 4.5H4a1 1 0 01-1-1V1a1 1 0 011-1h3.5zM5 14h3.5c1.348 0 2.5-1.152 2.5-2.5S9.848 9 8.5 9H5v5zM7.5 2H5v5h2.5C8.848 7 10 5.848 10 4.5S8.848 2 7.5 2z"
2847
- })));
2848
- };
2849
-
2850
- var _path$n;
2851
- function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
2852
- var SvgItalicFill = function SvgItalicFill(props) {
2853
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
2854
- xmlns: "http://www.w3.org/2000/svg",
2855
- width: 16,
2856
- height: 16,
2857
- focusable: "false",
2858
- viewBox: "0 0 16 16"
2859
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
2860
- fill: "none",
2861
- stroke: "currentColor",
2862
- strokeLinecap: "round",
2863
- strokeWidth: 2,
2864
- d: "M8 1h3M9.5 1l-3 14M5 15h3"
2865
- })));
2866
- };
2867
-
2868
- var _path$m, _path2$6;
2869
- function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
2870
- var SvgQuoteFill = function SvgQuoteFill(props) {
2871
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
2872
- xmlns: "http://www.w3.org/2000/svg",
2873
- width: 16,
2874
- height: 16,
2875
- focusable: "false",
2876
- viewBox: "0 0 16 16"
2877
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
2878
- fill: "currentColor",
2879
- d: "M7 8H4c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1zm6 0h-3c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1z"
2880
- })), _path2$6 || (_path2$6 = /*#__PURE__*/React__namespace.createElement("path", {
2881
- fill: "none",
2882
- stroke: "currentColor",
2883
- strokeLinecap: "round",
2884
- strokeWidth: 2,
2885
- d: "M5.5 12C6.5 11 7 9.5 7 8V6m4.5 6c1-1 1.5-2.5 1.5-4V6"
2886
- })));
2887
- };
2888
-
2889
- var _g$4;
2890
- function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
2891
- var SvgH1Fill = function SvgH1Fill(props) {
2892
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
2893
- xmlns: "http://www.w3.org/2000/svg",
2894
- width: 16,
2895
- height: 16,
2896
- focusable: "false",
2897
- viewBox: "0 0 16 16"
2898
- }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2899
- transform: "translate(-464 -332)"
2900
- }, /*#__PURE__*/React__namespace.createElement("rect", {
2901
- width: 16,
2902
- height: 16,
2903
- transform: "translate(464 332)",
2904
- fill: "none"
2905
- }), /*#__PURE__*/React__namespace.createElement("path", {
2906
- d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2907
- transform: "translate(462 333.5)",
2908
- fill: "none",
2909
- stroke: "currentColor",
2910
- strokeLinecap: "round",
2911
- strokeWidth: 2
2912
- }), /*#__PURE__*/React__namespace.createElement("path", {
2913
- fill: "currentColor",
2914
- d: "M1.755,15A.731.731,0,0,1,1,14.375a.7.7,0,0,1,.617-.739l.136-.011H2.51V6.346l-.22.2a.81.81,0,0,1-1.018.043.646.646,0,0,1-.137-.92l.086-.1L2.731,4.2l.063-.051.094-.058.091-.041.094-.028.082-.016L3.2,4l.082,0a.734.734,0,0,1,.094.007L3.265,4l.08,0,.113.019.1.028.115.055.083.055L3.8,4.2l.056.056.063.085.045.082.03.085.023.113,0,.063v8.937h.755a.731.731,0,0,1,.753.625.7.7,0,0,1-.617.739L4.775,15Z",
2915
- transform: "translate(474.469 331)"
2916
- }))));
2917
- };
2918
-
2919
- var _g$3;
2920
- function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
2921
- var SvgH2Fill = function SvgH2Fill(props) {
2922
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
2923
- xmlns: "http://www.w3.org/2000/svg",
2924
- width: 16,
2925
- height: 16,
2926
- focusable: "false",
2927
- viewBox: "0 0 16 16"
2928
- }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2929
- transform: "translate(-464 -332)"
2930
- }, /*#__PURE__*/React__namespace.createElement("rect", {
2931
- width: 16,
2932
- height: 16,
2933
- transform: "translate(464 332)",
2934
- fill: "none"
2935
- }), /*#__PURE__*/React__namespace.createElement("path", {
2936
- d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2937
- transform: "translate(462 333.5)",
2938
- fill: "none",
2939
- stroke: "currentColor",
2940
- strokeLinecap: "round",
2941
- strokeWidth: 2
2942
- }), /*#__PURE__*/React__namespace.createElement("path", {
2943
- fill: "currentColor",
2944
- d: "M5.5,6.75a2.576,2.576,0,1,1,5.141,0,4.961,4.961,0,0,1-1.1,3l-.256.348-1,1.291a8.564,8.564,0,0,0-1.222,2.047l-.071.191H10a.656.656,0,0,1,.632.564l.01.124a.677.677,0,0,1-.527.676L10,15H6.143a.627.627,0,0,1-.5-.252.723.723,0,0,1-.133-.57,8.183,8.183,0,0,1,1.753-3.637L8.24,9.292l.085-.111A3.975,3.975,0,0,0,9.355,6.75a1.288,1.288,0,1,0-2.57,0,.644.644,0,1,1-1.285,0Z",
2945
- transform: "translate(469.359 331)"
2946
- }))));
2947
- };
2948
-
2949
- var _g$2;
2950
- function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
2951
- var SvgH3Fill = function SvgH3Fill(props) {
2952
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
2953
- xmlns: "http://www.w3.org/2000/svg",
2954
- width: 16,
2955
- height: 16,
2956
- focusable: "false",
2957
- viewBox: "0 0 16 16"
2958
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
2959
- transform: "translate(-464 -332)"
2960
- }, /*#__PURE__*/React__namespace.createElement("rect", {
2961
- width: 16,
2962
- height: 16,
2963
- transform: "translate(464 332)",
2964
- fill: "none"
2965
- }), /*#__PURE__*/React__namespace.createElement("path", {
2966
- d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
2967
- transform: "translate(462 333.5)",
2968
- fill: "none",
2969
- stroke: "currentColor",
2970
- strokeLinecap: "round",
2971
- strokeWidth: 2
2972
- }), /*#__PURE__*/React__namespace.createElement("path", {
2973
- fill: "currentColor",
2974
- d: "M15.375,4A.658.658,0,0,1,16,4.688a3.531,3.531,0,0,1-.744,1.665l-.3.44-.171.238-.384.514-.438.568-.136.168.145.043a2.839,2.839,0,0,1,1.95,2.5l.031.225.015.151.021.294.01.334,0,.424a3.323,3.323,0,0,1-.3,1.339A2.286,2.286,0,0,1,13.5,15c-1.6,0-2.5-1-2.5-2.75a.628.628,0,1,1,1.25,0c0,1,.345,1.375,1.25,1.375a1.053,1.053,0,0,0,1.081-.652,1.9,1.9,0,0,0,.169-.723l0-.378-.015-.415-.021-.238c-.134-1.172-.653-1.719-2.149-1.719a.625.625,0,0,1-.571-.407.741.741,0,0,1,.106-.739l.494-.61.446-.564.4-.518.347-.465.3-.41.282-.411H11.625a.645.645,0,0,1-.615-.564L11,4.688a.673.673,0,0,1,.512-.676L11.625,4Z",
2975
- transform: "translate(464.001 331)"
2976
- }))));
2977
- };
2978
-
2979
- const StyledIconButton = styled__default["default"](IconButton) ``;
2980
- const MenuContainer = styled__default["default"](Card) `
2981
- padding: ${({ theme }) => theme.space.xxs};
2982
-
2983
- ${StyledIconButton} {
2984
- :first-child {
2985
- border-top-right-radius: 0;
2986
- border-bottom-right-radius: 0;
2987
- }
2988
-
2989
- :last-child {
2990
- border-top-left-radius: 0;
2991
- border-bottom-left-radius: 0;
2992
- }
2993
-
2994
- :not(:first-child):not(:last-child) {
2995
- border-radius: 0;
2996
- }
2997
- }
2998
- `;
2999
- const FloatingMenu = (props) => {
3000
- const { editor } = props;
3001
- if (!editor) {
3002
- return null;
3003
- }
3004
- return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
3005
- };
3006
-
3007
- const Header$1 = styled__default["default"].div `
3008
- display: flex;
3009
- flex-direction: column;
3010
- padding: ${({ theme }) => theme.space.xs} ${({ theme }) => theme.space.md};
3011
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
3012
- `;
3013
- const Title$1 = styled__default["default"](MD) `
3014
- ${props => reactTheming.retrieveComponentStyles("text.primary", props)}
3015
- ${props => props.validation === "success" && reactTheming.retrieveComponentStyles("text.success", props)}
3016
- ${props => props.validation === "warning" && reactTheming.retrieveComponentStyles("text.warning", props)}
3017
- ${props => props.validation === "error" && reactTheming.retrieveComponentStyles("text.danger", props)}
3018
- `;
3019
- const EditorHeader = (props) => {
3020
- const { title, validation } = props;
3021
- return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title$1, Object.assign({ isBold: true, validation: validation }, { children: title || "Write" })) }));
3022
- };
3023
-
3024
- const Footer$2 = styled__default["default"].div `
3025
- display: flex;
3026
- flex-direction: row;
3027
- padding: ${({ theme }) => theme.space.sm} 16px;
3028
- background-color: ${({ theme }) => theme.palette.grey[100]};
3029
- `;
3030
- const Text = styled__default["default"](SM) `
3031
- line-height: 1.7;
3032
- `;
3033
- const EditorFooter = ({ saveText }) => {
3034
- return jsxRuntime.jsxs(Footer$2, { children: [jsxRuntime.jsxs(Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text, { children: saveText || "to save" })] });
3035
- };
3036
-
3037
3037
  const EditorContainer = styled__default["default"](reactForms.FauxInput) `
3038
3038
 
3039
3039
  ${({ editable }) => !editable &&
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonArgs } from "./_types";
3
2
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
4
3
  export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
@@ -8,18 +8,18 @@ export declare const variants: readonly [{}, {
8
8
  readonly disabled: true;
9
9
  }];
10
10
  export declare const Row: import("styled-components").IStyledComponent<"web", {
11
- alignItems?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
12
- alignItemsXs?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
13
- alignItemsSm?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
14
- alignItemsMd?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
15
- alignItemsLg?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
16
- alignItemsXl?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
17
- justifyContent?: "end" | "start" | "center" | "between" | "around" | undefined;
18
- justifyContentXs?: "end" | "start" | "center" | "between" | "around" | undefined;
19
- justifyContentSm?: "end" | "start" | "center" | "between" | "around" | undefined;
20
- justifyContentMd?: "end" | "start" | "center" | "between" | "around" | undefined;
21
- justifyContentLg?: "end" | "start" | "center" | "between" | "around" | undefined;
22
- justifyContentXl?: "end" | "start" | "center" | "between" | "around" | undefined;
11
+ alignItems?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "start" | "center" | "end" | "between" | "around" | undefined;
18
+ justifyContentXs?: "start" | "center" | "end" | "between" | "around" | undefined;
19
+ justifyContentSm?: "start" | "center" | "end" | "between" | "around" | undefined;
20
+ justifyContentMd?: "start" | "center" | "end" | "between" | "around" | undefined;
21
+ justifyContentLg?: "start" | "center" | "end" | "between" | "around" | undefined;
22
+ justifyContentXl?: "start" | "center" | "end" | "between" | "around" | undefined;
23
23
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
24
24
  wrapXs?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
25
25
  wrapSm?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
@@ -73,7 +73,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
73
73
  results?: number | undefined;
74
74
  security?: string | undefined;
75
75
  unselectable?: "on" | "off" | undefined;
76
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
76
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -299,18 +299,18 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
299
299
  md?: string | number | boolean | undefined;
300
300
  lg?: string | number | boolean | undefined;
301
301
  xl?: string | number | boolean | undefined;
302
- alignSelf?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
303
- alignSelfXs?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
304
- alignSelfSm?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
305
- alignSelfMd?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
306
- alignSelfLg?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
307
- alignSelfXl?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
308
- textAlign?: "end" | "start" | "center" | "justify" | undefined;
309
- textAlignXs?: "end" | "start" | "center" | "justify" | undefined;
310
- textAlignSm?: "end" | "start" | "center" | "justify" | undefined;
311
- textAlignMd?: "end" | "start" | "center" | "justify" | undefined;
312
- textAlignLg?: "end" | "start" | "center" | "justify" | undefined;
313
- textAlignXl?: "end" | "start" | "center" | "justify" | undefined;
302
+ alignSelf?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
+ alignSelfXs?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
+ alignSelfSm?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
+ alignSelfMd?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
+ alignSelfLg?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
+ alignSelfXl?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
+ textAlign?: "start" | "center" | "end" | "justify" | undefined;
309
+ textAlignXs?: "start" | "center" | "end" | "justify" | undefined;
310
+ textAlignSm?: "start" | "center" | "end" | "justify" | undefined;
311
+ textAlignMd?: "start" | "center" | "end" | "justify" | undefined;
312
+ textAlignLg?: "start" | "center" | "end" | "justify" | undefined;
313
+ textAlignXl?: "start" | "center" | "end" | "justify" | undefined;
314
314
  offset?: string | number | undefined;
315
315
  offsetXs?: string | number | undefined;
316
316
  offsetSm?: string | number | undefined;
@@ -370,7 +370,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
370
370
  results?: number | undefined;
371
371
  security?: string | undefined;
372
372
  unselectable?: "on" | "off" | undefined;
373
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
373
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
374
374
  is?: string | undefined;
375
375
  "aria-activedescendant"?: string | undefined;
376
376
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -640,7 +640,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
640
640
  results?: number | undefined;
641
641
  security?: string | undefined;
642
642
  unselectable?: "on" | "off" | undefined;
643
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
643
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
644
644
  is?: string | undefined;
645
645
  "aria-activedescendant"?: string | undefined;
646
646
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -0,0 +1,21 @@
1
+ import { PlaceholderOptions } from "@tiptap/extension-placeholder";
2
+ import { BubbleMenuProps, Editor, EditorOptions } from "@tiptap/react";
3
+ type validationStatus = "success" | "warning" | "error";
4
+ export interface ChatArgs extends Partial<EditorOptions> {
5
+ placeholderOptions?: Partial<PlaceholderOptions>;
6
+ hasInlineMenu?: boolean;
7
+ bubbleOptions?: any;
8
+ author: {
9
+ avatar: string;
10
+ avatarType?: "icon" | "image" | "text";
11
+ };
12
+ onSave?: (editor: Editor) => void;
13
+ triggerSave?: () => void;
14
+ }
15
+ export interface EditorHeaderArgs {
16
+ title?: string;
17
+ validation?: validationStatus;
18
+ }
19
+ export interface FloatingMenuArgs extends Partial<BubbleMenuProps> {
20
+ }
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ChatInput: () => void;
@@ -0,0 +1,17 @@
1
+ import { Editor } from "@tiptap/react";
2
+ import React from "react";
3
+ export type ChatContextType = {
4
+ isEditing: boolean;
5
+ setIsEditing: (isEditing: boolean) => void;
6
+ comment: string;
7
+ setComment: (comment: string) => void;
8
+ triggerSave: () => void;
9
+ editor?: Editor;
10
+ setEditor: React.Dispatch<React.SetStateAction<Editor | undefined>>;
11
+ };
12
+ export declare const ChatContext: React.Context<ChatContextType | null>;
13
+ export declare const ChatContextProvider: ({ onSave, children, }: {
14
+ onSave?: ((editor: Editor) => void) | undefined;
15
+ children: React.ReactNode;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const useChatContext: () => ChatContextType;