@ballistix.digital/react-components 8.3.2 → 8.4.1-rc-100.0

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/dist/index.js CHANGED
@@ -25,6 +25,10 @@ var $iA2ta$lodashset = require("lodash/set");
25
25
  var $iA2ta$luxon = require("luxon");
26
26
  var $iA2ta$ballistixdigitalreacttailwindcssdatepicker = require("@ballistix.digital/react-tailwindcss-datepicker");
27
27
  var $iA2ta$formik = require("formik");
28
+ var $iA2ta$ishotkey = require("is-hotkey");
29
+ var $iA2ta$slate = require("slate");
30
+ var $iA2ta$slatehistory = require("slate-history");
31
+ var $iA2ta$slatereact = require("slate-react");
28
32
  var $iA2ta$reactdropzone = require("react-dropzone");
29
33
  var $iA2ta$ubilabsreactgeosuggest = require("@ubilabs/react-geosuggest");
30
34
 
@@ -90,6 +94,7 @@ $parcel$export(module.exports, "DateRangeMenuForm", () => $7d3977a96c400c32$expo
90
94
  $parcel$export(module.exports, "__DEPRECATED__CheckboxInputGroupForm", () => $03635ab4c6dbf412$export$2e2bcd8739ae039);
91
95
  $parcel$export(module.exports, "CheckboxInput", () => $831573d0f77f2d6b$export$2e2bcd8739ae039);
92
96
  $parcel$export(module.exports, "SwitchForm", () => $341e1fbf5ffaef7b$export$2e2bcd8739ae039);
97
+ $parcel$export(module.exports, "RichTextArea", () => $784e2eeeb6b1d65b$export$2e2bcd8739ae039);
93
98
  $parcel$export(module.exports, "FileInputGroupForm", () => $079d45c48b1515dd$export$2e2bcd8739ae039);
94
99
  $parcel$export(module.exports, "OpeningsHourInputGroupForm", () => $9f6cfd21b337aca9$export$2e2bcd8739ae039);
95
100
  $parcel$export(module.exports, "AddressInputGroupForm", () => $7fcfa1d90c4a7e45$export$2e2bcd8739ae039);
@@ -3629,6 +3634,7 @@ var $51d5596368acf759$var$TableList2 = function(props) {
3629
3634
  getGroupedRowModel: (0, $iA2ta$tanstackreacttable.getGroupedRowModel)(),
3630
3635
  getCoreRowModel: (0, $iA2ta$tanstackreacttable.getCoreRowModel)(),
3631
3636
  getSubRows: (_g = config.options) === null || _g === void 0 ? void 0 : _g.getSubRows,
3637
+ autoResetExpanded: false,
3632
3638
  columns: isDraggable ? $51d5596368acf759$var$__spreadArray([
3633
3639
  {
3634
3640
  id: 'drag-handle',
@@ -6202,11 +6208,458 @@ var $341e1fbf5ffaef7b$export$2e2bcd8739ae039 = $341e1fbf5ffaef7b$var$Switch;
6202
6208
 
6203
6209
 
6204
6210
 
6211
+
6212
+
6213
+
6214
+
6215
+
6216
+
6217
+ var $b964d0845ae86974$var$base = {
6218
+ container: '',
6219
+ textAreaWrapper: 'border border-input rounded-lg overflow-hidden border-palette-lightGray',
6220
+ readOnlyWrapper: 'prose prose-sm max-w-none',
6221
+ editor: {
6222
+ toolbar: {
6223
+ container: 'flex items-center gap-1 p-2 border-b border-border',
6224
+ button: 'h-6 w-6 text-[18px] hover:bg-gray-50 active:bg-gray-100 cursor-pointer rounded-sm',
6225
+ buttonActive: 'ring-2 ring-gray-900/10 bg-gray-100',
6226
+ icon: 'h-4! w-4!',
6227
+ divider: 'w-px h-6 bg-gray-200 mx-1'
6228
+ },
6229
+ area: {
6230
+ container: 'overflow-hidden p-4',
6231
+ editable: 'leading-7 focus:outline-none prose prose-sm max-w-none prose-headings:font-semibold prose-h1:text-2xl prose-h2:text-xl prose-p:my-3 prose-blockquote:my-3'
6232
+ }
6233
+ },
6234
+ elements: {
6235
+ blockquote: 'border-l-4 border-gray-300 pl-4 italic text-gray-600 bg-gray-50 rounded-r-md py-2 my-2',
6236
+ list: {
6237
+ bulleted: 'list-disc ml-6 space-y-1',
6238
+ numbered: 'list-decimal ml-6 space-y-1',
6239
+ item: ''
6240
+ },
6241
+ heading: {
6242
+ h1: 'text-2xl font-semibold tracking-tight',
6243
+ h2: 'text-xl font-semibold tracking-tight'
6244
+ },
6245
+ paragraph: '',
6246
+ code: 'px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-800 font-mono text-[0.85em]'
6247
+ },
6248
+ align: {
6249
+ left: 'text-left',
6250
+ center: 'text-center',
6251
+ right: 'text-right',
6252
+ justify: 'text-justify'
6253
+ },
6254
+ readOnly: {
6255
+ container: ''
6256
+ }
6257
+ };
6258
+ var $b964d0845ae86974$var$styles = $b964d0845ae86974$var$base;
6259
+ var $b964d0845ae86974$export$2e2bcd8739ae039 = $b964d0845ae86974$var$styles;
6260
+
6261
+
6262
+ var $784e2eeeb6b1d65b$var$__assign = undefined && undefined.__assign || function() {
6263
+ $784e2eeeb6b1d65b$var$__assign = Object.assign || function(t) {
6264
+ for(var s, i = 1, n = arguments.length; i < n; i++){
6265
+ s = arguments[i];
6266
+ for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6267
+ }
6268
+ return t;
6269
+ };
6270
+ return $784e2eeeb6b1d65b$var$__assign.apply(this, arguments);
6271
+ };
6272
+ var $784e2eeeb6b1d65b$var$HOTKEYS = {
6273
+ 'mod+b': 'bold',
6274
+ 'mod+i': 'italic',
6275
+ 'mod+u': 'underline',
6276
+ 'mod+`': 'code'
6277
+ };
6278
+ var $784e2eeeb6b1d65b$var$LIST_TYPES = [
6279
+ 'numbered-list',
6280
+ 'bulleted-list'
6281
+ ];
6282
+ var $784e2eeeb6b1d65b$var$TEXT_ALIGN_TYPES = [
6283
+ 'left',
6284
+ 'center',
6285
+ 'right',
6286
+ 'justify'
6287
+ ];
6288
+ var $784e2eeeb6b1d65b$var$TAG_BY_TYPE = {
6289
+ 'block-quote': 'blockquote',
6290
+ 'bulleted-list': 'ul',
6291
+ 'numbered-list': 'ol',
6292
+ 'heading-one': 'h1',
6293
+ 'heading-two': 'h2',
6294
+ 'list-item': 'li',
6295
+ paragraph: 'p'
6296
+ };
6297
+ var $784e2eeeb6b1d65b$var$CLASS_BY_TYPE = {
6298
+ 'block-quote': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.blockquote,
6299
+ 'bulleted-list': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.list.bulleted,
6300
+ 'numbered-list': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.list.numbered,
6301
+ 'heading-one': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.heading.h1,
6302
+ 'heading-two': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.heading.h2,
6303
+ 'list-item': (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.list.item,
6304
+ paragraph: (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.paragraph
6305
+ };
6306
+ var $784e2eeeb6b1d65b$var$isAlignType = function(format) {
6307
+ return $784e2eeeb6b1d65b$var$TEXT_ALIGN_TYPES.includes(format);
6308
+ };
6309
+ var $784e2eeeb6b1d65b$var$isListType = function(format) {
6310
+ return $784e2eeeb6b1d65b$var$LIST_TYPES.includes(format);
6311
+ };
6312
+ var $784e2eeeb6b1d65b$var$isAlignElement = function(element) {
6313
+ return 'align' in element;
6314
+ };
6315
+ var $784e2eeeb6b1d65b$var$createTagElement = function(tag, options) {
6316
+ var attributes = options.attributes, key = options.key, className = options.className, children = options.children;
6317
+ var props = attributes ? $784e2eeeb6b1d65b$var$__assign($784e2eeeb6b1d65b$var$__assign({}, attributes), {
6318
+ className: className
6319
+ }) : {
6320
+ key: key,
6321
+ className: className
6322
+ };
6323
+ return /*#__PURE__*/ (0, $iA2ta$react.createElement)(tag, props, children);
6324
+ };
6325
+ var $784e2eeeb6b1d65b$var$applyMarks = function(content, marks) {
6326
+ if (marks.bold) content = (0, $iA2ta$reactjsxruntime.jsx)("strong", {
6327
+ children: content
6328
+ });
6329
+ if (marks.code) content = (0, $iA2ta$reactjsxruntime.jsx)("code", {
6330
+ className: (0, $b964d0845ae86974$export$2e2bcd8739ae039).elements.code,
6331
+ children: content
6332
+ });
6333
+ if (marks.italic) content = (0, $iA2ta$reactjsxruntime.jsx)("em", {
6334
+ children: content
6335
+ });
6336
+ if (marks.underline) content = (0, $iA2ta$reactjsxruntime.jsx)("u", {
6337
+ children: content
6338
+ });
6339
+ return content;
6340
+ };
6341
+ var $784e2eeeb6b1d65b$var$renderRichNode = function(node, options) {
6342
+ if (options === void 0) options = {};
6343
+ var attributes = options.attributes, providedChildren = options.children, key = options.key;
6344
+ if ((0, $iA2ta$slate.Text).isText(node)) {
6345
+ var content = $784e2eeeb6b1d65b$var$applyMarks(providedChildren !== null && providedChildren !== void 0 ? providedChildren : node.text, node);
6346
+ return attributes ? (0, $iA2ta$reactjsxruntime.jsx)("span", $784e2eeeb6b1d65b$var$__assign({}, attributes, {
6347
+ children: content
6348
+ })) : (0, $iA2ta$reactjsxruntime.jsx)((0, $iA2ta$react.Fragment), {
6349
+ children: content
6350
+ }, key);
6351
+ }
6352
+ var element = node;
6353
+ var type = (0, $iA2ta$lodash.get)(element, 'type', 'paragraph');
6354
+ var tag = (0, $iA2ta$lodash.get)($784e2eeeb6b1d65b$var$TAG_BY_TYPE, type, 'p');
6355
+ var baseClass = (0, $iA2ta$lodash.get)($784e2eeeb6b1d65b$var$CLASS_BY_TYPE, type, $784e2eeeb6b1d65b$var$CLASS_BY_TYPE.paragraph);
6356
+ var alignClass = $784e2eeeb6b1d65b$var$isAlignElement(element) ? (0, $iA2ta$lodash.get)((0, $b964d0845ae86974$export$2e2bcd8739ae039).align, element.align, '') : '';
6357
+ var renderChildNode = function(childNode, index) {
6358
+ return $784e2eeeb6b1d65b$var$renderRichNode(childNode, {
6359
+ key: index
6360
+ });
6361
+ };
6362
+ var renderedChildren = providedChildren !== null && providedChildren !== void 0 ? providedChildren : (0, $iA2ta$lodash.map)(element.children, renderChildNode);
6363
+ // Merge any className Slate might pass in attributes (rare) with ours
6364
+ var mergedClassName = (0, $622cd2936b18c771$export$4370d69198e9314a)(baseClass, alignClass, attributes === null || attributes === void 0 ? void 0 : attributes.className);
6365
+ return $784e2eeeb6b1d65b$var$createTagElement(tag, {
6366
+ attributes: attributes,
6367
+ key: key,
6368
+ className: mergedClassName,
6369
+ children: renderedChildren
6370
+ });
6371
+ };
6372
+ var $784e2eeeb6b1d65b$var$RichTextArea = function(_a) {
6373
+ var _b = _a.name, name = _b === void 0 ? 'rich-text-area' : _b, _c = _a.initialValue, initialValue = _c === void 0 ? '[{"type":"paragraph","children":[{"text":"Hello from initial value. Edit me!"}]}]' : _c, onChange = _a.onChange, _d = _a.placeholder, placeholder = _d === void 0 ? "Type something\u2026" : _d, stylesOverrides = _a.styles, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, toolbarConfig = _a.toolbarConfig, //Header
6374
+ label = _a.label, description = _a.description, required = _a.required, isRequired = _a.isRequired, isOptionalLabelHidden = _a.isOptionalLabelHidden, //Footer
6375
+ hint = _a.hint, error = _a.error, isTouched = _a.isTouched;
6376
+ var styles = (0, $iA2ta$react.useMemo)(function() {
6377
+ var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $b964d0845ae86974$export$2e2bcd8739ae039));
6378
+ var keys = (0, $iA2ta$lodash.concat)((0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $b964d0845ae86974$export$2e2bcd8739ae039)), (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $3369f7d596d23d58$export$2e2bcd8739ae039).base), (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $65bb4d593718fcda$export$2e2bcd8739ae039).base));
6379
+ (0, $iA2ta$lodash.forEach)(keys, function(key) {
6380
+ (0, $iA2ta$lodash.set)(result, key, (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $iA2ta$lodash.get)((0, $b964d0845ae86974$export$2e2bcd8739ae039), key), (0, $iA2ta$lodash.get)(stylesOverrides, key)));
6381
+ });
6382
+ return result;
6383
+ }, [
6384
+ stylesOverrides
6385
+ ]);
6386
+ var defaultToolbarItems = (0, $iA2ta$react.useMemo)(function() {
6387
+ return [
6388
+ 'bold',
6389
+ 'italic',
6390
+ 'underline',
6391
+ 'code',
6392
+ 'heading-one',
6393
+ 'heading-two',
6394
+ 'block-quote',
6395
+ 'numbered-list',
6396
+ 'bulleted-list',
6397
+ 'left',
6398
+ 'center',
6399
+ 'right',
6400
+ 'justify'
6401
+ ];
6402
+ }, []);
6403
+ var enabledToolbarItems = (0, $iA2ta$react.useMemo)(function() {
6404
+ return (0, $iA2ta$lodash.uniq)(toolbarConfig !== null && toolbarConfig !== void 0 ? toolbarConfig : defaultToolbarItems);
6405
+ }, [
6406
+ toolbarConfig,
6407
+ defaultToolbarItems
6408
+ ]);
6409
+ var editor = (0, $iA2ta$react.useMemo)(function() {
6410
+ return (0, $iA2ta$slatehistory.withHistory)((0, $iA2ta$slatereact.withReact)((0, $iA2ta$slate.createEditor)()));
6411
+ }, []);
6412
+ var renderElement = (0, $iA2ta$react.useCallback)(function(_a) {
6413
+ var element = _a.element, attributes = _a.attributes, children = _a.children;
6414
+ return $784e2eeeb6b1d65b$var$renderRichNode(element, {
6415
+ attributes: attributes,
6416
+ children: children
6417
+ });
6418
+ }, []);
6419
+ var renderLeaf = (0, $iA2ta$react.useCallback)(function(_a) {
6420
+ var leaf = _a.leaf, attributes = _a.attributes, children = _a.children;
6421
+ return $784e2eeeb6b1d65b$var$renderRichNode(leaf, {
6422
+ attributes: attributes,
6423
+ children: children
6424
+ });
6425
+ }, []);
6426
+ var handleChange = (0, $iA2ta$react.useCallback)(function(newValue) {
6427
+ if (!onChange) return;
6428
+ onChange(JSON.stringify(newValue));
6429
+ }, [
6430
+ onChange
6431
+ ]);
6432
+ var parsedInitialValue = (0, $iA2ta$react.useMemo)(function() {
6433
+ try {
6434
+ return JSON.parse(initialValue);
6435
+ } catch (_a) {
6436
+ return [];
6437
+ }
6438
+ }, [
6439
+ initialValue
6440
+ ]);
6441
+ var generateMarkButton = (0, $iA2ta$react.useCallback)(function(format, icon) {
6442
+ return (0, $iA2ta$lodash.includes)(enabledToolbarItems, format) && (0, $iA2ta$reactjsxruntime.jsx)($784e2eeeb6b1d65b$var$Button, {
6443
+ active: $784e2eeeb6b1d65b$export$72001287e2a5b413(editor, format),
6444
+ onMouseDown: function() {
6445
+ return $784e2eeeb6b1d65b$export$797ad2667b8015a8(editor, format);
6446
+ },
6447
+ icon: icon
6448
+ });
6449
+ }, [
6450
+ enabledToolbarItems,
6451
+ editor
6452
+ ]);
6453
+ var generateBlockButton = (0, $iA2ta$react.useCallback)(function(format, icon) {
6454
+ return (0, $iA2ta$lodash.includes)(enabledToolbarItems, format) && (0, $iA2ta$reactjsxruntime.jsx)($784e2eeeb6b1d65b$var$BlockButton, {
6455
+ format: format,
6456
+ icon: icon
6457
+ });
6458
+ }, [
6459
+ enabledToolbarItems
6460
+ ]);
6461
+ var renderToolbarGroups = (0, $iA2ta$react.useCallback)(function() {
6462
+ var sections = [];
6463
+ var marks = (0, $iA2ta$lodash.compact)([
6464
+ generateMarkButton('bold', 'bold'),
6465
+ generateMarkButton('italic', 'italic'),
6466
+ generateMarkButton('underline', 'underline'),
6467
+ generateMarkButton('code', 'code')
6468
+ ]);
6469
+ if (!(0, $iA2ta$lodash.isEmpty)(marks)) sections.push(marks);
6470
+ var headings = (0, $iA2ta$lodash.compact)([
6471
+ generateBlockButton('heading-one', 'h1'),
6472
+ generateBlockButton('heading-two', 'h2'),
6473
+ generateBlockButton('block-quote', 'quote-left')
6474
+ ]);
6475
+ if (!(0, $iA2ta$lodash.isEmpty)(headings)) sections.push(headings);
6476
+ var lists = (0, $iA2ta$lodash.compact)([
6477
+ generateBlockButton('numbered-list', 'list-ol'),
6478
+ generateBlockButton('bulleted-list', 'list-ul')
6479
+ ]);
6480
+ if (!(0, $iA2ta$lodash.isEmpty)(lists)) sections.push(lists);
6481
+ var align = (0, $iA2ta$lodash.compact)([
6482
+ generateBlockButton('left', 'align-left'),
6483
+ generateBlockButton('center', 'align-center'),
6484
+ generateBlockButton('right', 'align-right'),
6485
+ generateBlockButton('justify', 'align-justify')
6486
+ ]);
6487
+ if (!(0, $iA2ta$lodash.isEmpty)(align)) sections.push(align);
6488
+ return sections.map(function(group, index) {
6489
+ return (0, $iA2ta$reactjsxruntime.jsxs)((0, $iA2ta$react.Fragment), {
6490
+ children: [
6491
+ index > 0 && (0, $iA2ta$reactjsxruntime.jsx)("div", {
6492
+ className: styles.editor.toolbar.divider
6493
+ }),
6494
+ group
6495
+ ]
6496
+ }, index);
6497
+ });
6498
+ }, [
6499
+ generateMarkButton,
6500
+ generateBlockButton,
6501
+ styles.editor.toolbar.divider
6502
+ ]);
6503
+ if (isReadOnly && (0, $iA2ta$lodash.isEmpty)(parsedInitialValue)) return null;
6504
+ return isReadOnly ? (0, $iA2ta$reactjsxruntime.jsx)("div", {
6505
+ className: styles.readOnlyWrapper,
6506
+ children: (0, $iA2ta$lodash.isArray)(parsedInitialValue) ? (0, $iA2ta$lodash.map)(parsedInitialValue, function(n, i) {
6507
+ return $784e2eeeb6b1d65b$var$renderRichNode(n, {
6508
+ key: i
6509
+ });
6510
+ }) : null
6511
+ }) : (0, $iA2ta$reactjsxruntime.jsxs)((0, $iA2ta$reactjsxruntime.Fragment), {
6512
+ children: [
6513
+ (0, $iA2ta$reactjsxruntime.jsx)((0, $9314e0aa7f1e874e$export$2e2bcd8739ae039), {
6514
+ name: name,
6515
+ label: label,
6516
+ required: required,
6517
+ isRequired: isRequired,
6518
+ isOptionalLabelHidden: isOptionalLabelHidden,
6519
+ styles: styles,
6520
+ description: description
6521
+ }),
6522
+ (0, $iA2ta$reactjsxruntime.jsx)((0, $iA2ta$slatereact.Slate), {
6523
+ editor: editor,
6524
+ initialValue: parsedInitialValue,
6525
+ onChange: handleChange,
6526
+ children: (0, $iA2ta$reactjsxruntime.jsxs)("div", {
6527
+ className: styles.textAreaWrapper,
6528
+ children: [
6529
+ (0, $iA2ta$reactjsxruntime.jsx)("div", {
6530
+ className: styles.editor.toolbar.container,
6531
+ children: renderToolbarGroups()
6532
+ }),
6533
+ (0, $iA2ta$reactjsxruntime.jsx)("div", {
6534
+ className: styles.editor.area.container,
6535
+ children: (0, $iA2ta$reactjsxruntime.jsx)((0, $iA2ta$slatereact.Editable), {
6536
+ renderElement: renderElement,
6537
+ renderLeaf: renderLeaf,
6538
+ className: styles.editor.area.editable,
6539
+ placeholder: placeholder,
6540
+ spellCheck: true,
6541
+ autoFocus: true,
6542
+ onKeyDown: function(event) {
6543
+ (0, $iA2ta$lodash.forEach)($784e2eeeb6b1d65b$var$HOTKEYS, function(mark, hotkey) {
6544
+ if ((0, ($parcel$interopDefault($iA2ta$ishotkey)))(hotkey, event)) {
6545
+ event.preventDefault();
6546
+ $784e2eeeb6b1d65b$export$797ad2667b8015a8(editor, mark);
6547
+ }
6548
+ });
6549
+ }
6550
+ })
6551
+ })
6552
+ ]
6553
+ })
6554
+ }),
6555
+ (0, $iA2ta$reactjsxruntime.jsx)((0, $dfbd7d015eae4218$export$2e2bcd8739ae039), {
6556
+ name: name,
6557
+ error: error,
6558
+ isTouched: isTouched,
6559
+ hint: hint,
6560
+ styles: styles
6561
+ })
6562
+ ]
6563
+ });
6564
+ };
6565
+ var $784e2eeeb6b1d65b$export$65eead07296cdb21 = function(editor, format) {
6566
+ var isActive = $784e2eeeb6b1d65b$export$d49b8615a8b45195(editor, format, $784e2eeeb6b1d65b$var$isAlignType(format) ? 'align' : 'type');
6567
+ var isList = $784e2eeeb6b1d65b$var$isListType(format);
6568
+ (0, $iA2ta$slate.Transforms).unwrapNodes(editor, {
6569
+ match: function(n) {
6570
+ return !(0, $iA2ta$slate.Editor).isEditor(n) && (0, $iA2ta$slate.Element).isElement(n) && $784e2eeeb6b1d65b$var$isListType(n.type) && !$784e2eeeb6b1d65b$var$isAlignType(format);
6571
+ },
6572
+ split: true
6573
+ });
6574
+ var newProperties = $784e2eeeb6b1d65b$var$isAlignType(format) ? {
6575
+ align: isActive ? undefined : format
6576
+ } : {
6577
+ type: isActive ? 'paragraph' : isList ? 'list-item' : format
6578
+ };
6579
+ (0, $iA2ta$slate.Transforms).setNodes(editor, newProperties);
6580
+ if (!isActive && isList) {
6581
+ var block = {
6582
+ type: format,
6583
+ children: []
6584
+ };
6585
+ (0, $iA2ta$slate.Transforms).wrapNodes(editor, block);
6586
+ }
6587
+ };
6588
+ var $784e2eeeb6b1d65b$export$797ad2667b8015a8 = function(editor, format) {
6589
+ var isActive = $784e2eeeb6b1d65b$export$72001287e2a5b413(editor, format);
6590
+ if (isActive) (0, $iA2ta$slate.Editor).removeMark(editor, format);
6591
+ else (0, $iA2ta$slate.Editor).addMark(editor, format, true);
6592
+ };
6593
+ var $784e2eeeb6b1d65b$export$d49b8615a8b45195 = function(editor, format, blockType) {
6594
+ if (blockType === void 0) blockType = 'type';
6595
+ var selection = editor.selection;
6596
+ if (!selection) return false;
6597
+ var match = Array.from((0, $iA2ta$slate.Editor).nodes(editor, {
6598
+ at: (0, $iA2ta$slate.Editor).unhangRange(editor, selection),
6599
+ match: function(n) {
6600
+ if (!(0, $iA2ta$slate.Editor).isEditor(n) && (0, $iA2ta$slate.Element).isElement(n)) {
6601
+ var element = n;
6602
+ if (blockType === 'align' && $784e2eeeb6b1d65b$var$isAlignElement(element)) return element.align === format;
6603
+ return element.type === format;
6604
+ }
6605
+ return false;
6606
+ }
6607
+ }))[0];
6608
+ return !!match;
6609
+ };
6610
+ var $784e2eeeb6b1d65b$export$72001287e2a5b413 = function(editor, format) {
6611
+ var marks = (0, $iA2ta$slate.Editor).marks(editor);
6612
+ return marks ? marks[format] === true : false;
6613
+ };
6614
+ var $784e2eeeb6b1d65b$var$Button = function(_a) {
6615
+ var active = _a.active, onMouseDown = _a.onMouseDown, icon = _a.icon;
6616
+ return (0, $iA2ta$reactjsxruntime.jsx)("button", {
6617
+ type: "button",
6618
+ "aria-pressed": active,
6619
+ className: (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $b964d0845ae86974$export$2e2bcd8739ae039).editor.toolbar.button, active && (0, $b964d0845ae86974$export$2e2bcd8739ae039).editor.toolbar.buttonActive),
6620
+ onMouseDown: function(e) {
6621
+ e.preventDefault();
6622
+ onMouseDown();
6623
+ },
6624
+ children: (0, $iA2ta$reactjsxruntime.jsx)((0, $2125901b4a9afff9$export$2e2bcd8739ae039), {
6625
+ accessor: icon,
6626
+ type: "solid",
6627
+ className: (0, $b964d0845ae86974$export$2e2bcd8739ae039).editor.toolbar.icon
6628
+ })
6629
+ });
6630
+ };
6631
+ var $784e2eeeb6b1d65b$var$BlockButton = function(_a) {
6632
+ var format = _a.format, icon = _a.icon;
6633
+ var editor = (0, $iA2ta$slatereact.useSlate)();
6634
+ var active = $784e2eeeb6b1d65b$export$d49b8615a8b45195(editor, format, $784e2eeeb6b1d65b$var$isAlignType(format) ? 'align' : 'type');
6635
+ var handleMouseDown = (0, $iA2ta$react.useCallback)(function() {
6636
+ return $784e2eeeb6b1d65b$export$65eead07296cdb21(editor, format);
6637
+ }, [
6638
+ editor,
6639
+ format
6640
+ ]);
6641
+ return (0, $iA2ta$reactjsxruntime.jsx)($784e2eeeb6b1d65b$var$Button, {
6642
+ active: active,
6643
+ onMouseDown: handleMouseDown,
6644
+ icon: icon
6645
+ });
6646
+ };
6647
+ var $784e2eeeb6b1d65b$export$2e2bcd8739ae039 = $784e2eeeb6b1d65b$var$RichTextArea;
6648
+
6649
+
6650
+
6651
+
6652
+
6653
+
6654
+
6655
+
6656
+
6205
6657
  var $8d406a8542925512$var$base = {
6206
6658
  container: '',
6207
6659
  head: 'flex justify-between',
6208
6660
  body: 'relative rounded-md my-2 cursor-pointer',
6209
6661
  foot: '',
6662
+ labelContainer: 'flex flex-col',
6210
6663
  label: 'block font-medium text-gray-900',
6211
6664
  hint: 'text-xs text-gray-500',
6212
6665
  leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
@@ -6290,7 +6743,7 @@ var $079d45c48b1515dd$var$__assign = undefined && undefined.__assign || function
6290
6743
  return $079d45c48b1515dd$var$__assign.apply(this, arguments);
6291
6744
  };
