@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.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {jsx as $4MPRY$jsx, jsxs as $4MPRY$jsxs, Fragment as $4MPRY$Fragment} from "react/jsx-runtime";
2
2
  import {ArrowPathIcon as $4MPRY$ArrowPathIcon, ChevronDownIcon as $4MPRY$ChevronDownIcon, EllipsisVerticalIcon as $4MPRY$EllipsisVerticalIcon, ExclamationCircleIcon as $4MPRY$ExclamationCircleIcon, ChevronDoubleLeftIcon as $4MPRY$ChevronDoubleLeftIcon, ChevronLeftIcon as $4MPRY$ChevronLeftIcon, ChevronRightIcon as $4MPRY$ChevronRightIcon, ChevronDoubleRightIcon as $4MPRY$ChevronDoubleRightIcon, ChevronUpDownIcon as $4MPRY$ChevronUpDownIcon, ChevronUpIcon as $4MPRY$ChevronUpIcon, HomeIcon as $4MPRY$HomeIcon, ArrowLongLeftIcon as $4MPRY$ArrowLongLeftIcon, ArrowLongRightIcon as $4MPRY$ArrowLongRightIcon} from "@heroicons/react/20/solid";
3
- import {set as $4MPRY$set, get as $4MPRY$get, isArray as $4MPRY$isArray, map as $4MPRY$map, padStart as $4MPRY$padStart, concat as $4MPRY$concat, isNil as $4MPRY$isNil, noop as $4MPRY$noop, toSafeInteger as $4MPRY$toSafeInteger, indexOf as $4MPRY$indexOf, compact as $4MPRY$compact, forEach as $4MPRY$forEach, assign as $4MPRY$assign, includes as $4MPRY$includes, isEmpty as $4MPRY$isEmpty, some as $4MPRY$some, findIndex as $4MPRY$findIndex, last as $4MPRY$last, first as $4MPRY$first, find as $4MPRY$find, times as $4MPRY$times, pick as $4MPRY$pick, intersection as $4MPRY$intersection, trim as $4MPRY$trim, lastIndexOf as $4MPRY$lastIndexOf} from "lodash";
4
- import $4MPRY$react, {useState as $4MPRY$useState, useMemo as $4MPRY$useMemo, useRef as $4MPRY$useRef, Children as $4MPRY$Children, Fragment as $4MPRY$Fragment1, useCallback as $4MPRY$useCallback, useEffect as $4MPRY$useEffect} from "react";
3
+ import {set as $4MPRY$set, get as $4MPRY$get, isArray as $4MPRY$isArray, map as $4MPRY$map, padStart as $4MPRY$padStart, concat as $4MPRY$concat, isNil as $4MPRY$isNil, noop as $4MPRY$noop, toSafeInteger as $4MPRY$toSafeInteger, indexOf as $4MPRY$indexOf, compact as $4MPRY$compact, forEach as $4MPRY$forEach, assign as $4MPRY$assign, includes as $4MPRY$includes, isEmpty as $4MPRY$isEmpty, some as $4MPRY$some, findIndex as $4MPRY$findIndex, last as $4MPRY$last, first as $4MPRY$first, find as $4MPRY$find, times as $4MPRY$times, pick as $4MPRY$pick, intersection as $4MPRY$intersection, uniq as $4MPRY$uniq, trim as $4MPRY$trim, lastIndexOf as $4MPRY$lastIndexOf} from "lodash";
4
+ import $4MPRY$react, {useState as $4MPRY$useState, useMemo as $4MPRY$useMemo, useRef as $4MPRY$useRef, Children as $4MPRY$Children, Fragment as $4MPRY$Fragment1, useCallback as $4MPRY$useCallback, useEffect as $4MPRY$useEffect, createElement as $4MPRY$createElement} from "react";
5
5
  import $4MPRY$lodashget from "lodash/get";
6
6
  import {library as $4MPRY$library} from "@fortawesome/fontawesome-svg-core";
7
7
  import {fab as $4MPRY$fab} from "@fortawesome/free-brands-svg-icons";
@@ -25,6 +25,10 @@ import $4MPRY$lodashset from "lodash/set";
25
25
  import {DateTime as $4MPRY$DateTime} from "luxon";
26
26
  import $4MPRY$ballistixdigitalreacttailwindcssdatepicker from "@ballistix.digital/react-tailwindcss-datepicker";
27
27
  import {FormikProvider as $4MPRY$FormikProvider, FieldArray as $4MPRY$FieldArray, useFormik as $4MPRY$useFormik} from "formik";
28
+ import $4MPRY$ishotkey from "is-hotkey";
29
+ import {Text as $4MPRY$Text, createEditor as $4MPRY$createEditor, Transforms as $4MPRY$Transforms, Editor as $4MPRY$Editor, Element as $4MPRY$Element} from "slate";
30
+ import {withHistory as $4MPRY$withHistory} from "slate-history";
31
+ import {withReact as $4MPRY$withReact, Slate as $4MPRY$Slate, Editable as $4MPRY$Editable, useSlate as $4MPRY$useSlate} from "slate-react";
28
32
  import {useDropzone as $4MPRY$useDropzone} from "react-dropzone";
29
33
  import $4MPRY$ubilabsreactgeosuggest from "@ubilabs/react-geosuggest";
30
34
 
