@festo-ui/react 3.2.1-pre-20220720.1 → 3.2.1-pre-20220809.2

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/index.esm.css CHANGED
@@ -171,9 +171,17 @@
171
171
  justify-content: center;
172
172
  align-items: center;
173
173
  }
174
+ .fr-waiting-container .fr-waiting-content-container {
175
+ margin-top: 12px;
176
+ color: var(--fwe-hero);
177
+ }
174
178
 
175
- .fr-waiting-indicator {
176
- margin-bottom: 16px;
179
+ .fr-waiting-container-sm {
180
+ flex-direction: row;
181
+ }
182
+ .fr-waiting-container-sm .fr-waiting-content-container {
183
+ margin-top: unset;
184
+ margin-left: 8px;
177
185
  }
178
186
  .fr-modal {
179
187
  opacity: 0;
package/index.esm.js CHANGED
@@ -7,7 +7,6 @@ import { usePopper } from 'react-popper';
7
7
  import Draggable from 'react-draggable';
8
8
  import flatpickr from 'flatpickr';
9
9
  import rangePlugin from 'flatpickr/dist/plugins/rangePlugin';
10
- import Quill from 'quill';
11
10
  import ReactDOM from 'react-dom';
12
11
 
13
12
  /*! *****************************************************************************
@@ -516,19 +515,25 @@ function LinkButton({
516
515
  }), void 0);
517
516
  }
518
517
 
519
- function LoadingIndicator({
520
- size = 'large',
521
- children,
522
- className
523
- }) {
518
+ const LoadingIndicator = /*#__PURE__*/forwardRef((_a, ref) => {
519
+ var {
520
+ size = 'large',
521
+ children,
522
+ className
523
+ } = _a,
524
+ props = __rest(_a, ["size", "children", "className"]);
525
+
524
526
  const classes = classNames('fwe-waiting-indicator', {
525
527
  'fwe-waiting-indicator-md': size === 'medium'
526
528
  }, {
527
529
  'fwe-waiting-indicator-sm': size === 'small'
528
- }, className);
530
+ });
529
531
  return jsxs("div", Object.assign({
530
- className: "fr-waiting-container"
531
- }, {
532
+ className: classNames('fr-waiting-container', {
533
+ 'fr-waiting-container-sm': size === 'small'
534
+ }, className),
535
+ ref: ref
536
+ }, props, {
532
537
  children: [jsxs("div", Object.assign({
533
538
  className: classes
534
539
  }, {
@@ -538,10 +543,16 @@ function LoadingIndicator({
538
543
  className: "fwe-waiting-circle-2"
539
544
  }, void 0), jsx("div", {
540
545
  className: "fwe-waiting-circle-3"
546
+ }, void 0), jsx("div", {
547
+ className: "fwe-waiting-circle-4"
541
548
  }, void 0)]
542
- }), void 0), children]
549
+ }), void 0), jsx("div", Object.assign({
550
+ className: "fr-waiting-content-container"
551
+ }, {
552
+ children: children
553
+ }), void 0)]
543
554
  }), void 0);
544
- }
555
+ });
545
556
 
546
557
  const Modal = /*#__PURE__*/forwardRef(({
547
558
  head,
@@ -1352,7 +1363,7 @@ function Snackbar(props) {
1352
1363
  }), void 0);
1353
1364
  }
1354
1365
 
1355
- var SnackbarContext = /*#__PURE__*/React.createContext({});
1366
+ var SnackbarContext = /*#__PURE__*/React.createContext(null);
1356
1367
 