6292
6745
  var $079d45c48b1515dd$var$FileInputGroupForm = function(props) {
6293
- var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, required = props.required, value = props.value, max = props.max, error = props.error, isDisabled = props.isDisabled, _b = props.isRequired, isRequired = _b === void 0 ? false : _b, _c = props.isTouched, isTouched = _c === void 0 ? false : _c, _d = props.isMulti, isMulti = _d === void 0 ? false : _d, children = props.children, onChange = props.onChange, onBlur = props.onBlur, stylesOverrides = props.styles;
6746
+ var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, hint = props.hint, required = props.required, value = props.value, max = props.max, error = props.error, isDisabled = props.isDisabled, _b = props.isRequired, isRequired = _b === void 0 ? false : _b, _c = props.isTouched, isTouched = _c === void 0 ? false : _c, _d = props.isMulti, isMulti = _d === void 0 ? false : _d, children = props.children, onChange = props.onChange, onBlur = props.onBlur, stylesOverrides = props.styles;
6294
6747
  var isValid = error === undefined;
6295
6748
  var _e = (0, $iA2ta$react.useState)(false), isDragging = _e[0], setIsDragging = _e[1];
6296
6749
  var handleChangeInput = (0, $iA2ta$react.useCallback)(function(files) {
@@ -6355,10 +6808,19 @@ var $079d45c48b1515dd$var$FileInputGroupForm = function(props) {
6355
6808
  (0, $iA2ta$reactjsxruntime.jsxs)("div", {
6356
6809
  className: styles.head,
6357
6810
  children: [
6358
- label && (0, $iA2ta$reactjsxruntime.jsx)("label", {
6359
- htmlFor: name,
6360
- className: styles.label,
6361
- children: label
6811
+ label && (0, $iA2ta$reactjsxruntime.jsxs)("div", {
6812
+ className: styles.labelContainer,
6813
+ children: [
6814
+ (0, $iA2ta$reactjsxruntime.jsx)("label", {
6815
+ htmlFor: name,
6816
+ className: styles.label,
6817
+ children: label
6818
+ }),
6819
+ description && !(error && isTouched) && (0, $iA2ta$reactjsxruntime.jsx)("p", {
6820
+ className: styles.description,
6821
+ children: description
6822
+ })
6823
+ ]
6362
6824
  }),
6363
6825
  !required && !isRequired && typeof label === 'string' && (0, $iA2ta$reactjsxruntime.jsx)("span", {
6364
6826
  className: styles.hint,
@@ -6394,9 +6856,9 @@ var $079d45c48b1515dd$var$FileInputGroupForm = function(props) {
6394
6856
  (0, $iA2ta$reactjsxruntime.jsxs)("div", {
6395
6857
  className: styles.foot,
6396
6858
  children: [
6397
- description && !(error && isTouched) && (0, $iA2ta$reactjsxruntime.jsx)("p", {
6398
- className: styles.description,
6399
- children: description
6859
+ hint && !(error && isTouched) && (0, $iA2ta$reactjsxruntime.jsx)("p", {
6860
+ className: styles.hint,
6861
+ children: hint
6400
6862
  }),
6401
6863
  error && isTouched && (0, $iA2ta$reactjsxruntime.jsx)("p", {
6402
6864
  className: styles.error,