@bigbinary/neetoui 5.2.26 → 5.2.28

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.cjs.js CHANGED
@@ -2218,7 +2218,7 @@ const PresenceContext = React$5.createContext(null);
2218
2218
 
2219
2219
  const isBrowser$9 = typeof document !== "undefined";
2220
2220
 
2221
- const useIsomorphicLayoutEffect$3 = isBrowser$9 ? React$5.useLayoutEffect : React$5.useEffect;
2221
+ const useIsomorphicLayoutEffect$2 = isBrowser$9 ? React$5.useLayoutEffect : React$5.useEffect;
2222
2222
 
2223
2223
  const LazyContext = React$5.createContext({ strict: false });
2224
2224
 
@@ -2253,7 +2253,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
2253
2253
  * was present on initial render - it will be deleted after this.
2254
2254
  */
2255
2255
  const canHandoff = React$5.useRef(Boolean(window.HandoffAppearAnimations));
2256
- useIsomorphicLayoutEffect$3(() => {
2256
+ useIsomorphicLayoutEffect$2(() => {
2257
2257
  if (!visualElement)
2258
2258
  return;
2259
2259
  visualElement.render();
@@ -6879,11 +6879,11 @@ class AnimationFeature extends Feature {
6879
6879
  unmount() { }
6880
6880
  }
6881
6881
 
6882
- let id$4 = 0;
6882
+ let id$3 = 0;
6883
6883
  class ExitAnimationFeature extends Feature {
6884
6884
  constructor() {
6885
6885
  super(...arguments);
6886
- this.id = id$4++;
6886
+ this.id = id$3++;
6887
6887
  }
6888
6888
  update() {
6889
6889
  if (!this.node.presenceContext)
@@ -8553,7 +8553,7 @@ const transformAxes = ["", "X", "Y", "Z"];
8553
8553
  * which has a noticeable difference in spring animations
8554
8554
  */
8555
8555
  const animationTarget = 1000;
8556
- let id$3 = 0;
8556
+ let id$2 = 0;
8557
8557
  /**
8558
8558
  * Use a mutable data object for debug data so as to not create a new
8559
8559
  * object every frame.
@@ -8570,7 +8570,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
8570
8570
  /**
8571
8571
  * A unique ID generated for every projection node.
8572
8572
  */
8573
- this.id = id$3++;
8573
+ this.id = id$2++;
8574
8574
  /**
8575
8575
  * An id that represents a unique session instigated by startUpdate.
8576
8576
  */
@@ -11061,7 +11061,7 @@ const motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomM
11061
11061
 
11062
11062
  function useIsMounted() {
11063
11063
  const isMounted = React$5.useRef(false);
11064
- useIsomorphicLayoutEffect$3(() => {
11064
+ useIsomorphicLayoutEffect$2(() => {
11065
11065
  isMounted.current = true;
11066
11066
  return () => {
11067
11067
  isMounted.current = false;
@@ -11271,7 +11271,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
11271
11271
  // If this is the initial component render, just deal with logic surrounding whether
11272
11272
  // we play onMount animations or not.
11273
11273
  const isInitialRender = React$5.useRef(true);
11274
- useIsomorphicLayoutEffect$3(() => {
11274
+ useIsomorphicLayoutEffect$2(() => {
11275
11275
  isInitialRender.current = false;
11276
11276
  updateChildLookup(filteredChildren, allChildren);
11277
11277
  presentChildren.current = childrenToRender;
@@ -15376,7 +15376,7 @@ function deepPreserveProps(instanceProps, componentProps) {
15376
15376
  });
15377
15377
  }
15378
15378
 
15379
- var useIsomorphicLayoutEffect$2 = isBrowser$7 ? React$5.useLayoutEffect : React$5.useEffect;
15379
+ var useIsomorphicLayoutEffect$1 = isBrowser$7 ? React$5.useLayoutEffect : React$5.useEffect;
15380
15380
  function useMutableBox(initialValue) {
15381
15381
  // Using refs instead of state as it's recommended to not store imperative
15382
15382
  // values in state due to memory problems in React(?)
@@ -15515,7 +15515,7 @@ function TippyGenerator(tippy) {
15515
15515
 
15516
15516
  var deps = [reference].concat(children ? [children.type] : []); // CREATE
15517
15517
 
15518
- useIsomorphicLayoutEffect$2(function () {
15518
+ useIsomorphicLayoutEffect$1(function () {
15519
15519
  var element = reference;
15520
15520
 
15521
15521
  if (reference && reference.hasOwnProperty('current')) {
@@ -15550,7 +15550,7 @@ function TippyGenerator(tippy) {
15550
15550
  };
15551
15551
  }, deps); // UPDATE
15552
15552
 
15553
- useIsomorphicLayoutEffect$2(function () {
15553
+ useIsomorphicLayoutEffect$1(function () {
15554
15554
  var _instance$popperInsta;
15555
15555
 
15556
15556
  // Prevent this effect from running on 1st render
@@ -15586,7 +15586,7 @@ function TippyGenerator(tippy) {
15586
15586
  });
15587
15587
  }
15588
15588
  });
15589
- useIsomorphicLayoutEffect$2(function () {
15589
+ useIsomorphicLayoutEffect$1(function () {
15590
15590
  var _instance$props$poppe;
15591
15591
 
15592
15592
  if (!render) {
@@ -17693,6 +17693,11 @@ SwitchTransition.defaultProps = {
17693
17693
  mode: modes.out
17694
17694
  };
17695
17695
 
17696
+ var useId = function useId(defaultId) {
17697
+ var id = React$5.useId();
17698
+ return defaultId || id;
17699
+ };
17700
+
17696
17701
  var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handler) {
17697
17702
  React$5.useEffect(function () {
17698
17703
  var listener = function listener(event) {
@@ -19031,147 +19036,6 @@ var Callout = function Callout(_ref) {
19031
19036
  })), children);
19032
19037
  };
19033
19038
 
19034
- function canUseDOM$1() {
19035
- return !!(typeof window !== "undefined" && window.document && window.document.createElement);
19036
- }
19037
-
19038
- /**
19039
- * React currently throws a warning when using useLayoutEffect on the server. To
19040
- * get around it, we can conditionally useEffect on the server (no-op) and
19041
- * useLayoutEffect in the browser. We occasionally need useLayoutEffect to
19042
- * ensure we don't get a render flash for certain operations, but we may also
19043
- * need affected components to render on the server. One example is when setting
19044
- * a component's descendants to retrieve their index values.
19045
- *
19046
- * Important to note that using this hook as an escape hatch will break the
19047
- * eslint dependency warnings unless you rename the import to `useLayoutEffect`.
19048
- * Use sparingly only when the effect won't effect the rendered HTML to avoid
19049
- * any server/client mismatch.
19050
- *
19051
- * If a useLayoutEffect is needed and the result would create a mismatch, it's
19052
- * likely that the component in question shouldn't be rendered on the server at
19053
- * all, so a better approach would be to lazily render those in a parent
19054
- * component after client-side hydration.
19055
- *
19056
- * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
19057
- * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js
19058
- *
19059
- * @param effect
19060
- * @param deps
19061
- */
19062
-
19063
- var useIsomorphicLayoutEffect$1 = /*#__PURE__*/canUseDOM$1() ? React$5.useLayoutEffect : React$5.useEffect;
19064
-
19065
- /*
19066
- * Welcome to @reach/auto-id!
19067
-
19068
- * Let's see if we can make sense of why this hook exists and its
19069
- * implementation.
19070
- *
19071
- * Some background:
19072
- * 1. Accessibiliy APIs rely heavily on element IDs
19073
- * 2. Requiring developers to put IDs on every element in Reach UI is both
19074
- * cumbersome and error-prone
19075
- * 3. With a component model, we can generate IDs for them!
19076
- *
19077
- * Solution 1: Generate random IDs.
19078
- *
19079
- * This works great as long as you don't server render your app. When React (in
19080
- * the client) tries to reuse the markup from the server, the IDs won't match
19081
- * and React will then recreate the entire DOM tree.
19082
- *
19083
- * Solution 2: Increment an integer
19084
- *
19085
- * This sounds great. Since we're rendering the exact same tree on the server
19086
- * and client, we can increment a counter and get a deterministic result between
19087
- * client and server. Also, JS integers can go up to nine-quadrillion. I'm
19088
- * pretty sure the tab will be closed before an app never needs
19089
- * 10 quadrillion IDs!
19090
- *
19091
- * Problem solved, right?
19092
- *
19093
- * Ah, but there's a catch! React's concurrent rendering makes this approach
19094
- * non-deterministic. While the client and server will end up with the same
19095
- * elements in the end, depending on suspense boundaries (and possibly some user
19096
- * input during the initial render) the incrementing integers won't always match
19097
- * up.
19098
- *
19099
- * Solution 3: Don't use IDs at all on the server; patch after first render.
19100
- *
19101
- * What we've done here is solution 2 with some tricks. With this approach, the
19102
- * ID returned is an empty string on the first render. This way the server and
19103
- * client have the same markup no matter how wild the concurrent rendering may
19104
- * have gotten.
19105
- *
19106
- * After the render, we patch up the components with an incremented ID. This
19107
- * causes a double render on any components with `useId`. Shouldn't be a problem
19108
- * since the components using this hook should be small, and we're only updating
19109
- * the ID attribute on the DOM, nothing big is happening.
19110
- *
19111
- * It doesn't have to be an incremented number, though--we could do generate
19112
- * random strings instead, but incrementing a number is probably the cheapest
19113
- * thing we can do.
19114
- *
19115
- * Additionally, we only do this patchup on the very first client render ever.
19116
- * Any calls to `useId` that happen dynamically in the client will be
19117
- * populated immediately with a value. So, we only get the double render after
19118
- * server hydration and never again, SO BACK OFF ALRIGHT?
19119
- */
19120
- var serverHandoffComplete = false;
19121
- var id$2 = 0;
19122
-
19123
- var genId = function genId() {
19124
- return ++id$2;
19125
- };
19126
- /**
19127
- * useId
19128
- *
19129
- * Autogenerate IDs to facilitate WAI-ARIA and server rendering.
19130
- *
19131
- * Note: The returned ID will initially be `null` and will update after a
19132
- * component mounts. Users may need to supply their own ID if they need
19133
- * consistent values for SSR.
19134
- *
19135
- * @see Docs https://reach.tech/auto-id
19136
- */
19137
-
19138
-
19139
- function useId(idFromProps) {
19140
- /*
19141
- * If this instance isn't part of the initial render, we don't have to do the
19142
- * double render/patch-up dance. We can just generate the ID and return it.
19143
- */
19144
- var initialId = idFromProps || (serverHandoffComplete ? genId() : null);
19145
-
19146
- var _React$useState = React$5.useState(initialId),
19147
- id = _React$useState[0],
19148
- setId = _React$useState[1];
19149
-
19150
- useIsomorphicLayoutEffect$1(function () {
19151
- if (id === null) {
19152
- /*
19153
- * Patch the ID after render. We do this in `useLayoutEffect` to avoid any
19154
- * rendering flicker, though it'll make the first render slower (unlikely
19155
- * to matter, but you're welcome to measure your app and let us know if
19156
- * it's a problem).
19157
- */
19158
- setId(genId());
19159
- } // eslint-disable-next-line react-hooks/exhaustive-deps
19160
-
19161
- }, []);
19162
- React$5.useEffect(function () {
19163
- if (serverHandoffComplete === false) {
19164
- /*
19165
- * Flag all future uses of `useId` to skip the update dance. This is in
19166
- * `useEffect` because it goes after `useLayoutEffect`, ensuring we don't
19167
- * accidentally bail out of the patch-up dance prematurely.
19168
- */
19169
- serverHandoffComplete = true;
19170
- }
19171
- }, []);
19172
- return id != null ? String(id) : undefined;
19173
- }
19174
-
19175
19039
  var _excluded$v = ["children", "className", "required", "helpIconProps"],
19176
19040
  _excluded2$3 = ["onClick", "icon", "tooltipProps", "className"];
19177
19041
  var Label = function Label(_ref) {
@@ -29151,8 +29015,7 @@ var Slider = function Slider(_ref) {
29151
29015
  error = _ref.error,
29152
29016
  helpText = _ref.helpText,
29153
29017
  otherProps = _objectWithoutProperties$1(_ref, _excluded$c);
29154
- var _id = React$5.useId();
29155
- var id = otherProps.id || _id;
29018
+ var id = useId(otherProps.id);
29156
29019
  var errorId = "error_".concat(id);
29157
29020
  var helpTextId = "helpText_".concat(id);
29158
29021
  return /*#__PURE__*/React__default["default"].createElement(_ConfigProvider__default["default"], {
@@ -29213,6 +29076,36 @@ var Slider = function Slider(_ref) {
29213
29076
  }, helpText)));
29214
29077
  };
29215
29078
 
29079
+ var Stepper = function Stepper(_ref) {
29080
+ var steps = _ref.steps,
29081
+ activeIndex = _ref.activeIndex,
29082
+ setActiveIndex = _ref.setActiveIndex;
29083
+ return /*#__PURE__*/React__default["default"].createElement("div", {
29084
+ className: "neeto-ui-stepper__wrapper"
29085
+ }, steps.map(function (_ref2, index) {
29086
+ var id = _ref2.id,
29087
+ label = _ref2.label;
29088
+ return /*#__PURE__*/React__default["default"].createElement("div", {
29089
+ "data-testid": "stepper-item-".concat(id),
29090
+ key: id,
29091
+ className: classnames$1("neeto-ui-stepper-item__wrapper", {
29092
+ "neeto-ui-stepper-item__wrapper--active": index === activeIndex,
29093
+ "neeto-ui-stepper-item__wrapper--done": index < activeIndex
29094
+ })
29095
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
29096
+ className: "neeto-ui-stepper-item",
29097
+ onClick: function onClick() {
29098
+ return setActiveIndex(index);
29099
+ }
29100
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
29101
+ className: "neeto-ui-stepper-item__stage"
29102
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, id)), /*#__PURE__*/React__default["default"].createElement("span", {
29103
+ className: "neeto-ui-stepper-item__label",
29104
+ "data-text": label
29105
+ }, label)));
29106
+ }));
29107
+ };
29108
+
29216
29109
  var _excluded$b = ["label", "required", "className", "error", "onChange", "labelProps", "children"];
29217
29110
  var Switch = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
29218
29111
  var _ref$label = _ref.label,
@@ -38810,8 +38703,7 @@ var TimePickerInput = function TimePickerInput(_ref) {
38810
38703
  _ref$error = _ref.error,
38811
38704
  error = _ref$error === void 0 ? "" : _ref$error,
38812
38705
  otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
38813
- var _id = React$5.useId();
38814
- var id = otherProps.id || _id;
38706
+ var id = useId(otherProps.id);
38815
38707
  var errorId = "error_".concat(id);
38816
38708
  var handleChange = function handleChange(value) {
38817
38709
  var date = dayjs(value, "HH:mm:ss");
@@ -41764,6 +41656,7 @@ exports.Radio = Radio;
41764
41656
  exports.Select = Select;
41765
41657
  exports.Slider = Slider;
41766
41658
  exports.Spinner = Spinner;
41659
+ exports.Stepper = Stepper;
41767
41660
  exports.Switch = Switch;
41768
41661
  exports.Tab = Tab;
41769
41662
  exports.Table = Table;