@@ -3560,6 +3564,7 @@ var $df469b72efb8986e$var$TableList2 = function(props) {
3560
3564
  getGroupedRowModel: (0, $4MPRY$getGroupedRowModel)(),
3561
3565
  getCoreRowModel: (0, $4MPRY$getCoreRowModel)(),
3562
3566
  getSubRows: (_g = config.options) === null || _g === void 0 ? void 0 : _g.getSubRows,
3567
+ autoResetExpanded: false,
3563
3568
  columns: isDraggable ? $df469b72efb8986e$var$__spreadArray([
3564
3569
  {
3565
3570
  id: 'drag-handle',
@@ -6133,11 +6138,458 @@ var $10ded3c19afe27a9$export$2e2bcd8739ae039 = $10ded3c19afe27a9$var$Switch;
6133
6138
 
6134
6139
 
6135
6140
 
6141
+
6142
+
6143
+
6144
+
6145
+
6146
+
6147
+ var $293d351fa67aae30$var$base = {
6148
+ container: '',
6149
+ textAreaWrapper: 'border border-input rounded-lg overflow-hidden border-palette-lightGray',
6150
+ readOnlyWrapper: 'prose prose-sm max-w-none',
6151
+ editor: {
6152
+ toolbar: {
6153
+ container: 'flex items-center gap-1 p-2 border-b border-border',
6154
+ button: 'h-6 w-6 text-[18px] hover:bg-gray-50 active:bg-gray-100 cursor-pointer rounded-sm',
6155
+ buttonActive: 'ring-2 ring-gray-900/10 bg-gray-100',
6156
+ icon: 'h-4! w-4!',
6157
+ divider: 'w-px h-6 bg-gray-200 mx-1'
6158
+ },
6159
+ area: {
6160
+ container: 'overflow-hidden p-4',
6161
+ 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'
6162
+ }
6163
+ },
6164
+ elements: {
6165
+ blockquote: 'border-l-4 border-gray-300 pl-4 italic text-gray-600 bg-gray-50 rounded-r-md py-2 my-2',
6166
+ list: {
6167
+ bulleted: 'list-disc ml-6 space-y-1',
6168
+ numbered: 'list-decimal ml-6 space-y-1',
6169
+ item: ''
6170
+ },
6171
+ heading: {
6172
+ h1: 'text-2xl font-semibold tracking-tight',
6173
+ h2: 'text-xl font-semibold tracking-tight'
6174
+ },
6175
+ paragraph: '',
6176
+ code: 'px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-800 font-mono text-[0.85em]'
6177
+ },
6178
+ align: {
6179
+ left: 'text-left',
6180
+ center: 'text-center',
6181
+ right: 'text-right',
6182
+ justify: 'text-justify'
6183
+ },
6184
+ readOnly: {
6185
+ container: ''
6186
+ }
6187
+ };
6188
+ var $293d351fa67aae30$var$styles = $293d351fa67aae30$var$base;
6189
+ var $293d351fa67aae30$export$2e2bcd8739ae039 = $293d351fa67aae30$var$styles;
6190
+
6191
+
6192
+ var $aa6702347bcd9c62$var$__assign = undefined && undefined.__assign || function() {
6193
+ $aa6702347bcd9c62$var$__assign = Object.assign || function(t) {
6194
+ for(var s, i = 1, n = arguments.length; i < n; i++){
6195
+ s = arguments[i];
6196
+ for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6197
+ }
6198
+ return t;
6199
+ };
6200
+ return $aa6702347bcd9c62$var$__assign.apply(this, arguments);
6201
+ };
6202
+ var $aa6702347bcd9c62$var$HOTKEYS = {
6203
+ 'mod+b': 'bold',
6204
+ 'mod+i': 'italic',
6205
+ 'mod+u': 'underline',
6206
+ 'mod+`': 'code'
6207
+ };
6208
+ var $aa6702347bcd9c62$var$LIST_TYPES = [
6209
+ 'numbered-list',
6210
+ 'bulleted-list'
6211
+ ];
6212
+ var $aa6702347bcd9c62$var$TEXT_ALIGN_TYPES = [
6213
+ 'left',
6214
+ 'center',
6215
+ 'right',
6216
+ 'justify'
6217
+ ];
6218
+ var $aa6702347bcd9c62$var$TAG_BY_TYPE = {
6219
+ 'block-quote': 'blockquote',
6220
+ 'bulleted-list': 'ul',
6221
+ 'numbered-list': 'ol',
6222
+ 'heading-one': 'h1',
6223
+ 'heading-two': 'h2',
6224
+ 'list-item': 'li',
6225
+ paragraph: 'p'
6226
+ };
6227
+ var $aa6702347bcd9c62$var$CLASS_BY_TYPE = {
6228
+ 'block-quote': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.blockquote,
6229
+ 'bulleted-list': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.list.bulleted,
6230
+ 'numbered-list': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.list.numbered,
6231
+ 'heading-one': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.heading.h1,
6232
+ 'heading-two': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.heading.h2,
6233
+ 'list-item': (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.list.item,
6234
+ paragraph: (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.paragraph
6235
+ };
6236
+ var $aa6702347bcd9c62$var$isAlignType = function(format) {
6237
+ return $aa6702347bcd9c62$var$TEXT_ALIGN_TYPES.includes(format);
6238
+ };
6239
+ var $aa6702347bcd9c62$var$isListType = function(format) {
6240
+ return $aa6702347bcd9c62$var$LIST_TYPES.includes(format);
6241
+ };
6242
+ var $aa6702347bcd9c62$var$isAlignElement = function(element) {
6243
+ return 'align' in element;
6244
+ };
6245
+ var $aa6702347bcd9c62$var$createTagElement = function(tag, options) {
6246
+ var attributes = options.attributes, key = options.key, className = options.className, children = options.children;
6247
+ var props = attributes ? $aa6702347bcd9c62$var$__assign($aa6702347bcd9c62$var$__assign({}, attributes), {
6248
+ className: className
6249
+ }) : {
6250
+ key: key,
6251
+ className: className
6252
+ };
6253
+ return /*#__PURE__*/ (0, $4MPRY$createElement)(tag, props, children);
6254
+ };
6255
+ var $aa6702347bcd9c62$var$applyMarks = function(content, marks) {
6256
+ if (marks.bold) content = (0, $4MPRY$jsx)("strong", {
6257
+ children: content
6258
+ });
6259
+ if (marks.code) content = (0, $4MPRY$jsx)("code", {
6260
+ className: (0, $293d351fa67aae30$export$2e2bcd8739ae039).elements.code,
6261
+ children: content
6262
+ });
6263
+ if (marks.italic) content = (0, $4MPRY$jsx)("em", {
6264
+ children: content
6265
+ });
6266
+ if (marks.underline) content = (0, $4MPRY$jsx)("u", {
6267
+ children: content
6268
+ });
6269
+ return content;
6270
+ };
6271
+ var $aa6702347bcd9c62$var$renderRichNode = function(node, options) {
6272
+ if (options === void 0) options = {};
6273
+ var attributes = options.attributes, providedChildren = options.children, key = options.key;
6274
+ if ((0, $4MPRY$Text).isText(node)) {
6275
+ var content = $aa6702347bcd9c62$var$applyMarks(providedChildren !== null && providedChildren !== void 0 ? providedChildren : node.text, node);
6276
+ return attributes ? (0, $4MPRY$jsx)("span", $aa6702347bcd9c62$var$__assign({}, attributes, {
6277
+ children: content
6278
+ })) : (0, $4MPRY$jsx)((0, $4MPRY$Fragment1), {
6279
+ children: content
6280
+ }, key);
6281
+ }
6282
+ var element = node;
6283
+ var type = (0, $4MPRY$get)(element, 'type', 'paragraph');
6284
+ var tag = (0, $4MPRY$get)($aa6702347bcd9c62$var$TAG_BY_TYPE, type, 'p');
6285
+ var baseClass = (0, $4MPRY$get)($aa6702347bcd9c62$var$CLASS_BY_TYPE, type, $aa6702347bcd9c62$var$CLASS_BY_TYPE.paragraph);
6286
+ var alignClass = $aa6702347bcd9c62$var$isAlignElement(element) ? (0, $4MPRY$get)((0, $293d351fa67aae30$export$2e2bcd8739ae039).align, element.align, '') : '';
6287
+ var renderChildNode = function(childNode, index) {
6288
+ return $aa6702347bcd9c62$var$renderRichNode(childNode, {
6289
+ key: index
6290
+ });
6291
+ };
6292
+ var renderedChildren = providedChildren !== null && providedChildren !== void 0 ? providedChildren : (0, $4MPRY$map)(element.children, renderChildNode);
6293
+ // Merge any className Slate might pass in attributes (rare) with ours
6294
+ var mergedClassName = (0, $66c3dcaaa74b5389$export$4370d69198e9314a)(baseClass, alignClass, attributes === null || attributes === void 0 ? void 0 : attributes.className);
6295
+ return $aa6702347bcd9c62$var$createTagElement(tag, {
6296
+ attributes: attributes,
6297
+ key: key,
6298
+ className: mergedClassName,
6299
+ children: renderedChildren
6300
+ });
6301
+ };
6302
+ var $aa6702347bcd9c62$var$RichTextArea = function(_a) {
6303
+ 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
6304
+ label = _a.label, description = _a.description, required = _a.required, isRequired = _a.isRequired, isOptionalLabelHidden = _a.isOptionalLabelHidden, //Footer
6305
+ hint = _a.hint, error = _a.error, isTouched = _a.isTouched;
6306
+ var styles = (0, $4MPRY$useMemo)(function() {
6307
+ var result = (0, $b3fc44f26b625a32$export$e2d2075c69d9100d)((0, $293d351fa67aae30$export$2e2bcd8739ae039));
6308
+ var keys = (0, $4MPRY$concat)((0, $ba1db6dce71c3f25$export$be5d6ab3c5b84767)((0, $293d351fa67aae30$export$2e2bcd8739ae039)), (0, $ba1db6dce71c3f25$export$be5d6ab3c5b84767)((0, $26a2a503969671d2$export$2e2bcd8739ae039).base), (0, $ba1db6dce71c3f25$export$be5d6ab3c5b84767)((0, $495392c79d755f40$export$2e2bcd8739ae039).base));
6309
+ (0, $4MPRY$forEach)(keys, function(key) {
6310
+ (0, $4MPRY$set)(result, key, (0, $66c3dcaaa74b5389$export$4370d69198e9314a)((0, $4MPRY$get)((0, $293d351fa67aae30$export$2e2bcd8739ae039), key), (0, $4MPRY$get)(stylesOverrides, key)));
6311
+ });
6312
+ return result;
6313
+ }, [
6314
+ stylesOverrides
6315
+ ]);
6316
+ var defaultToolbarItems = (0, $4MPRY$useMemo)(function() {
6317
+ return [
6318
+ 'bold',
6319
+ 'italic',
6320
+ 'underline',
6321
+ 'code',
6322
+ 'heading-one',
6323
+ 'heading-two',
6324
+ 'block-quote',
6325
+ 'numbered-list',
6326
+ 'bulleted-list',
6327
+ 'left',
6328
+ 'center',
6329
+ 'right',
6330
+ 'justify'
6331
+ ];
6332
+ }, []);
6333
+ var enabledToolbarItems = (0, $4MPRY$useMemo)(function() {
6334
+ return (0, $4MPRY$uniq)(toolbarConfig !== null && toolbarConfig !== void 0 ? toolbarConfig : defaultToolbarItems);
6335
+ }, [
6336
+ toolbarConfig,
6337
+ defaultToolbarItems
6338
+ ]);
6339
+ var editor = (0, $4MPRY$useMemo)(function() {
6340
+ return (0, $4MPRY$withHistory)((0, $4MPRY$withReact)((0, $4MPRY$createEditor)()));
6341
+ }, []);
6342
+ var renderElement = (0, $4MPRY$useCallback)(function(_a) {
6343
+ var element = _a.element, attributes = _a.attributes, children = _a.children;
6344
+ return $aa6702347bcd9c62$var$renderRichNode(element, {
6345
+ attributes: attributes,
6346
+ children: children
6347
+ });
6348
+ }, []);
6349
+ var renderLeaf = (0, $4MPRY$useCallback)(function(_a) {
6350
+ var leaf = _a.leaf, attributes = _a.attributes, children = _a.children;
6351
+ return $aa6702347bcd9c62$var$renderRichNode(leaf, {
6352
+ attributes: attributes,
6353
+ children: children
6354
+ });
6355
+ }, []);
6356
+ var handleChange = (0, $4MPRY$useCallback)(function(newValue) {
6357
+ if (!onChange) return;
6358
+ onChange(JSON.stringify(newValue));
6359
+ }, [
6360
+ onChange
6361
+ ]);
6362
+ var parsedInitialValue = (0, $4MPRY$useMemo)(function() {
6363
+ try {
6364
+ return JSON.parse(initialValue);
6365
+ } catch (_a) {
6366
+ return [];
6367
+ }
6368
+ }, [
6369
+ initialValue
6370
+ ]);
6371
+ var generateMarkButton = (0, $4MPRY$useCallback)(function(format, icon) {
6372
+ return (0, $4MPRY$includes)(enabledToolbarItems, format) && (0, $4MPRY$jsx)($aa6702347bcd9c62$var$Button, {
6373
+ active: $aa6702347bcd9c62$export$72001287e2a5b413(editor, format),
6374
+ onMouseDown: function() {
6375
+ return $aa6702347bcd9c62$export$797ad2667b8015a8(editor, format);
6376
+ },
6377
+ icon: icon
6378
+ });
6379
+ }, [
6380
+ enabledToolbarItems,
6381
+ editor
6382
+ ]);
6383
+ var generateBlockButton = (0, $4MPRY$useCallback)(function(format, icon) {
6384
+ return (0, $4MPRY$includes)(enabledToolbarItems, format) && (0, $4MPRY$jsx)($aa6702347bcd9c62$var$BlockButton, {
6385
+ format: format,
6386
+ icon: icon
6387
+ });
6388
+ }, [
6389
+ enabledToolbarItems
6390
+ ]);
6391
+ var renderToolbarGroups = (0, $4MPRY$useCallback)(function() {
6392
+ var sections = [];
6393
+ var marks = (0, $4MPRY$compact)([
6394
+ generateMarkButton('bold', 'bold'),
6395
+ generateMarkButton('italic', 'italic'),
6396
+ generateMarkButton('underline', 'underline'),
6397
+ generateMarkButton('code', 'code')
6398
+ ]);
6399
+ if (!(0, $4MPRY$isEmpty)(marks)) sections.push(marks);
6400
+ var headings = (0, $4MPRY$compact)([
6401
+ generateBlockButton('heading-one', 'h1'),
6402
+ generateBlockButton('heading-two', 'h2'),
6403
+ generateBlockButton('block-quote', 'quote-left')
6404
+ ]);
6405
+ if (!(0, $4MPRY$isEmpty)(headings)) sections.push(headings);
6406
+ var lists = (0, $4MPRY$compact)([
6407
+ generateBlockButton('numbered-list', 'list-ol'),
6408
+ generateBlockButton('bulleted-list', 'list-ul')
6409
+ ]);
6410
+ if (!(0, $4MPRY$isEmpty)(lists)) sections.push(lists);
6411
+ var align = (0, $4MPRY$compact)([
6412
+ generateBlockButton('left', 'align-left'),
6413
+ generateBlockButton('center', 'align-center'),
6414
+ generateBlockButton('right', 'align-right'),
6415
+ generateBlockButton('justify', 'align-justify')
6416
+ ]);
6417
+ if (!(0, $4MPRY$isEmpty)(align)) sections.push(align);
6418
+ return sections.map(function(group, index) {
6419
+ return (0, $4MPRY$jsxs)((0, $4MPRY$Fragment1), {
6420
+ children: [
6421
+ index > 0 && (0, $4MPRY$jsx)("div", {
6422
+ className: styles.editor.toolbar.divider
6423
+ }),
6424
+ group
6425
+ ]
6426
+ }, index);
6427
+ });
6428
+ }, [
6429
+ generateMarkButton,
6430
+ generateBlockButton,
6431
+ styles.editor.toolbar.divider
6432
+ ]);
6433
+ if (isReadOnly && (0, $4MPRY$isEmpty)(parsedInitialValue)) return null;
6434
+ return isReadOnly ? (0, $4MPRY$jsx)("div", {
6435
+ className: styles.readOnlyWrapper,
6436
+ children: (0, $4MPRY$isArray)(parsedInitialValue) ? (0, $4MPRY$map)(parsedInitialValue, function(n, i) {
6437
+ return $aa6702347bcd9c62$var$renderRichNode(n, {
6438
+ key: i
6439
+ });
6440
+ }) : null
6441
+ }) : (0, $4MPRY$jsxs)((0, $4MPRY$Fragment), {
6442
+ children: [
6443
+ (0, $4MPRY$jsx)((0, $38b37a8c0b4bec9d$export$2e2bcd8739ae039), {
6444
+ name: name,
6445
+ label: label,
6446
+ required: required,
6447
+ isRequired: isRequired,
6448
+ isOptionalLabelHidden: isOptionalLabelHidden,
6449
+ styles: styles,
6450
+ description: description
6451
+ }),
6452
+ (0, $4MPRY$jsx)((0, $4MPRY$Slate), {
6453
+ editor: editor,
6454
+ initialValue: parsedInitialValue,
6455
+ onChange: handleChange,
6456
+ children: (0, $4MPRY$jsxs)("div", {
6457
+ className: styles.textAreaWrapper,
6458
+ children: [
6459
+ (0, $4MPRY$jsx)("div", {
6460
+ className: styles.editor.toolbar.container,
6461
+ children: renderToolbarGroups()
6462
+ }),
6463
+ (0, $4MPRY$jsx)("div", {
6464
+ className: styles.editor.area.container,
6465
+ children: (0, $4MPRY$jsx)((0, $4MPRY$Editable), {
6466
+ renderElement: renderElement,
6467
+ renderLeaf: renderLeaf,
6468
+ className: styles.editor.area.editable,
6469
+ placeholder: placeholder,
6470
+ spellCheck: true,
6471
+ autoFocus: true,
6472
+ onKeyDown: function(event) {
6473
+ (0, $4MPRY$forEach)($aa6702347bcd9c62$var$HOTKEYS, function(mark, hotkey) {
6474
+ if ((0, $4MPRY$ishotkey)(hotkey, event)) {
6475
+ event.preventDefault();
6476
+ $aa6702347bcd9c62$export$797ad2667b8015a8(editor, mark);
6477
+ }
6478
+ });
6479
+ }
6480
+ })
6481
+ })
6482
+ ]
6483
+ })
6484
+ }),
6485
+ (0, $4MPRY$jsx)((0, $3b70ba41b110d1fa$export$2e2bcd8739ae039), {
6486
+ name: name,
6487
+ error: error,
6488
+ isTouched: isTouched,
6489
+ hint: hint,
6490
+ styles: styles
6491
+ })
6492
+ ]
6493
+ });
6494
+ };
6495
+ var $aa6702347bcd9c62$export$65eead07296cdb21 = function(editor, format) {
6496
+ var isActive = $aa6702347bcd9c62$export$d49b8615a8b45195(editor, format, $aa6702347bcd9c62$var$isAlignType(format) ? 'align' : 'type');
6497
+ var isList = $aa6702347bcd9c62$var$isListType(format);
6498
+ (0, $4MPRY$Transforms).unwrapNodes(editor, {
6499
+ match: function(n) {
6500
+ return !(0, $4MPRY$Editor).isEditor(n) && (0, $4MPRY$Element).isElement(n) && $aa6702347bcd9c62$var$isListType(n.type) && !$aa6702347bcd9c62$var$isAlignType(format);
6501
+ },
6502
+ split: true
6503
+ });
6504
+ var newProperties = $aa6702347bcd9c62$var$isAlignType(format) ? {
6505
+ align: isActive ? undefined : format
6506
+ } : {
6507
+ type: isActive ? 'paragraph' : isList ? 'list-item' : format
6508
+ };
6509
+ (0, $4MPRY$Transforms).setNodes(editor, newProperties);
6510
+ if (!isActive && isList) {
6511
+ var block = {
6512
+ type: format,
6513
+ children: []
6514
+ };
6515
+ (0, $4MPRY$Transforms).wrapNodes(editor, block);
6516
+ }
6517
+ };
6518
+ var $aa6702347bcd9c62$export$797ad2667b8015a8 = function(editor, format) {
6519
+ var isActive = $aa6702347bcd9c62$export$72001287e2a5b413(editor, format);
6520
+ if (isActive) (0, $4MPRY$Editor).removeMark(editor, format);
6521
+ else (0, $4MPRY$Editor).addMark(editor, format, true);
6522
+ };
6523
+ var $aa6702347bcd9c62$export$d49b8615a8b45195 = function(editor, format, blockType) {
6524
+ if (blockType === void 0) blockType = 'type';
6525
+ var selection = editor.selection;
6526
+ if (!selection) return false;
6527
+ var match = Array.from((0, $4MPRY$Editor).nodes(editor, {
6528
+ at: (0, $4MPRY$Editor).unhangRange(editor, selection),
6529
+ match: function(n) {
6530
+ if (!(0, $4MPRY$Editor).isEditor(n) && (0, $4MPRY$Element).isElement(n)) {
6531
+ var element = n;
6532
+ if (blockType === 'align' && $aa6702347bcd9c62$var$isAlignElement(element)) return element.align === format;
6533
+ return element.type === format;
6534
+ }
6535
+ return false;
6536
+ }
6537
+ }))[0];
6538
+ return !!match;
6539
+ };
6540
+ var $aa6702347bcd9c62$export$72001287e2a5b413 = function(editor, format) {
6541
+ var marks = (0, $4MPRY$Editor).marks(editor);
6542
+ return marks ? marks[format] === true : false;
6543
+ };
6544
+ var $aa6702347bcd9c62$var$Button = function(_a) {
6545
+ var active = _a.active, onMouseDown = _a.onMouseDown, icon = _a.icon;
6546
+ return (0, $4MPRY$jsx)("button", {
6547
+ type: "button",
6548
+ "aria-pressed": active,
6549
+ className: (0, $66c3dcaaa74b5389$export$4370d69198e9314a)((0, $293d351fa67aae30$export$2e2bcd8739ae039).editor.toolbar.button, active && (0, $293d351fa67aae30$export$2e2bcd8739ae039).editor.toolbar.buttonActive),
6550
+ onMouseDown: function(e) {
6551
+ e.preventDefault();
6552
+ onMouseDown();
6553
+ },
6554
+ children: (0, $4MPRY$jsx)((0, $77cd4416ca4a0639$export$2e2bcd8739ae039), {
6555
+ accessor: icon,
6556
+ type: "solid",
6557
+ className: (0, $293d351fa67aae30$export$2e2bcd8739ae039).editor.toolbar.icon
6558
+ })
6559
+ });
6560
+ };
6561
+ var $aa6702347bcd9c62$var$BlockButton = function(_a) {
6562
+ var format = _a.format, icon = _a.icon;
6563
+ var editor = (0, $4MPRY$useSlate)();
6564
+ var active = $aa6702347bcd9c62$export$d49b8615a8b45195(editor, format, $aa6702347bcd9c62$var$isAlignType(format) ? 'align' : 'type');
6565
+ var handleMouseDown = (0, $4MPRY$useCallback)(function() {
6566
+ return $aa6702347bcd9c62$export$65eead07296cdb21(editor, format);
6567
+ }, [
6568
+ editor,
6569
+ format
6570
+ ]);
6571
+ return (0, $4MPRY$jsx)($aa6702347bcd9c62$var$Button, {
6572
+ active: active,
6573
+ onMouseDown: handleMouseDown,
6574
+ icon: icon
6575
+ });
6576
+ };
6577
+ var $aa6702347bcd9c62$export$2e2bcd8739ae039 = $aa6702347bcd9c62$var$RichTextArea;
6578
+
6579
+
6580
+
6581
+
6582
+
6583
+
6584
+
6585
+
6586
+
6136
6587
  var $43437b181b294db2$var$base = {
6137
6588
  container: '',
6138
6589
  head: 'flex justify-between',
6139
6590
  body: 'relative rounded-md my-2 cursor-pointer',
6140
6591
  foot: '',
6592
+ labelContainer: 'flex flex-col',
6141
6593
  label: 'block font-medium text-gray-900',
6142
6594
  hint: 'text-xs text-gray-500',
6143
6595
  leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
@@ -6221,7 +6673,7 @@ var $b1b6aa72505b2474$var$__assign = undefined && undefined.__assign || function
6221
6673
  return $b1b6aa72505b2474$var$__assign.apply(this, arguments);
6222
6674
  };
6223
6675
  var $b1b6aa72505b2474$var$FileInputGroupForm = function(props) {
6224
- 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;
6676
+ 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;
6225
6677
  var isValid = error === undefined;
6226
6678
  var _e = (0, $4MPRY$useState)(false), isDragging = _e[0], setIsDragging = _e[1];
6227
6679
  var handleChangeInput = (0, $4MPRY$useCallback)(function(files) {
@@ -6286,10 +6738,19 @@ var $b1b6aa72505b2474$var$FileInputGroupForm = function(props) {
6286
6738
  (0, $4MPRY$jsxs)("div", {
6287
6739
  className: styles.head,
6288
6740
  children: [
6289
- label && (0, $4MPRY$jsx)("label", {
6290
- htmlFor: name,
6291
- className: styles.label,
6292
- children: label
6741
+ label && (0, $4MPRY$jsxs)("div", {
6742
+ className: styles.labelContainer,
6743
+ children: [
6744
+ (0, $4MPRY$jsx)("label", {
6745
+ htmlFor: name,
6746
+ className: styles.label,
6747
+ children: label
6748
+ }),
6749
+ description && !(error && isTouched) && (0, $4MPRY$jsx)("p", {
6750
+ className: styles.description,
6751
+ children: description
6752
+ })
6753
+ ]
6293
6754
  }),
6294
6755
  !required && !isRequired && typeof label === 'string' && (0, $4MPRY$jsx)("span", {
6295
6756
  className: styles.hint,
@@ -6325,9 +6786,9 @@ var $b1b6aa72505b2474$var$FileInputGroupForm = function(props) {
6325
6786
  (0, $4MPRY$jsxs)("div", {
6326
6787
  className: styles.foot,
6327
6788
  children: [
6328
- description && !(error && isTouched) && (0, $4MPRY$jsx)("p", {
6329
- className: styles.description,
6330
- children: description
6789
+ hint && !(error && isTouched) && (0, $4MPRY$jsx)("p", {
6790
+ className: styles.hint,
6791
+ children: hint
6331
6792
  }),
6332
6793
  error && isTouched && (0, $4MPRY$jsx)("p", {
6333
6794
  className: styles.error,
@@ -7274,5 +7735,5 @@ var $bcc7539df5bef927$export$1476d5e67a64a695 = function(str) {
7274
7735
 
7275
7736
 
7276
7737
 
7277
- export {$4f6dca59bb6d6d50$export$2e2bcd8739ae039 as AvatarElement, $9a29d5e0e3b54abe$export$2e2bcd8739ae039 as AlertElement, $a5045567c9b3a96e$export$2e2bcd8739ae039 as BadgeElement, $b237e6d2d86a5c92$export$2e2bcd8739ae039 as TooltipElement, $bc407adcad543f74$export$2e2bcd8739ae039 as ButtonElement, $c827cec2b56530a4$export$2e2bcd8739ae039 as ButtonGroupElement, $edc4ba41affb9483$export$2e2bcd8739ae039 as DropdownElement, $77cd4416ca4a0639$export$2e2bcd8739ae039 as IconElement, $307aa6ad38171d38$export$2e2bcd8739ae039 as CollapsibleElement, $49931a5175dab103$export$2e2bcd8739ae039 as ProgressTrackElement, $7b4ae85c2b92d7dd$export$2e2bcd8739ae039 as InputGroupForm, $2e39e1fa3f910477$export$2e2bcd8739ae039 as ContainerLayout, $47c668decea293b6$export$2e2bcd8739ae039 as DividerLayout, $40af42a6ff486398$export$2e2bcd8739ae039 as ListContainerLayout, $d8086708b0fe8d97$export$2e2bcd8739ae039 as MediaObjectLayout, $11b7c597538c2257$export$2e2bcd8739ae039 as PanelLayout, $4421fdc946e7dd6c$export$2e2bcd8739ae039 as TableList, $df469b72efb8986e$export$2e2bcd8739ae039 as TableList2, $fc6e6482f238e9ea$export$4b44a5cb9651fe5e as createColumnHelper, $797c6dd505f17788$export$2e2bcd8739ae039 as BreadcrumbsNavigation, $8239f5cdc1851973$export$2e2bcd8739ae039 as PanelPaginationNavigation, $56d2586955e116da$export$2e2bcd8739ae039 as PagePaginationNavigation, $fa0fc9b7e04a1799$export$2e2bcd8739ae039 as TabNavigation, $860faaa2c7bb1f36$export$2e2bcd8739ae039 as VerticalNavigation, $d467f992ffa88739$export$2e2bcd8739ae039 as ModalOverlay, $0a39296cb800ec26$export$2e2bcd8739ae039 as NotificationOverlay, $434e0b441c881466$export$2e2bcd8739ae039 as SlideOverOverlay, $28232825d538e297$export$2e2bcd8739ae039 as TableColumnOptionsCustom, $b38b76ffa80a65c8$export$2e2bcd8739ae039 as TableExportCustom, $40038b27a5148d69$export$2e2bcd8739ae039 as SelectMenuForm, $66c3dcaaa74b5389$export$7493424cf90fe793 as fromSelectMenuOptionToStringValue, $66c3dcaaa74b5389$export$4370d69198e9314a as toClassName, $66c3dcaaa74b5389$export$91d20e9290e3c358 as toAddressString, $66c3dcaaa74b5389$export$ba96624aa3b67894 as toAddressUrl, $66c3dcaaa74b5389$export$f3f93e5bb54c3de5 as toNationalRegistryNumberString, $66c3dcaaa74b5389$export$648c405ef8d23fec as toPriceString, $66c3dcaaa74b5389$export$155f7ed6f228c17c as toReadableFileSize, $66c3dcaaa74b5389$export$b2669f8969cc59be as toUserName, $66c3dcaaa74b5389$export$d9f806f9324c35ff as toUserInitials, $4e61e073e8ab55ca$export$b7c4e1545c61edee as toDateString, $4e61e073e8ab55ca$export$b489b1fb1454ddcf as toTimeString, $4e61e073e8ab55ca$export$c03bb0116ee09d4b as isValidDate, $4e61e073e8ab55ca$export$9b56e83e909e2c38 as toDateTimeString, $4e61e073e8ab55ca$export$1771f44233a5f72 as toDaysDifference, $4e61e073e8ab55ca$export$8649d02bd537ff66 as latestDateString, $4e61e073e8ab55ca$export$df20409d3177a2e0 as toDateValue, $4e61e073e8ab55ca$export$8a6f307d1b8b1960 as toTimeValue, $4e61e073e8ab55ca$export$8de20099c30464f2 as toUTCDate, $be69f9fa947058ae$export$2e2bcd8739ae039 as DateMenuForm, $00ca07f933061d8a$export$2e2bcd8739ae039 as DateRangeMenuForm, $e964500960620598$export$2e2bcd8739ae039 as __DEPRECATED__CheckboxInputGroupForm, $785bf8949af26aa5$export$2e2bcd8739ae039 as CheckboxInput, $10ded3c19afe27a9$export$2e2bcd8739ae039 as SwitchForm, $b1b6aa72505b2474$export$2e2bcd8739ae039 as FileInputGroupForm, $39e9223269e270c7$export$2e2bcd8739ae039 as OpeningsHourInputGroupForm, $c7f1fe1c3b2d56f5$export$2e2bcd8739ae039 as AddressInputGroupForm, $382ffb7c1faa0f62$export$4564041bcff0e281 as useExcel, $48d5b0ffa682dc0b$export$2e2bcd8739ae039 as useExcelMapper, $3f6ca002faff40a3$export$2e2bcd8739ae039 as useColumnHelper, $bcc7539df5bef927$export$1476d5e67a64a695 as escapeSpecialCharacters};
7738
+ export {$4f6dca59bb6d6d50$export$2e2bcd8739ae039 as AvatarElement, $9a29d5e0e3b54abe$export$2e2bcd8739ae039 as AlertElement, $a5045567c9b3a96e$export$2e2bcd8739ae039 as BadgeElement, $b237e6d2d86a5c92$export$2e2bcd8739ae039 as TooltipElement, $bc407adcad543f74$export$2e2bcd8739ae039 as ButtonElement, $c827cec2b56530a4$export$2e2bcd8739ae039 as ButtonGroupElement, $edc4ba41affb9483$export$2e2bcd8739ae039 as DropdownElement, $77cd4416ca4a0639$export$2e2bcd8739ae039 as IconElement, $307aa6ad38171d38$export$2e2bcd8739ae039 as CollapsibleElement, $49931a5175dab103$export$2e2bcd8739ae039 as ProgressTrackElement, $7b4ae85c2b92d7dd$export$2e2bcd8739ae039 as InputGroupForm, $2e39e1fa3f910477$export$2e2bcd8739ae039 as ContainerLayout, $47c668decea293b6$export$2e2bcd8739ae039 as DividerLayout, $40af42a6ff486398$export$2e2bcd8739ae039 as ListContainerLayout, $d8086708b0fe8d97$export$2e2bcd8739ae039 as MediaObjectLayout, $11b7c597538c2257$export$2e2bcd8739ae039 as PanelLayout, $4421fdc946e7dd6c$export$2e2bcd8739ae039 as TableList, $df469b72efb8986e$export$2e2bcd8739ae039 as TableList2, $fc6e6482f238e9ea$export$4b44a5cb9651fe5e as createColumnHelper, $797c6dd505f17788$export$2e2bcd8739ae039 as BreadcrumbsNavigation, $8239f5cdc1851973$export$2e2bcd8739ae039 as PanelPaginationNavigation, $56d2586955e116da$export$2e2bcd8739ae039 as PagePaginationNavigation, $fa0fc9b7e04a1799$export$2e2bcd8739ae039 as TabNavigation, $860faaa2c7bb1f36$export$2e2bcd8739ae039 as VerticalNavigation, $d467f992ffa88739$export$2e2bcd8739ae039 as ModalOverlay, $0a39296cb800ec26$export$2e2bcd8739ae039 as NotificationOverlay, $434e0b441c881466$export$2e2bcd8739ae039 as SlideOverOverlay, $28232825d538e297$export$2e2bcd8739ae039 as TableColumnOptionsCustom, $b38b76ffa80a65c8$export$2e2bcd8739ae039 as TableExportCustom, $40038b27a5148d69$export$2e2bcd8739ae039 as SelectMenuForm, $66c3dcaaa74b5389$export$7493424cf90fe793 as fromSelectMenuOptionToStringValue, $66c3dcaaa74b5389$export$4370d69198e9314a as toClassName, $66c3dcaaa74b5389$export$91d20e9290e3c358 as toAddressString, $66c3dcaaa74b5389$export$ba96624aa3b67894 as toAddressUrl, $66c3dcaaa74b5389$export$f3f93e5bb54c3de5 as toNationalRegistryNumberString, $66c3dcaaa74b5389$export$648c405ef8d23fec as toPriceString, $66c3dcaaa74b5389$export$155f7ed6f228c17c as toReadableFileSize, $66c3dcaaa74b5389$export$b2669f8969cc59be as toUserName, $66c3dcaaa74b5389$export$d9f806f9324c35ff as toUserInitials, $4e61e073e8ab55ca$export$b7c4e1545c61edee as toDateString, $4e61e073e8ab55ca$export$b489b1fb1454ddcf as toTimeString, $4e61e073e8ab55ca$export$c03bb0116ee09d4b as isValidDate, $4e61e073e8ab55ca$export$9b56e83e909e2c38 as toDateTimeString, $4e61e073e8ab55ca$export$1771f44233a5f72 as toDaysDifference, $4e61e073e8ab55ca$export$8649d02bd537ff66 as latestDateString, $4e61e073e8ab55ca$export$df20409d3177a2e0 as toDateValue, $4e61e073e8ab55ca$export$8a6f307d1b8b1960 as toTimeValue, $4e61e073e8ab55ca$export$8de20099c30464f2 as toUTCDate, $be69f9fa947058ae$export$2e2bcd8739ae039 as DateMenuForm, $00ca07f933061d8a$export$2e2bcd8739ae039 as DateRangeMenuForm, $e964500960620598$export$2e2bcd8739ae039 as __DEPRECATED__CheckboxInputGroupForm, $785bf8949af26aa5$export$2e2bcd8739ae039 as CheckboxInput, $10ded3c19afe27a9$export$2e2bcd8739ae039 as SwitchForm, $aa6702347bcd9c62$export$2e2bcd8739ae039 as RichTextArea, $b1b6aa72505b2474$export$2e2bcd8739ae039 as FileInputGroupForm, $39e9223269e270c7$export$2e2bcd8739ae039 as OpeningsHourInputGroupForm, $c7f1fe1c3b2d56f5$export$2e2bcd8739ae039 as AddressInputGroupForm, $382ffb7c1faa0f62$export$4564041bcff0e281 as useExcel, $48d5b0ffa682dc0b$export$2e2bcd8739ae039 as useExcelMapper, $3f6ca002faff40a3$export$2e2bcd8739ae039 as useColumnHelper, $bcc7539df5bef927$export$1476d5e67a64a695 as escapeSpecialCharacters};
7278
7739
  //# sourceMappingURL=index.esm.js.map