1357
1368
  function SnackbarProvider(props) {
1358
1369
  const {
@@ -1365,17 +1376,21 @@ function SnackbarProvider(props) {
1365
1376
  const [snacks, setSnacks] = useState([]);
1366
1377
 
1367
1378
  function addSnackbar(snackData, onAction, onClose) {
1379
+ var _a;
1380
+
1381
+ const key = (_a = snackData.key) !== null && _a !== void 0 ? _a : new Date().getTime() + Math.random();
1368
1382
  setSnacks(prevSnacks => [{
1369
1383
  data: Object.assign(Object.assign({}, config), snackData),
1370
1384
  onAction,
1371
1385
  onClose,
1372
- key: new Date().getTime() + Math.random(),
1386
+ key: key,
1373
1387
  first: prevSnacks.length === 0
1374
1388
  }, ...prevSnacks]);
1389
+ return key;
1375
1390
  }
1376
1391
 
1377
1392
  function closeSnackbar(key) {
1378
- if (key) {
1393
+ if (key !== undefined) {
1379
1394
  setSnacks(prevSnacks => prevSnacks.filter(snack => snack.key !== key));
1380
1395
  }
1381
1396
  }
@@ -4164,7 +4179,9 @@ function TextEditor({
4164
4179
  toolbar: Object.assign(Object.assign({}, defaultConfig.toolbar), configProps === null || configProps === void 0 ? void 0 : configProps.toolbar)
4165
4180
  };
4166
4181
  useEffect(() => {
4167
- if (editorRef && editor === null) {
4182
+ if (editorRef && editor === null && typeof window === 'object') {
4183
+ const Quill = require('quill');
4184
+
4168
4185
  const newEditor = new Quill(editorRef.current, {
4169
4186
  modules: {
4170
4187
  toolbar: `#editor-toolbar-${id}`
package/index.umd.css CHANGED
@@ -171,9 +171,17 @@
171
171
  justify-content: center;
172
172
  align-items: center;
173
173
  }
174
+ .fr-waiting-container .fr-waiting-content-container {
175
+ margin-top: 12px;
176
+ color: var(--fwe-hero);
177
+ }
174
178
 
175
- .fr-waiting-indicator {
176
- margin-bottom: 16px;
179
+ .fr-waiting-container-sm {
180
+ flex-direction: row;
181
+ }
182
+ .fr-waiting-container-sm .fr-waiting-content-container {
183
+ margin-top: unset;
184
+ margin-left: 8px;
177
185
  }
178
186
  .fr-modal {
179
187
  opacity: 0;
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('classnames'), require('react'), require('react-transition-group'), require('react-outside-click-handler'), require('react-popper'), require('react-draggable'), require('flatpickr'), require('flatpickr/dist/plugins/rangePlugin'), require('quill'), require('react-dom')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'classnames', 'react', 'react-transition-group', 'react-outside-click-handler', 'react-popper', 'react-draggable', 'flatpickr', 'flatpickr/dist/plugins/rangePlugin', 'quill', 'react-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.jsxRuntime, global.classNames, global.React, global.reactTransitionGroup, global.OutsideClickHandler, global.reactPopper, global.Draggable, global.flatpickr, global.rangePlugin, global.Quill, global.ReactDOM));
5
- })(this, (function (exports, jsxRuntime, classNames, React, reactTransitionGroup, OutsideClickHandler, reactPopper, Draggable, flatpickr, rangePlugin, Quill, ReactDOM) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('classnames'), require('react'), require('react-transition-group'), require('react-outside-click-handler'), require('react-popper'), require('react-draggable'), require('flatpickr'), require('flatpickr/dist/plugins/rangePlugin'), require('react-dom')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'classnames', 'react', 'react-transition-group', 'react-outside-click-handler', 'react-popper', 'react-draggable', 'flatpickr', 'flatpickr/dist/plugins/rangePlugin', 'react-dom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.jsxRuntime, global.classNames, global.React, global.reactTransitionGroup, global.OutsideClickHandler, global.reactPopper, global.Draggable, global.flatpickr, global.rangePlugin, global.ReactDOM));
5
+ })(this, (function (exports, jsxRuntime, classNames, React, reactTransitionGroup, OutsideClickHandler, reactPopper, Draggable, flatpickr, rangePlugin, ReactDOM) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -12,7 +12,6 @@
12
12
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
13
13
  var flatpickr__default = /*#__PURE__*/_interopDefaultLegacy(flatpickr);
14
14
  var rangePlugin__default = /*#__PURE__*/_interopDefaultLegacy(rangePlugin);
15
- var Quill__default = /*#__PURE__*/_interopDefaultLegacy(Quill);
16
15
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
17
16
 
18
17
  /*! *****************************************************************************
@@ -558,19 +557,24 @@
558
557
  }), void 0);
559
558
  }
560
559
 
561
- function LoadingIndicator(_a) {
560
+ var LoadingIndicator = /*#__PURE__*/React.forwardRef(function (_a, ref) {
562
561
  var _b = _a.size,
563
562
  size = _b === void 0 ? 'large' : _b,
564
563
  children = _a.children,
565
- className = _a.className;
564
+ className = _a.className,
565
+ props = __rest(_a, ["size", "children", "className"]);
566
+
566
567
  var classes = classNames__default["default"]('fwe-waiting-indicator', {
567
568
  'fwe-waiting-indicator-md': size === 'medium'
568
569
  }, {
569
570
  'fwe-waiting-indicator-sm': size === 'small'
570
- }, className);
571
+ });
571
572
  return jsxRuntime.jsxs("div", __assign({
572
- className: "fr-waiting-container"
573
- }, {
573
+ className: classNames__default["default"]('fr-waiting-container', {
574
+ 'fr-waiting-container-sm': size === 'small'
575
+ }, className),
576
+ ref: ref
577
+ }, props, {
574
578
  children: [jsxRuntime.jsxs("div", __assign({
575
579
  className: classes
576
580
  }, {
@@ -580,10 +584,16 @@
580
584
  className: "fwe-waiting-circle-2"
581
585
  }, void 0), jsxRuntime.jsx("div", {
582
586
  className: "fwe-waiting-circle-3"
587
+ }, void 0), jsxRuntime.jsx("div", {
588
+ className: "fwe-waiting-circle-4"
583
589
  }, void 0)]
584
- }), void 0), children]
590
+ }), void 0), jsxRuntime.jsx("div", __assign({
591
+ className: "fr-waiting-content-container"
592
+ }, {
593
+ children: children
594
+ }), void 0)]
585
595
  }), void 0);
586
- }
596
+ });
587
597
 
588
598
  var Modal = /*#__PURE__*/React.forwardRef(function (_a, ref) {
589
599
  var head = _a.head,
@@ -1452,7 +1462,7 @@
1452
1462
  }), void 0);
1453
1463
  }
1454
1464
 
1455
- var SnackbarContext = /*#__PURE__*/React__default["default"].createContext({});
1465
+ var SnackbarContext = /*#__PURE__*/React__default["default"].createContext(null);
1456
1466
 
1457
1467
  function SnackbarProvider(props) {
1458
1468
  var _a = props.config,
@@ -1467,19 +1477,23 @@
1467
1477
  setSnacks = _b[1];
1468
1478
 
1469
1479
  function addSnackbar(snackData, onAction, onClose) {
1480
+ var _a;
1481
+
1482
+ var key = (_a = snackData.key) !== null && _a !== void 0 ? _a : new Date().getTime() + Math.random();
1470
1483
  setSnacks(function (prevSnacks) {
1471
1484
  return __spreadArray([{
1472
1485
  data: __assign(__assign({}, config), snackData),
1473
1486
  onAction: onAction,
1474
1487
  onClose: onClose,
1475
- key: new Date().getTime() + Math.random(),
1488
+ key: key,
1476
1489
  first: prevSnacks.length === 0
1477
1490
  }], prevSnacks, true);
1478
1491
  });
1492
+ return key;
1479
1493
  }
1480
1494
 
1481
1495
  function closeSnackbar(key) {
1482
- if (key) {
1496
+ if (key !== undefined) {
1483
1497
  setSnacks(function (prevSnacks) {
1484
1498
  return prevSnacks.filter(function (snack) {
1485
1499
  return snack.key !== key;
@@ -4502,8 +4516,10 @@
4502
4516
  toolbar: __assign(__assign({}, defaultConfig.toolbar), configProps === null || configProps === void 0 ? void 0 : configProps.toolbar)
4503
4517
  };
4504
4518
  React.useEffect(function () {
4505
- if (editorRef && editor === null) {
4506
- var newEditor = new Quill__default["default"](editorRef.current, {
4519
+ if (editorRef && editor === null && typeof window === 'object') {
4520
+ var Quill_1 = require('quill');
4521
+
4522
+ var newEditor = new Quill_1(editorRef.current, {
4507
4523
  modules: {
4508
4524
  toolbar: "#editor-toolbar-".concat(id)
4509
4525
  },
@@ -4529,7 +4545,7 @@
4529
4545
  } // not allowed, remove image by setting up a new delta
4530
4546
 
4531
4547
 
4532
- var Delta = Quill__default["default"].import('quill-delta');
4548
+ var Delta = Quill_1.import('quill-delta');
4533
4549
  return new Delta().insert('');
4534
4550
  });
4535
4551
  setEditor(newEditor);
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import { ClassNamePropsWithChildren } from '../../helper/types';
1
+ import React, { ComponentPropsWithRef } from 'react';
3
2
  import './LoadingIndicator.scss';
4
- interface LoadingIndicatorProps extends ClassNamePropsWithChildren {
3
+ interface LoadingIndicatorProps extends ComponentPropsWithRef<'div'> {
5
4
  size: 'large' | 'medium' | 'small';
6
5
  }
7
- declare function LoadingIndicator({ size, children, className }: LoadingIndicatorProps): JSX.Element;
6
+ export declare const LoadingIndicator: React.ForwardRefExoticComponent<Pick<LoadingIndicatorProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size"> & React.RefAttributes<HTMLDivElement>>;
8
7
  export default LoadingIndicator;
@@ -8,6 +8,7 @@ export interface SnackbarConfig extends ClassNameProps {
8
8
  showClose?: boolean;
9
9
  action?: string;
10
10
  disappearAfter?: number | null;
11
+ key?: string | number;
11
12
  }
12
13
  export interface SnackbarData extends SnackbarConfig {
13
14
  text: string;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { SnackbarData } from './Snackbar';
3
3
  export interface ProviderContext {
4
- addSnackbar?: (data: SnackbarData, onAction?: () => void, onClose?: () => void) => void;
5
- closeSnackbar?: (key?: number) => void;
4
+ addSnackbar: (data: SnackbarData, onAction?: () => void, onClose?: () => void) => void;
5
+ closeSnackbar: (key?: number | string) => void;
6
6
  }
7
7
  declare const _default: React.Context<ProviderContext>;
8
8
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react",
3
- "version": "3.2.1-pre-20220720.1",
3
+ "version": "3.2.1-pre-20220809.2",
4
4
  "author": "Festo UI (styleguide@festo.com)",
5
5
  "license": "apache-2.0",
6
6
  "peerDependencies": {
@@ -8,6 +8,7 @@
8
8
  "react-dom": "^17.0.0 || ^18.0.0",
9
9
  "@festo-ui/web-essentials": "*"
10
10
  },
11
+ "sideEffects": false,
11
12
  "main": "./index.umd.js",
12
13
  "module": "./index.esm.js",
13
14
  "typings": "./index.d.ts",
@@ -19,7 +20,7 @@
19
20
  "@popperjs/core": "^2.11.0",
20
21
  "react-draggable": "^4.4.4",
21
22
  "flatpickr": "^4.6.9",
22
- "quill": "1.3.7",
23
- "xss": "^1.0.10"
23
+ "xss": "^1.0.10",
24
+ "quill": "1.3.7"
24
25
  }
25
26
  }