@appquality/unguess-design-system 3.1.54 → 3.1.56
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 +29 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +613 -451
- package/build/stories/buttons/button/index.stories.d.ts +1 -0
- package/build/stories/buttons/utils.d.ts +27 -27
- package/build/stories/chat/_types.d.ts +21 -0
- package/build/stories/chat/chatInput.d.ts +1 -0
- package/build/stories/chat/context/chatContext.d.ts +17 -0
- package/build/stories/chat/index.d.ts +557 -0
- package/build/stories/chat/index.stories.d.ts +21 -0
- package/build/stories/chat/parts/comment.d.ts +4 -0
- package/build/stories/chat/parts/commentBox.d.ts +15 -0
- package/build/stories/chat/parts/containers.d.ts +535 -0
- package/build/stories/chat/parts/footer.d.ts +4 -0
- package/build/stories/chat/parts/header.d.ts +267 -0
- package/build/stories/dropdowns/select/index.stories.d.ts +1 -0
- package/build/stories/editor/index.stories.d.ts +1 -0
- package/package.json +1 -1
- /package/build/stories/{editor → shared}/editorStyle.d.ts +0 -0
package/build/index.js
CHANGED
|
@@ -24,17 +24,17 @@ var pie = require('@nivo/pie');
|
|
|
24
24
|
var sunburst = require('@nivo/sunburst');
|
|
25
25
|
var waffle = require('@nivo/waffle');
|
|
26
26
|
var line = require('@nivo/line');
|
|
27
|
-
var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
28
|
-
var reactColorpickers = require('@zendeskgarden/react-colorpickers');
|
|
29
|
-
var reactModals = require('@zendeskgarden/react-modals');
|
|
30
|
-
var reactDropdowns = require('@zendeskgarden/react-dropdowns');
|
|
31
|
-
var reactForms = require('@zendeskgarden/react-forms');
|
|
32
27
|
var react = require('@tiptap/react');
|
|
33
28
|
var Typography = require('@tiptap/extension-typography');
|
|
34
29
|
var Link = require('@tiptap/extension-link');
|
|
35
30
|
var StarterKit = require('@tiptap/starter-kit');
|
|
36
31
|
var Placeholder = require('@tiptap/extension-placeholder');
|
|
37
32
|
var CharacterCount = require('@tiptap/extension-character-count');
|
|
33
|
+
var reactForms = require('@zendeskgarden/react-forms');
|
|
34
|
+
var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
35
|
+
var reactColorpickers = require('@zendeskgarden/react-colorpickers');
|
|
36
|
+
var reactModals = require('@zendeskgarden/react-modals');
|
|
37
|
+
var reactDropdowns = require('@zendeskgarden/react-dropdowns');
|
|
38
38
|
var reactGrid = require('@zendeskgarden/react-grid');
|
|
39
39
|
var formik = require('formik');
|
|
40
40
|
var reactChrome = require('@zendeskgarden/react-chrome');
|
|
@@ -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;
|
|
@@ -1220,7 +1220,7 @@ const Divider = styled__default["default"].div `
|
|
|
1220
1220
|
margin-bottom: ${({ theme }) => theme.space.xxs};
|
|
1221
1221
|
background-color: ${({ theme }) => theme.palette.grey["300"]};
|
|
1222
1222
|
`;
|
|
1223
|
-
const Footer$
|
|
1223
|
+
const Footer$4 = styled__default["default"].div `
|
|
1224
1224
|
display: flex;
|
|
1225
1225
|
flex-direction: column;
|
|
1226
1226
|
margin-top: auto;
|
|
@@ -1237,7 +1237,7 @@ const Container$2 = styled__default["default"].div `
|
|
|
1237
1237
|
${wrap ? "flex-wrap: wrap;" : ""}
|
|
1238
1238
|
`}
|
|
1239
1239
|
`;
|
|
1240
|
-
const CardFooter = (props) => (jsxRuntime.jsxs(Footer$
|
|
1240
|
+
const CardFooter = (props) => (jsxRuntime.jsxs(Footer$4, { children: [!props.noDivider && jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(Container$2, Object.assign({}, props, { children: props.children }))] }));
|
|
1241
1241
|
|
|
1242
1242
|
const UgContentCard = styled__default["default"](reactNotifications.Well) `
|
|
1243
1243
|
border-radius: ${({ theme }) => theme.borderRadii.lg};
|
|
@@ -2291,352 +2291,129 @@ const SentimentChart = ({ data, width, height, margin, tooltip, i18n, }) => {
|
|
|
2291
2291
|
], enableCrosshair: false, isInteractive: true, enableSlices: "x" }) })) }));
|
|
2292
2292
|
};
|
|
2293
2293
|
|
|
2294
|
-
const
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2294
|
+
const Footer$3 = styled__default["default"].div `
|
|
2295
|
+
display: flex;
|
|
2296
|
+
flex-direction: row;
|
|
2297
|
+
padding: ${({ theme }) => `${theme.space.sm} 0`};
|
|
2298
|
+
justify-content: flex-end;
|
|
2299
|
+
gap: ${({ theme }) => theme.space.xs};
|
|
2300
2300
|
`;
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
*/
|
|
2304
|
-
const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
|
|
2305
|
-
|
|
2306
|
-
var _circle;
|
|
2307
|
-
function _extends$v() { _extends$v = 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$v.apply(this, arguments); }
|
|
2308
|
-
var SvgCircleFullFill = function SvgCircleFullFill(props) {
|
|
2309
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
|
|
2310
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2311
|
-
width: 16,
|
|
2312
|
-
height: 16,
|
|
2313
|
-
focusable: "false",
|
|
2314
|
-
viewBox: "0 0 16 16"
|
|
2315
|
-
}, props), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
2316
|
-
cx: 8,
|
|
2317
|
-
cy: 8,
|
|
2318
|
-
r: 8,
|
|
2319
|
-
fill: "currentColor"
|
|
2320
|
-
})));
|
|
2301
|
+
const ChatFooter = ({ saveText, children, }) => {
|
|
2302
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Footer$3, { children: children }) }));
|
|
2321
2303
|
};
|
|
2322
2304
|
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
label: label !== null && label !== void 0 ? label : "",
|
|
2349
|
-
};
|
|
2350
|
-
});
|
|
2351
|
-
const matrix = containerUtilities.convertToMatrix(cleanedColors, rowSize !== null && rowSize !== void 0 ? rowSize : 7);
|
|
2352
|
-
const [color, setColor] = React.useState(matrix[0][0].value);
|
|
2353
|
-
const [rowIndex, setRowIndex] = React.useState(0);
|
|
2354
|
-
const [colIndex, setColIndex] = React.useState(0);
|
|
2355
|
-
const [selectedRowIndex, setSelectedRowIndex] = React.useState(0);
|
|
2356
|
-
const [selectedColIndex, setSelectedColIndex] = React.useState(0);
|
|
2357
|
-
const handleChange = (rowIdx, colIdx) => {
|
|
2358
|
-
setRowIndex(rowIdx);
|
|
2359
|
-
setColIndex(colIdx);
|
|
2360
|
-
};
|
|
2361
|
-
const handleSelect = (rowIdx, colIdx) => {
|
|
2362
|
-
setSelectedRowIndex(rowIdx);
|
|
2363
|
-
setSelectedColIndex(colIdx);
|
|
2364
|
-
};
|
|
2365
|
-
return (jsxRuntime.jsx(StyledColorSwatchDialog, Object.assign({ colors: matrix, onChange: handleChange, onSelect: (rowIdx, colIdx) => {
|
|
2366
|
-
handleSelect(rowIdx, colIdx);
|
|
2367
|
-
setColor(matrix[rowIdx][colIdx].value);
|
|
2368
|
-
if (onSelect)
|
|
2369
|
-
onSelect(matrix[rowIdx][colIdx].value);
|
|
2370
|
-
}, rowIndex: rowIndex, colIndex: colIndex, selectedRowIndex: selectedRowIndex, selectedColIndex: selectedColIndex }, props, { children: jsxRuntime.jsx(ColorSwatchTrigger, Object.assign({ color: color }, { children: children })) })));
|
|
2305
|
+
const ChatContext = React.createContext(null);
|
|
2306
|
+
const ChatContextProvider = ({ onSave, children, }) => {
|
|
2307
|
+
const [isEditing, setIsEditing] = React.useState(false);
|
|
2308
|
+
const [comment, setComment] = React.useState("");
|
|
2309
|
+
const [editor, setEditor] = React.useState();
|
|
2310
|
+
const chatContextValue = React.useMemo(() => ({
|
|
2311
|
+
isEditing,
|
|
2312
|
+
setIsEditing,
|
|
2313
|
+
comment,
|
|
2314
|
+
setComment,
|
|
2315
|
+
editor,
|
|
2316
|
+
setEditor,
|
|
2317
|
+
triggerSave: () => {
|
|
2318
|
+
if (editor && onSave) {
|
|
2319
|
+
onSave(editor);
|
|
2320
|
+
}
|
|
2321
|
+
},
|
|
2322
|
+
}), [comment, setComment, isEditing, setIsEditing, editor, setEditor, onSave]);
|
|
2323
|
+
return (jsxRuntime.jsx(ChatContext.Provider, Object.assign({ value: chatContextValue }, { children: children })));
|
|
2324
|
+
};
|
|
2325
|
+
const useChatContext = () => {
|
|
2326
|
+
const context = React.useContext(ChatContext);
|
|
2327
|
+
if (!context)
|
|
2328
|
+
throw new Error("Provider not found for ChatContextProvider");
|
|
2329
|
+
return context; // Now we can use the context in the component, SAFELY.
|
|
2371
2330
|
};
|
|
2372
2331
|
|
|
2373
|
-
const
|
|
2374
|
-
|
|
2375
|
-
|
|
2332
|
+
const ChatContainer = styled__default["default"](Card) `
|
|
2333
|
+
padding: ${({ theme }) => theme.space.md};
|
|
2334
|
+
&:hover {
|
|
2335
|
+
box-shadow: none;
|
|
2376
2336
|
}
|
|
2337
|
+
cursor: default;
|
|
2377
2338
|
`;
|
|
2339
|
+
const MessagesContainer = styled__default["default"].div `
|
|
2340
|
+
padding: ${({ theme }) => `${theme.space.md} 0`};
|
|
2341
|
+
display: flex;
|
|
2342
|
+
flex-direction: column;
|
|
2343
|
+
gap: ${({ theme }) => theme.space.sm};
|
|
2344
|
+
`;
|
|
2345
|
+
|
|
2378
2346
|
/**
|
|
2379
|
-
*
|
|
2380
|
-
* <hr>
|
|
2381
|
-
* Used for this:
|
|
2382
|
-
- To display information or actions that are supplementary to the screen’s primary content
|
|
2383
|
-
- To display a list of actions that affect the screen’s content, such as filtering data
|
|
2347
|
+
* Title is a basic component used to display a title. Often used in card headers.
|
|
2384
2348
|
*/
|
|
2385
|
-
const
|
|
2386
|
-
Drawer.Header = reactModals.DrawerModal.Header;
|
|
2387
|
-
Drawer.Body = reactModals.DrawerModal.Body;
|
|
2388
|
-
Drawer.Footer = reactModals.DrawerModal.Footer;
|
|
2389
|
-
Drawer.FooterItem = reactModals.DrawerModal.FooterItem;
|
|
2390
|
-
Drawer.Close = reactModals.DrawerModal.Close;
|
|
2349
|
+
const Title$1 = (props) => jsxRuntime.jsx(reactNotifications.Title, Object.assign({}, props));
|
|
2391
2350
|
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2351
|
+
const ChatTitle = styled__default["default"](Title$1) `
|
|
2352
|
+
color: ${({ theme }) => theme.palette.blue[600]};
|
|
2353
|
+
margin: ${({ theme }) => `0 -${theme.space.md}`};
|
|
2354
|
+
padding: ${({ theme }) => `0 ${theme.space.md} ${theme.space.sm}`};
|
|
2355
|
+
border-bottom: ${({ theme }) => `1px solid ${theme.palette.grey[200]}`};
|
|
2356
|
+
`;
|
|
2398
2357
|
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
justify-content: flex-start;
|
|
2358
|
+
const editorStyle = styled.css `
|
|
2359
|
+
> * + * {
|
|
2360
|
+
margin-top: 0.75em;
|
|
2361
|
+
}
|
|
2404
2362
|
|
|
2405
|
-
|
|
2406
|
-
|
|
2363
|
+
*,
|
|
2364
|
+
*:before,
|
|
2365
|
+
*:after {
|
|
2366
|
+
box-sizing: border-box;
|
|
2407
2367
|
}
|
|
2408
2368
|
|
|
2409
|
-
|
|
2410
|
-
|
|
2369
|
+
h1,
|
|
2370
|
+
h2,
|
|
2371
|
+
h3,
|
|
2372
|
+
h4,
|
|
2373
|
+
h5,
|
|
2374
|
+
h6 {
|
|
2375
|
+
line-height: 1.1;
|
|
2376
|
+
font-weight: 500;
|
|
2377
|
+
color: ${({ theme }) => theme.palette.grey["800"]};
|
|
2411
2378
|
}
|
|
2412
2379
|
|
|
2413
|
-
|
|
2414
|
-
|
|
2380
|
+
h1 {
|
|
2381
|
+
font-size: 2.617924em;
|
|
2415
2382
|
}
|
|
2416
2383
|
|
|
2417
|
-
|
|
2418
|
-
|
|
2384
|
+
h2 {
|
|
2385
|
+
font-size: 1.618em;
|
|
2419
2386
|
}
|
|
2420
|
-
`;
|
|
2421
|
-
const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
|
|
2422
2387
|
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
align-items: center;
|
|
2427
|
-
justify-content: flex-start;
|
|
2428
|
-
width: 100%;
|
|
2429
|
-
`;
|
|
2430
|
-
const MetaContainer$1 = styled__default["default"].div `
|
|
2431
|
-
display: flex;
|
|
2432
|
-
flex-direction: column;
|
|
2433
|
-
align-items: flex-start;
|
|
2434
|
-
justify-content: center;
|
|
2435
|
-
`;
|
|
2436
|
-
const ThumbContainer = styled__default["default"].div `
|
|
2437
|
-
display: flex;
|
|
2438
|
-
flex-direction: row;
|
|
2439
|
-
align-items: center;
|
|
2440
|
-
justify-content: center;
|
|
2441
|
-
margin-right: ${({ theme }) => theme.space.sm};
|
|
2442
|
-
width: 100%;
|
|
2443
|
-
max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
|
|
2388
|
+
h3 {
|
|
2389
|
+
font-size: 1.5rem;
|
|
2390
|
+
}
|
|
2444
2391
|
|
|
2445
|
-
|
|
2446
|
-
|
|
2392
|
+
h4 {
|
|
2393
|
+
font-size: 1.3rem;
|
|
2447
2394
|
}
|
|
2448
|
-
`;
|
|
2449
|
-
const Label$1 = styled__default["default"](MD) `
|
|
2450
|
-
font-weight: ${({ theme }) => theme.fontWeights.medium};
|
|
2451
|
-
color: ${({ theme }) => theme.palette.grey[800]};
|
|
2452
|
-
`;
|
|
2453
|
-
const Description$1 = styled__default["default"](SM) `
|
|
2454
|
-
color: ${({ theme }) => theme.palette.grey[600]};
|
|
2455
|
-
`;
|
|
2456
|
-
const Image$1 = React.memo(({ src }) => {
|
|
2457
|
-
return jsxRuntime.jsx("img", { src: src });
|
|
2458
|
-
});
|
|
2459
|
-
const ItemContent = (props) => {
|
|
2460
|
-
const { thumbSrc, description, label } = props;
|
|
2461
|
-
return (jsxRuntime.jsxs(Container$1, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
|
|
2462
|
-
};
|
|
2463
2395
|
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
/**
|
|
2468
|
-
* A Menu is a wrapper for items elements
|
|
2469
|
-
**/
|
|
2470
|
-
const Menu = (props) => jsxRuntime.jsx(StyledMenu, Object.assign({}, props));
|
|
2471
|
-
// Extras
|
|
2472
|
-
const PreviousItem = (props) => (jsxRuntime.jsx(reactDropdowns.PreviousItem, Object.assign({}, props)));
|
|
2473
|
-
const Separator = (props) => (jsxRuntime.jsx(reactDropdowns.Separator, Object.assign({}, props)));
|
|
2474
|
-
const NextItem = (props) => jsxRuntime.jsx(reactDropdowns.NextItem, Object.assign({}, props));
|
|
2475
|
-
const ItemMeta = (props) => (jsxRuntime.jsx(reactDropdowns.ItemMeta, Object.assign({}, props)));
|
|
2476
|
-
const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.assign({}, props)));
|
|
2477
|
-
const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
|
|
2478
|
-
const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
|
|
2396
|
+
h5 {
|
|
2397
|
+
font-size: 1.2rem;
|
|
2398
|
+
}
|
|
2479
2399
|
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
/**
|
|
2484
|
-
* Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
|
|
2485
|
-
* <hr>
|
|
2486
|
-
* Used for this:
|
|
2487
|
-
- To filter down a large list of options
|
|
2488
|
-
- To quickly find a known option
|
|
2489
|
-
* Not for this:
|
|
2490
|
-
- To make more than one selection, use Multiselect instead
|
|
2491
|
-
*/
|
|
2492
|
-
const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
|
|
2400
|
+
h6 {
|
|
2401
|
+
font-size: 1.1rem;
|
|
2402
|
+
}
|
|
2493
2403
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2404
|
+
/*=====
|
|
2405
|
+
#Lists
|
|
2406
|
+
=====*/
|
|
2407
|
+
ul,
|
|
2408
|
+
ol,
|
|
2409
|
+
dl {
|
|
2410
|
+
padding: 0.618em 0.618rem;
|
|
2411
|
+
margin-left: 1rem;
|
|
2412
|
+
}
|
|
2500
2413
|
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
${(props) => props.isPrimary &&
|
|
2505
|
-
`
|
|
2506
|
-
background-color: ${props.theme.palette.blue[600]};
|
|
2507
|
-
color: white;
|
|
2508
|
-
& svg[data-garden-id="forms.media_figure"] {
|
|
2509
|
-
color: white;
|
|
2510
|
-
}
|
|
2511
|
-
`}
|
|
2512
|
-
`;
|
|
2513
|
-
/**
|
|
2514
|
-
* Select allows a user to pick one option from a list. This helps simplify the UI when space is limited
|
|
2515
|
-
* <hr>
|
|
2516
|
-
* Used for this:
|
|
2517
|
-
- To make a selection from a list of options
|
|
2518
|
-
* Not for this:
|
|
2519
|
-
- To filter a large list of options, use Autocomplete instead
|
|
2520
|
-
- To make multiple selections from a list, use Multiselect instead
|
|
2521
|
-
- To select from a list on mobile, use a native Select instead
|
|
2522
|
-
*/
|
|
2523
|
-
const Select = (props) => jsxRuntime.jsx(UgSelect, Object.assign({}, props));
|
|
2524
|
-
const StyledDropdown = styled__default["default"].div `
|
|
2525
|
-
${StyledLabel$2} {
|
|
2526
|
-
display: block;
|
|
2527
|
-
}
|
|
2528
|
-
`;
|
|
2529
|
-
const StyledMenuHeaderItem = styled__default["default"](MenuHeaderItem) `
|
|
2530
|
-
pointer-events: none;
|
|
2531
|
-
`;
|
|
2532
|
-
const Dropdown = (props) => (jsxRuntime.jsx(StyledDropdown, { children: jsxRuntime.jsx(reactDropdowns.Dropdown, Object.assign({}, props)) }));
|
|
2533
|
-
const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign({}, props));
|
|
2534
|
-
Dropdown.HeaderItem = StyledMenuHeaderItem;
|
|
2535
|
-
Dropdown.Separator = Separator;
|
|
2536
|
-
|
|
2537
|
-
const StyledAutocomplete = styled__default["default"](Autocomplete) `
|
|
2538
|
-
${(props) => props.hasSelectedItems &&
|
|
2539
|
-
`
|
|
2540
|
-
border-color: ${getColor(theme.colors.primaryHue, 600)};
|
|
2541
|
-
background-color: ${getColor(theme.colors.primaryHue, 600)};
|
|
2542
|
-
color: white;
|
|
2543
|
-
& > input, & > svg {
|
|
2544
|
-
color: ${props.theme.palette.white};
|
|
2545
|
-
}
|
|
2546
|
-
`}
|
|
2547
|
-
`;
|
|
2548
|
-
const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
|
|
2549
|
-
var _a, _b;
|
|
2550
|
-
const [selectedItems, setSelectedItems] = React.useState(options.filter((o) => o.selected));
|
|
2551
|
-
const [inputValue, setInputValue] = React.useState("");
|
|
2552
|
-
const [matchingOptions, setMatchingOptions] = React.useState(options);
|
|
2553
|
-
React.useEffect(() => {
|
|
2554
|
-
setMatchingOptions(options.filter((option) => option.label
|
|
2555
|
-
.trim()
|
|
2556
|
-
.toLowerCase()
|
|
2557
|
-
.indexOf(inputValue.trim().toLowerCase()) !== -1));
|
|
2558
|
-
}, [inputValue, options]);
|
|
2559
|
-
React.useEffect(() => {
|
|
2560
|
-
setSelectedItems(options.filter((o) => o.selected));
|
|
2561
|
-
}, [options]);
|
|
2562
|
-
const hasSelectedItems = selectedItems.length > 0;
|
|
2563
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: selectedItems, onSelect: (items) => {
|
|
2564
|
-
if (items) {
|
|
2565
|
-
setSelectedItems(items);
|
|
2566
|
-
if (onChange)
|
|
2567
|
-
onChange(items);
|
|
2568
|
-
}
|
|
2569
|
-
}, downshiftProps: {
|
|
2570
|
-
itemToString: (item) => item && item.itemId,
|
|
2571
|
-
}, onStateChange: (changes) => {
|
|
2572
|
-
if (changes.isOpen === false)
|
|
2573
|
-
setInputValue("");
|
|
2574
|
-
}, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
|
|
2575
|
-
? (i18n === null || i18n === void 0 ? void 0 : i18n.counterText)
|
|
2576
|
-
? i18n.counterText(selectedItems.length)
|
|
2577
|
-
: `Items (${selectedItems.length})`
|
|
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
|
-
};
|
|
2580
|
-
|
|
2581
|
-
const editorStyle = styled.css `
|
|
2582
|
-
> * + * {
|
|
2583
|
-
margin-top: 0.75em;
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
|
-
*,
|
|
2587
|
-
*:before,
|
|
2588
|
-
*:after {
|
|
2589
|
-
box-sizing: border-box;
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
h1,
|
|
2593
|
-
h2,
|
|
2594
|
-
h3,
|
|
2595
|
-
h4,
|
|
2596
|
-
h5,
|
|
2597
|
-
h6 {
|
|
2598
|
-
line-height: 1.1;
|
|
2599
|
-
font-weight: 500;
|
|
2600
|
-
color: ${({ theme }) => theme.palette.grey["800"]};
|
|
2601
|
-
}
|
|
2602
|
-
|
|
2603
|
-
h1 {
|
|
2604
|
-
font-size: 2.617924em;
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2607
|
-
h2 {
|
|
2608
|
-
font-size: 1.618em;
|
|
2609
|
-
}
|
|
2610
|
-
|
|
2611
|
-
h3 {
|
|
2612
|
-
font-size: 1.5rem;
|
|
2613
|
-
}
|
|
2614
|
-
|
|
2615
|
-
h4 {
|
|
2616
|
-
font-size: 1.3rem;
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
h5 {
|
|
2620
|
-
font-size: 1.2rem;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
h6 {
|
|
2624
|
-
font-size: 1.1rem;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
/*=====
|
|
2628
|
-
#Lists
|
|
2629
|
-
=====*/
|
|
2630
|
-
ul,
|
|
2631
|
-
ol,
|
|
2632
|
-
dl {
|
|
2633
|
-
padding: 0.618em 0.618rem;
|
|
2634
|
-
margin-left: 1rem;
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
|
-
ul {
|
|
2638
|
-
list-style: disc;
|
|
2639
|
-
}
|
|
2414
|
+
ul {
|
|
2415
|
+
list-style: disc;
|
|
2416
|
+
}
|
|
2640
2417
|
|
|
2641
2418
|
ol {
|
|
2642
2419
|
list-style: decimal;
|
|
@@ -2833,9 +2610,9 @@ const editorStyle = styled.css `
|
|
|
2833
2610
|
`;
|
|
2834
2611
|
|
|
2835
2612
|
var _path$o;
|
|
2836
|
-
function _extends$
|
|
2613
|
+
function _extends$v() { _extends$v = 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$v.apply(this, arguments); }
|
|
2837
2614
|
var SvgBoldFill = function SvgBoldFill(props) {
|
|
2838
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
2615
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
|
|
2839
2616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2840
2617
|
width: 16,
|
|
2841
2618
|
height: 16,
|
|
@@ -2848,9 +2625,9 @@ var SvgBoldFill = function SvgBoldFill(props) {
|
|
|
2848
2625
|
};
|
|
2849
2626
|
|
|
2850
2627
|
var _path$n;
|
|
2851
|
-
function _extends$
|
|
2628
|
+
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); }
|
|
2852
2629
|
var SvgItalicFill = function SvgItalicFill(props) {
|
|
2853
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
2630
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
|
|
2854
2631
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2855
2632
|
width: 16,
|
|
2856
2633
|
height: 16,
|
|
@@ -2866,9 +2643,9 @@ var SvgItalicFill = function SvgItalicFill(props) {
|
|
|
2866
2643
|
};
|
|
2867
2644
|
|
|
2868
2645
|
var _path$m, _path2$6;
|
|
2869
|
-
function _extends$
|
|
2646
|
+
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); }
|
|
2870
2647
|
var SvgQuoteFill = function SvgQuoteFill(props) {
|
|
2871
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
2648
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
2872
2649
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2873
2650
|
width: 16,
|
|
2874
2651
|
height: 16,
|
|
@@ -2886,122 +2663,507 @@ var SvgQuoteFill = function SvgQuoteFill(props) {
|
|
|
2886
2663
|
})));
|
|
2887
2664
|
};
|
|
2888
2665
|
|
|
2889
|
-
var _g$4;
|
|
2890
|
-
function _extends$
|
|
2891
|
-
var SvgH1Fill = function SvgH1Fill(props) {
|
|
2892
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
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
|
-
}))));
|
|
2666
|
+
var _g$4;
|
|
2667
|
+
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); }
|
|
2668
|
+
var SvgH1Fill = function SvgH1Fill(props) {
|
|
2669
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
|
|
2670
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2671
|
+
width: 16,
|
|
2672
|
+
height: 16,
|
|
2673
|
+
focusable: "false",
|
|
2674
|
+
viewBox: "0 0 16 16"
|
|
2675
|
+
}, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
2676
|
+
transform: "translate(-464 -332)"
|
|
2677
|
+
}, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2678
|
+
width: 16,
|
|
2679
|
+
height: 16,
|
|
2680
|
+
transform: "translate(464 332)",
|
|
2681
|
+
fill: "none"
|
|
2682
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2683
|
+
d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
|
|
2684
|
+
transform: "translate(462 333.5)",
|
|
2685
|
+
fill: "none",
|
|
2686
|
+
stroke: "currentColor",
|
|
2687
|
+
strokeLinecap: "round",
|
|
2688
|
+
strokeWidth: 2
|
|
2689
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2690
|
+
fill: "currentColor",
|
|
2691
|
+
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",
|
|
2692
|
+
transform: "translate(474.469 331)"
|
|
2693
|
+
}))));
|
|
2694
|
+
};
|
|
2695
|
+
|
|
2696
|
+
var _g$3;
|
|
2697
|
+
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); }
|
|
2698
|
+
var SvgH2Fill = function SvgH2Fill(props) {
|
|
2699
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
2700
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2701
|
+
width: 16,
|
|
2702
|
+
height: 16,
|
|
2703
|
+
focusable: "false",
|
|
2704
|
+
viewBox: "0 0 16 16"
|
|
2705
|
+
}, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
2706
|
+
transform: "translate(-464 -332)"
|
|
2707
|
+
}, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2708
|
+
width: 16,
|
|
2709
|
+
height: 16,
|
|
2710
|
+
transform: "translate(464 332)",
|
|
2711
|
+
fill: "none"
|
|
2712
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2713
|
+
d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
|
|
2714
|
+
transform: "translate(462 333.5)",
|
|
2715
|
+
fill: "none",
|
|
2716
|
+
stroke: "currentColor",
|
|
2717
|
+
strokeLinecap: "round",
|
|
2718
|
+
strokeWidth: 2
|
|
2719
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2720
|
+
fill: "currentColor",
|
|
2721
|
+
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",
|
|
2722
|
+
transform: "translate(469.359 331)"
|
|
2723
|
+
}))));
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
var _g$2;
|
|
2727
|
+
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); }
|
|
2728
|
+
var SvgH3Fill = function SvgH3Fill(props) {
|
|
2729
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
|
|
2730
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2731
|
+
width: 16,
|
|
2732
|
+
height: 16,
|
|
2733
|
+
focusable: "false",
|
|
2734
|
+
viewBox: "0 0 16 16"
|
|
2735
|
+
}, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
2736
|
+
transform: "translate(-464 -332)"
|
|
2737
|
+
}, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2738
|
+
width: 16,
|
|
2739
|
+
height: 16,
|
|
2740
|
+
transform: "translate(464 332)",
|
|
2741
|
+
fill: "none"
|
|
2742
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2743
|
+
d: "M3,1V12.273M11.052,1V12.273M3,6.636h8.052",
|
|
2744
|
+
transform: "translate(462 333.5)",
|
|
2745
|
+
fill: "none",
|
|
2746
|
+
stroke: "currentColor",
|
|
2747
|
+
strokeLinecap: "round",
|
|
2748
|
+
strokeWidth: 2
|
|
2749
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2750
|
+
fill: "currentColor",
|
|
2751
|
+
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",
|
|
2752
|
+
transform: "translate(464.001 331)"
|
|
2753
|
+
}))));
|
|
2754
|
+
};
|
|
2755
|
+
|
|
2756
|
+
const StyledIconButton = styled__default["default"](IconButton) ``;
|
|
2757
|
+
const MenuContainer = styled__default["default"](Card) `
|
|
2758
|
+
padding: ${({ theme }) => theme.space.xxs};
|
|
2759
|
+
|
|
2760
|
+
${StyledIconButton} {
|
|
2761
|
+
:first-child {
|
|
2762
|
+
border-top-right-radius: 0;
|
|
2763
|
+
border-bottom-right-radius: 0;
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
:last-child {
|
|
2767
|
+
border-top-left-radius: 0;
|
|
2768
|
+
border-bottom-left-radius: 0;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
:not(:first-child):not(:last-child) {
|
|
2772
|
+
border-radius: 0;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
`;
|
|
2776
|
+
const FloatingMenu = (props) => {
|
|
2777
|
+
const { editor } = props;
|
|
2778
|
+
if (!editor) {
|
|
2779
|
+
return null;
|
|
2780
|
+
}
|
|
2781
|
+
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") }))] })) })));
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
const ChatBoxContainer = styled__default["default"].div `
|
|
2785
|
+
display: flex;
|
|
2786
|
+
border-top: 1px solid ${({ theme }) => theme.palette.grey[200]};
|
|
2787
|
+
margin: ${({ theme }) => `0 -${theme.space.md}`};
|
|
2788
|
+
padding: ${({ theme }) => theme.space.md};
|
|
2789
|
+
`;
|
|
2790
|
+
const EditorContainer$1 = styled__default["default"](reactForms.FauxInput) `
|
|
2791
|
+
margin-left: ${({ theme }) => theme.space.sm};
|
|
2792
|
+
.ProseMirror {
|
|
2793
|
+
padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};
|
|
2794
|
+
background-color: #fff;
|
|
2795
|
+
min-height: 36px;
|
|
2796
|
+
outline: none;
|
|
2797
|
+
max-height: 210px;
|
|
2798
|
+
overflow-y: auto;
|
|
2799
|
+
|
|
2800
|
+
${editorStyle}
|
|
2801
|
+
}
|
|
2802
|
+
`;
|
|
2803
|
+
/**
|
|
2804
|
+
* CommentBox is a wrapper around Editor component
|
|
2805
|
+
* <br>
|
|
2806
|
+
* It's a rich text WYSIWYG editors.
|
|
2807
|
+
* <hr>
|
|
2808
|
+
* Used for this:
|
|
2809
|
+
- To add chat feature
|
|
2810
|
+
- To develop collaborative text editing
|
|
2811
|
+
|
|
2812
|
+
Not for this:
|
|
2813
|
+
- Simple text input, use textarea instead.
|
|
2814
|
+
*/
|
|
2815
|
+
const CommentBox = (_a) => {
|
|
2816
|
+
var _b;
|
|
2817
|
+
var { onSave, placeholderOptions } = _a, props = __rest(_a, ["onSave", "placeholderOptions"]);
|
|
2818
|
+
const { children, hasInlineMenu, bubbleOptions, author } = props;
|
|
2819
|
+
const { setEditor, triggerSave } = useChatContext();
|
|
2820
|
+
const onKeyDown = (event) => {
|
|
2821
|
+
if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
|
|
2822
|
+
triggerSave();
|
|
2823
|
+
}
|
|
2824
|
+
};
|
|
2825
|
+
const ed = react.useEditor(Object.assign({ extensions: [
|
|
2826
|
+
Typography__default["default"],
|
|
2827
|
+
Link__default["default"],
|
|
2828
|
+
StarterKit__default["default"],
|
|
2829
|
+
Placeholder__default["default"].configure(Object.assign({ placeholder: ({ node }) => {
|
|
2830
|
+
if (node.type.name === "heading") {
|
|
2831
|
+
return "What’s the title?";
|
|
2832
|
+
}
|
|
2833
|
+
return "Can you add some further context?";
|
|
2834
|
+
} }, placeholderOptions)),
|
|
2835
|
+
CharacterCount__default["default"],
|
|
2836
|
+
], content: children || "", editorProps: {
|
|
2837
|
+
handleKeyDown: (view, event) => {
|
|
2838
|
+
if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
|
|
2839
|
+
return true;
|
|
2840
|
+
}
|
|
2841
|
+
return false;
|
|
2842
|
+
},
|
|
2843
|
+
} }, props));
|
|
2844
|
+
if (!ed) {
|
|
2845
|
+
return null;
|
|
2846
|
+
}
|
|
2847
|
+
// Add here because we want to keep also the listener from the props.
|
|
2848
|
+
ed.on("create", ({ editor }) => setEditor(editor));
|
|
2849
|
+
ed.on("update", ({ editor }) => setEditor(editor));
|
|
2850
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsxs(ChatBoxContainer, { children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_b = author.avatarType) !== null && _b !== void 0 ? _b : "text" }, { children: author.avatar })) }), jsxRuntime.jsx(EditorContainer$1, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }) })] })] }));
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2853
|
+
const CommentCard = styled.styled(Card) `
|
|
2854
|
+
padding: ${({ theme }) => `${theme.space.base * 3}px ${theme.space.sm}`};
|
|
2855
|
+
`;
|
|
2856
|
+
const Comment = ({ author, children, }) => {
|
|
2857
|
+
return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsx(Title$1, { children: author }), children] }));
|
|
2858
|
+
};
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* CommentBox is a wrapper around Editor component
|
|
2862
|
+
* <br>
|
|
2863
|
+
* It's a rich text WYSIWYG editors.
|
|
2864
|
+
* <hr>
|
|
2865
|
+
* Used for this:
|
|
2866
|
+
- To add chat feature
|
|
2867
|
+
- To develop collaborative text editing
|
|
2868
|
+
|
|
2869
|
+
Not for this:
|
|
2870
|
+
- Simple text input, use textarea instead.
|
|
2871
|
+
*/
|
|
2872
|
+
const Chat = (props) => (
|
|
2873
|
+
// <ChatProvider onSave={onSave}>
|
|
2874
|
+
jsxRuntime.jsx(ChatContainer, { children: props.children })
|
|
2875
|
+
// </ChatProvider>
|
|
2876
|
+
);
|
|
2877
|
+
Chat.Header = ChatTitle;
|
|
2878
|
+
Chat.Comments = MessagesContainer;
|
|
2879
|
+
Chat.Input = CommentBox;
|
|
2880
|
+
Chat.Footer = ChatFooter;
|
|
2881
|
+
|
|
2882
|
+
const UgClose$1 = styled__default["default"](reactNotifications.Close) `
|
|
2883
|
+
display: flex;
|
|
2884
|
+
align-items: center;
|
|
2885
|
+
justify-content: center;
|
|
2886
|
+
width: ${({ theme }) => theme.space.xl};
|
|
2887
|
+
height: ${({ theme }) => theme.space.xl};
|
|
2888
|
+
`;
|
|
2889
|
+
/**
|
|
2890
|
+
* Title is a basic component used to display a title. Often used in card headers.
|
|
2891
|
+
*/
|
|
2892
|
+
const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
|
|
2893
|
+
|
|
2894
|
+
var _circle;
|
|
2895
|
+
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); }
|
|
2896
|
+
var SvgCircleFullFill = function SvgCircleFullFill(props) {
|
|
2897
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
2898
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2899
|
+
width: 16,
|
|
2900
|
+
height: 16,
|
|
2901
|
+
focusable: "false",
|
|
2902
|
+
viewBox: "0 0 16 16"
|
|
2903
|
+
}, props), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
2904
|
+
cx: 8,
|
|
2905
|
+
cy: 8,
|
|
2906
|
+
r: 8,
|
|
2907
|
+
fill: "currentColor"
|
|
2908
|
+
})));
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
const Trigger$1 = styled.styled.div `
|
|
2912
|
+
display: flex;
|
|
2913
|
+
align-items: center;
|
|
2914
|
+
justify-content: flex-start;
|
|
2915
|
+
cursor: pointer;
|
|
2916
|
+
`;
|
|
2917
|
+
const StyledColorSwatchDialog = styled.styled(reactColorpickers.ColorSwatchDialog) `
|
|
2918
|
+
${({ disableTooltip }) => disableTooltip &&
|
|
2919
|
+
`
|
|
2920
|
+
& div[role="tooltip"] {
|
|
2921
|
+
display: none;
|
|
2922
|
+
}`}
|
|
2923
|
+
`;
|
|
2924
|
+
const ColorSwatchTrigger = React__default["default"].forwardRef((props, ref) => {
|
|
2925
|
+
var _a;
|
|
2926
|
+
return (jsxRuntime.jsx(Trigger$1, Object.assign({ ref: ref }, props, { style: Object.assign(Object.assign({}, props.style), { color: props.color }) }, { children: (_a = props.children) !== null && _a !== void 0 ? _a : jsxRuntime.jsx(SvgCircleFullFill, {}) })));
|
|
2927
|
+
});
|
|
2928
|
+
const ColorSwatch = (_a) => {
|
|
2929
|
+
var { colors, rowSize, children, onSelect } = _a, props = __rest(_a, ["colors", "rowSize", "children", "onSelect"]);
|
|
2930
|
+
/**
|
|
2931
|
+
* Convert the colors to the format expected by the ColorSwatchDialog
|
|
2932
|
+
*/
|
|
2933
|
+
const cleanedColors = colors.map(({ label, value }) => {
|
|
2934
|
+
return {
|
|
2935
|
+
value,
|
|
2936
|
+
label: label !== null && label !== void 0 ? label : "",
|
|
2937
|
+
};
|
|
2938
|
+
});
|
|
2939
|
+
const matrix = containerUtilities.convertToMatrix(cleanedColors, rowSize !== null && rowSize !== void 0 ? rowSize : 7);
|
|
2940
|
+
const [color, setColor] = React.useState(matrix[0][0].value);
|
|
2941
|
+
const [rowIndex, setRowIndex] = React.useState(0);
|
|
2942
|
+
const [colIndex, setColIndex] = React.useState(0);
|
|
2943
|
+
const [selectedRowIndex, setSelectedRowIndex] = React.useState(0);
|
|
2944
|
+
const [selectedColIndex, setSelectedColIndex] = React.useState(0);
|
|
2945
|
+
const handleChange = (rowIdx, colIdx) => {
|
|
2946
|
+
setRowIndex(rowIdx);
|
|
2947
|
+
setColIndex(colIdx);
|
|
2948
|
+
};
|
|
2949
|
+
const handleSelect = (rowIdx, colIdx) => {
|
|
2950
|
+
setSelectedRowIndex(rowIdx);
|
|
2951
|
+
setSelectedColIndex(colIdx);
|
|
2952
|
+
};
|
|
2953
|
+
return (jsxRuntime.jsx(StyledColorSwatchDialog, Object.assign({ colors: matrix, onChange: handleChange, onSelect: (rowIdx, colIdx) => {
|
|
2954
|
+
handleSelect(rowIdx, colIdx);
|
|
2955
|
+
setColor(matrix[rowIdx][colIdx].value);
|
|
2956
|
+
if (onSelect)
|
|
2957
|
+
onSelect(matrix[rowIdx][colIdx].value);
|
|
2958
|
+
}, rowIndex: rowIndex, colIndex: colIndex, selectedRowIndex: selectedRowIndex, selectedColIndex: selectedColIndex }, props, { children: jsxRuntime.jsx(ColorSwatchTrigger, Object.assign({ color: color }, { children: children })) })));
|
|
2959
|
+
};
|
|
2960
|
+
|
|
2961
|
+
const UgDrawer = styled__default["default"](reactModals.DrawerModal) `
|
|
2962
|
+
@media (max-width: ${({ theme }) => theme.breakpoints.sm}) {
|
|
2963
|
+
width: 100%;
|
|
2964
|
+
}
|
|
2965
|
+
`;
|
|
2966
|
+
/**
|
|
2967
|
+
* A Drawer is a container for supplementary content that is anchored to the edge of a page.
|
|
2968
|
+
* <hr>
|
|
2969
|
+
* Used for this:
|
|
2970
|
+
- To display information or actions that are supplementary to the screen’s primary content
|
|
2971
|
+
- To display a list of actions that affect the screen’s content, such as filtering data
|
|
2972
|
+
*/
|
|
2973
|
+
const Drawer = (props) => jsxRuntime.jsx(UgDrawer, Object.assign({}, props));
|
|
2974
|
+
Drawer.Header = reactModals.DrawerModal.Header;
|
|
2975
|
+
Drawer.Body = reactModals.DrawerModal.Body;
|
|
2976
|
+
Drawer.Footer = reactModals.DrawerModal.Footer;
|
|
2977
|
+
Drawer.FooterItem = reactModals.DrawerModal.FooterItem;
|
|
2978
|
+
Drawer.Close = reactModals.DrawerModal.Close;
|
|
2979
|
+
|
|
2980
|
+
const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
|
|
2981
|
+
|
|
2982
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
2983
|
+
__proto__: null,
|
|
2984
|
+
Field: Field$1
|
|
2985
|
+
});
|
|
2986
|
+
|
|
2987
|
+
const UgItem = styled__default["default"](reactDropdowns.Item) `
|
|
2988
|
+
display: flex;
|
|
2989
|
+
flex-direction: row;
|
|
2990
|
+
align-items: center;
|
|
2991
|
+
justify-content: flex-start;
|
|
2992
|
+
|
|
2993
|
+
> div {
|
|
2994
|
+
height: 100%;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
&[disabled] * {
|
|
2998
|
+
opacity: 0.85;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
&[disabled] svg {
|
|
3002
|
+
opacity: 0.5;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
&[disabled]:hover {
|
|
3006
|
+
background-color: transparent;
|
|
3007
|
+
}
|
|
3008
|
+
`;
|
|
3009
|
+
const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
|
|
3010
|
+
|
|
3011
|
+
const Container$1 = styled__default["default"].div `
|
|
3012
|
+
display: flex;
|
|
3013
|
+
flex-direction: row;
|
|
3014
|
+
align-items: center;
|
|
3015
|
+
justify-content: flex-start;
|
|
3016
|
+
width: 100%;
|
|
3017
|
+
`;
|
|
3018
|
+
const MetaContainer$1 = styled__default["default"].div `
|
|
3019
|
+
display: flex;
|
|
3020
|
+
flex-direction: column;
|
|
3021
|
+
align-items: flex-start;
|
|
3022
|
+
justify-content: center;
|
|
3023
|
+
`;
|
|
3024
|
+
const ThumbContainer = styled__default["default"].div `
|
|
3025
|
+
display: flex;
|
|
3026
|
+
flex-direction: row;
|
|
3027
|
+
align-items: center;
|
|
3028
|
+
justify-content: center;
|
|
3029
|
+
margin-right: ${({ theme }) => theme.space.sm};
|
|
3030
|
+
width: 100%;
|
|
3031
|
+
max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
|
|
3032
|
+
|
|
3033
|
+
> div {
|
|
3034
|
+
height: 100%;
|
|
3035
|
+
}
|
|
3036
|
+
`;
|
|
3037
|
+
const Label$1 = styled__default["default"](MD) `
|
|
3038
|
+
font-weight: ${({ theme }) => theme.fontWeights.medium};
|
|
3039
|
+
color: ${({ theme }) => theme.palette.grey[800]};
|
|
3040
|
+
`;
|
|
3041
|
+
const Description$1 = styled__default["default"](SM) `
|
|
3042
|
+
color: ${({ theme }) => theme.palette.grey[600]};
|
|
3043
|
+
`;
|
|
3044
|
+
const Image$1 = React.memo(({ src }) => {
|
|
3045
|
+
return jsxRuntime.jsx("img", { src: src });
|
|
3046
|
+
});
|
|
3047
|
+
const ItemContent = (props) => {
|
|
3048
|
+
const { thumbSrc, description, label } = props;
|
|
3049
|
+
return (jsxRuntime.jsxs(Container$1, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
|
|
2917
3050
|
};
|
|
2918
3051
|
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
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
|
-
};
|
|
3052
|
+
const StyledMenu = styled__default["default"](reactDropdowns.Menu) `
|
|
3053
|
+
width: auto !important;
|
|
3054
|
+
`;
|
|
3055
|
+
/**
|
|
3056
|
+
* A Menu is a wrapper for items elements
|
|
3057
|
+
**/
|
|
3058
|
+
const Menu = (props) => jsxRuntime.jsx(StyledMenu, Object.assign({}, props));
|
|
3059
|
+
// Extras
|
|
3060
|
+
const PreviousItem = (props) => (jsxRuntime.jsx(reactDropdowns.PreviousItem, Object.assign({}, props)));
|
|
3061
|
+
const Separator = (props) => (jsxRuntime.jsx(reactDropdowns.Separator, Object.assign({}, props)));
|
|
3062
|
+
const NextItem = (props) => jsxRuntime.jsx(reactDropdowns.NextItem, Object.assign({}, props));
|
|
3063
|
+
const ItemMeta = (props) => (jsxRuntime.jsx(reactDropdowns.ItemMeta, Object.assign({}, props)));
|
|
3064
|
+
const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.assign({}, props)));
|
|
3065
|
+
const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
|
|
3066
|
+
const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
|
|
2948
3067
|
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
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
|
-
};
|
|
3068
|
+
const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
|
|
3069
|
+
width: 100%;
|
|
3070
|
+
`;
|
|
3071
|
+
/**
|
|
3072
|
+
* Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
|
|
3073
|
+
* <hr>
|
|
3074
|
+
* Used for this:
|
|
3075
|
+
- To filter down a large list of options
|
|
3076
|
+
- To quickly find a known option
|
|
3077
|
+
* Not for this:
|
|
3078
|
+
- To make more than one selection, use Multiselect instead
|
|
3079
|
+
*/
|
|
3080
|
+
const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
|
|
2978
3081
|
|
|
2979
|
-
const
|
|
2980
|
-
|
|
2981
|
-
|
|
3082
|
+
const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
|
|
3083
|
+
/**
|
|
3084
|
+
* A Label is used to specify a title for an input.
|
|
3085
|
+
* <hr>
|
|
3086
|
+
**/
|
|
3087
|
+
const Label = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
|
|
2982
3088
|
|
|
2983
|
-
|
|
2984
|
-
:first-child {
|
|
2985
|
-
border-top-right-radius: 0;
|
|
2986
|
-
border-bottom-right-radius: 0;
|
|
2987
|
-
}
|
|
3089
|
+
const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
|
|
2988
3090
|
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3091
|
+
const UgSelect = styled__default["default"](reactDropdowns.Select) `
|
|
3092
|
+
${(props) => props.isPrimary &&
|
|
3093
|
+
`
|
|
3094
|
+
background-color: ${props.theme.palette.blue[600]};
|
|
3095
|
+
color: white;
|
|
3096
|
+
& svg[data-garden-id="forms.media_figure"] {
|
|
3097
|
+
color: white;
|
|
3098
|
+
}
|
|
3099
|
+
`}
|
|
3100
|
+
`;
|
|
3101
|
+
/**
|
|
3102
|
+
* Select allows a user to pick one option from a list. This helps simplify the UI when space is limited
|
|
3103
|
+
* <hr>
|
|
3104
|
+
* Used for this:
|
|
3105
|
+
- To make a selection from a list of options
|
|
3106
|
+
* Not for this:
|
|
3107
|
+
- To filter a large list of options, use Autocomplete instead
|
|
3108
|
+
- To make multiple selections from a list, use Multiselect instead
|
|
3109
|
+
- To select from a list on mobile, use a native Select instead
|
|
3110
|
+
*/
|
|
3111
|
+
const Select = (props) => jsxRuntime.jsx(UgSelect, Object.assign({}, props));
|
|
3112
|
+
const StyledDropdown = styled__default["default"].div `
|
|
3113
|
+
${StyledLabel$2} {
|
|
3114
|
+
display: block;
|
|
3115
|
+
}
|
|
3116
|
+
`;
|
|
3117
|
+
const StyledMenuHeaderItem = styled__default["default"](MenuHeaderItem) `
|
|
3118
|
+
pointer-events: none;
|
|
3119
|
+
`;
|
|
3120
|
+
const Dropdown = (props) => (jsxRuntime.jsx(StyledDropdown, { children: jsxRuntime.jsx(reactDropdowns.Dropdown, Object.assign({}, props)) }));
|
|
3121
|
+
const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign({}, props));
|
|
3122
|
+
Dropdown.HeaderItem = StyledMenuHeaderItem;
|
|
3123
|
+
Dropdown.Separator = Separator;
|
|
2993
3124
|
|
|
2994
|
-
|
|
2995
|
-
|
|
3125
|
+
const StyledAutocomplete = styled__default["default"](Autocomplete) `
|
|
3126
|
+
${(props) => props.hasSelectedItems &&
|
|
3127
|
+
`
|
|
3128
|
+
border-color: ${getColor(theme.colors.primaryHue, 600)};
|
|
3129
|
+
background-color: ${getColor(theme.colors.primaryHue, 600)};
|
|
3130
|
+
color: white;
|
|
3131
|
+
& > input, & > svg {
|
|
3132
|
+
color: ${props.theme.palette.white};
|
|
2996
3133
|
}
|
|
2997
|
-
}
|
|
3134
|
+
`}
|
|
2998
3135
|
`;
|
|
2999
|
-
const
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3136
|
+
const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
|
|
3137
|
+
var _a, _b;
|
|
3138
|
+
const [selectedItems, setSelectedItems] = React.useState(options.filter((o) => o.selected));
|
|
3139
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
3140
|
+
const [matchingOptions, setMatchingOptions] = React.useState(options);
|
|
3141
|
+
React.useEffect(() => {
|
|
3142
|
+
setMatchingOptions(options.filter((option) => option.label
|
|
3143
|
+
.trim()
|
|
3144
|
+
.toLowerCase()
|
|
3145
|
+
.indexOf(inputValue.trim().toLowerCase()) !== -1));
|
|
3146
|
+
}, [inputValue, options]);
|
|
3147
|
+
React.useEffect(() => {
|
|
3148
|
+
setSelectedItems(options.filter((o) => o.selected));
|
|
3149
|
+
}, [options]);
|
|
3150
|
+
const hasSelectedItems = selectedItems.length > 0;
|
|
3151
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: selectedItems, onSelect: (items) => {
|
|
3152
|
+
if (items) {
|
|
3153
|
+
setSelectedItems(items);
|
|
3154
|
+
if (onChange)
|
|
3155
|
+
onChange(items);
|
|
3156
|
+
}
|
|
3157
|
+
}, downshiftProps: {
|
|
3158
|
+
itemToString: (item) => item && item.itemId,
|
|
3159
|
+
}, onStateChange: (changes) => {
|
|
3160
|
+
if (changes.isOpen === false)
|
|
3161
|
+
setInputValue("");
|
|
3162
|
+
}, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
|
|
3163
|
+
? (i18n === null || i18n === void 0 ? void 0 : i18n.counterText)
|
|
3164
|
+
? i18n.counterText(selectedItems.length)
|
|
3165
|
+
: `Items (${selectedItems.length})`
|
|
3166
|
+
: (_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)))) }))] })) }));
|
|
3005
3167
|
};
|
|
3006
3168
|
|
|
3007
3169
|
const Header$1 = styled__default["default"].div `
|
|
@@ -3010,7 +3172,7 @@ const Header$1 = styled__default["default"].div `
|
|
|
3010
3172
|
padding: ${({ theme }) => theme.space.xs} ${({ theme }) => theme.space.md};
|
|
3011
3173
|
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
3012
3174
|
`;
|
|
3013
|
-
const Title
|
|
3175
|
+
const Title = styled__default["default"](MD) `
|
|
3014
3176
|
${props => reactTheming.retrieveComponentStyles("text.primary", props)}
|
|
3015
3177
|
${props => props.validation === "success" && reactTheming.retrieveComponentStyles("text.success", props)}
|
|
3016
3178
|
${props => props.validation === "warning" && reactTheming.retrieveComponentStyles("text.warning", props)}
|
|
@@ -3018,7 +3180,7 @@ const Title$1 = styled__default["default"](MD) `
|
|
|
3018
3180
|
`;
|
|
3019
3181
|
const EditorHeader = (props) => {
|
|
3020
3182
|
const { title, validation } = props;
|
|
3021
|
-
return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title
|
|
3183
|
+
return (jsxRuntime.jsx(Header$1, { children: jsxRuntime.jsx(Title, Object.assign({ isBold: true, validation: validation }, { children: title || "Write" })) }));
|
|
3022
3184
|
};
|
|
3023
3185
|
|
|
3024
3186
|
const Footer$2 = styled__default["default"].div `
|
|
@@ -3479,11 +3641,6 @@ const Spinner = (props) => jsxRuntime.jsx(UgSpinner, Object.assign({}, props));
|
|
|
3479
3641
|
*/
|
|
3480
3642
|
const Dots = (props) => jsxRuntime.jsx(reactLoaders.Dots, Object.assign({}, props));
|
|
3481
3643
|
|
|
3482
|
-
/**
|
|
3483
|
-
* Title is a basic component used to display a title. Often used in card headers.
|
|
3484
|
-
*/
|
|
3485
|
-
const Title = (props) => jsxRuntime.jsx(reactNotifications.Title, Object.assign({}, props));
|
|
3486
|
-
|
|
3487
3644
|
var _path$k;
|
|
3488
3645
|
function _extends$m() { _extends$m = 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$m.apply(this, arguments); }
|
|
3489
3646
|
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
@@ -3540,7 +3697,7 @@ const StyledCard = styled__default["default"](ContainerCard) `
|
|
|
3540
3697
|
const LoginForm = (props) => {
|
|
3541
3698
|
const { width } = useWindowSize();
|
|
3542
3699
|
const breakpointMd = parseInt(theme.breakpoints.md, 10);
|
|
3543
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledCard, Object.assign({}, (width > breakpointMd && { isFloating: true }), props.card, { children: [jsxRuntime.jsx(Title, Object.assign({ style: {
|
|
3700
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledCard, Object.assign({}, (width > breakpointMd && { isFloating: true }), props.card, { children: [jsxRuntime.jsx(Title$1, Object.assign({ style: {
|
|
3544
3701
|
textAlign: "center",
|
|
3545
3702
|
marginTop: theme.space.sm,
|
|
3546
3703
|
marginBottom: theme.space.lg,
|
|
@@ -4047,7 +4204,7 @@ const UgAnchor = styled__default["default"](reactButtons.Anchor).attrs((props) =
|
|
|
4047
4204
|
}) `
|
|
4048
4205
|
${(props) => reactTheming.retrieveComponentStyles(CLOSE_COMPONENT_ID, props)};
|
|
4049
4206
|
`;
|
|
4050
|
-
const UgTitle = styled__default["default"](Title).attrs((props) => {
|
|
4207
|
+
const UgTitle = styled__default["default"](Title$1).attrs((props) => {
|
|
4051
4208
|
var _a;
|
|
4052
4209
|
return ({
|
|
4053
4210
|
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : TITLE_COMPONENT_ID,
|
|
@@ -5829,6 +5986,9 @@ exports.CampaignExperientialIcon = SvgCampaignExperiential;
|
|
|
5829
5986
|
exports.CampaignFunctionalIcon = SvgCampaignFunctional;
|
|
5830
5987
|
exports.Caption = Caption;
|
|
5831
5988
|
exports.Card = Card;
|
|
5989
|
+
exports.Chat = Chat;
|
|
5990
|
+
exports.ChatContext = ChatContext;
|
|
5991
|
+
exports.ChatProvider = ChatContextProvider;
|
|
5832
5992
|
exports.Checkbox = Checkbox;
|
|
5833
5993
|
exports.CheckboxCard = CheckboxCard;
|
|
5834
5994
|
exports.Chrome = Chrome;
|
|
@@ -5836,6 +5996,7 @@ exports.Close = Close;
|
|
|
5836
5996
|
exports.Code = Code;
|
|
5837
5997
|
exports.Col = Col;
|
|
5838
5998
|
exports.ColorSwatch = ColorSwatch;
|
|
5999
|
+
exports.Comment = Comment;
|
|
5839
6000
|
exports.ContainerCard = ContainerCard;
|
|
5840
6001
|
exports.Content = Content$1;
|
|
5841
6002
|
exports.CounterMultiselect = CounterMultiselect;
|
|
@@ -5938,7 +6099,7 @@ exports.TextLabel = TextLabel;
|
|
|
5938
6099
|
exports.Textarea = Textarea;
|
|
5939
6100
|
exports.Tiles = Tiles;
|
|
5940
6101
|
exports.Timeline = Timeline;
|
|
5941
|
-
exports.Title = Title;
|
|
6102
|
+
exports.Title = Title$1;
|
|
5942
6103
|
exports.ToastProvider = ToastProvider;
|
|
5943
6104
|
exports.Toggle = Toggle;
|
|
5944
6105
|
exports.Tooltip = Tooltip;
|
|
@@ -5952,4 +6113,5 @@ exports.XXXL = XXXL;
|
|
|
5952
6113
|
exports.cardCmponentStyle = cardCmponentStyle;
|
|
5953
6114
|
exports.getColor = getColor;
|
|
5954
6115
|
exports.theme = theme;
|
|
6116
|
+
exports.useChatContext = useChatContext;
|
|
5955
6117
|
exports.useToast = useToast;
|