@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/formik.cjs.js +18 -155
- package/formik.cjs.js.map +1 -1
- package/formik.js +18 -155
- package/formik.js.map +1 -1
- package/index.cjs.js +50 -157
- package/index.cjs.js.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +7 -0
- package/index.js +50 -158
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -339,6 +339,12 @@ export type SpinnerProps = {
|
|
|
339
339
|
className?: string;
|
|
340
340
|
};
|
|
341
341
|
|
|
342
|
+
export type StepperProps = {
|
|
343
|
+
steps: { id: string | number; label: string }[];
|
|
344
|
+
activeIndex: number;
|
|
345
|
+
setActiveIndex: (index: number) => void;
|
|
346
|
+
};
|
|
347
|
+
|
|
342
348
|
export type SwitchProps = {
|
|
343
349
|
label?: string;
|
|
344
350
|
required?: boolean;
|
|
@@ -765,6 +771,7 @@ export const Label: React.FC<LabelProps>;
|
|
|
765
771
|
export const Pagination: React.FC<PaginationProps>;
|
|
766
772
|
export const Select: React.ForwardRefExoticComponent<SelectProps>;
|
|
767
773
|
export const Spinner: React.FC<SpinnerProps>;
|
|
774
|
+
export const Stepper: React.FC<StepperProps>;
|
|
768
775
|
export const Switch: React.ForwardRefExoticComponent<SwitchProps>;
|
|
769
776
|
export const Slider: React.ForwardRefExoticComponent<SliderProps>;
|
|
770
777
|
export const Table: React.FC<TableProps>;
|
package/index.js
CHANGED
|
@@ -2185,7 +2185,7 @@ const PresenceContext = createContext(null);
|
|
|
2185
2185
|
|
|
2186
2186
|
const isBrowser$9 = typeof document !== "undefined";
|
|
2187
2187
|
|
|
2188
|
-
const useIsomorphicLayoutEffect$
|
|
2188
|
+
const useIsomorphicLayoutEffect$2 = isBrowser$9 ? useLayoutEffect : useEffect;
|
|
2189
2189
|
|
|
2190
2190
|
const LazyContext = createContext({ strict: false });
|
|
2191
2191
|
|
|
@@ -2220,7 +2220,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
|
|
|
2220
2220
|
* was present on initial render - it will be deleted after this.
|
|
2221
2221
|
*/
|
|
2222
2222
|
const canHandoff = useRef(Boolean(window.HandoffAppearAnimations));
|
|
2223
|
-
useIsomorphicLayoutEffect$
|
|
2223
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
2224
2224
|
if (!visualElement)
|
|
2225
2225
|
return;
|
|
2226
2226
|
visualElement.render();
|
|
@@ -6846,11 +6846,11 @@ class AnimationFeature extends Feature {
|
|
|
6846
6846
|
unmount() { }
|
|
6847
6847
|
}
|
|
6848
6848
|
|
|
6849
|
-
let id$
|
|
6849
|
+
let id$3 = 0;
|
|
6850
6850
|
class ExitAnimationFeature extends Feature {
|
|
6851
6851
|
constructor() {
|
|
6852
6852
|
super(...arguments);
|
|
6853
|
-
this.id = id$
|
|
6853
|
+
this.id = id$3++;
|
|
6854
6854
|
}
|
|
6855
6855
|
update() {
|
|
6856
6856
|
if (!this.node.presenceContext)
|
|
@@ -8520,7 +8520,7 @@ const transformAxes = ["", "X", "Y", "Z"];
|
|
|
8520
8520
|
* which has a noticeable difference in spring animations
|
|
8521
8521
|
*/
|
|
8522
8522
|
const animationTarget = 1000;
|
|
8523
|
-
let id$
|
|
8523
|
+
let id$2 = 0;
|
|
8524
8524
|
/**
|
|
8525
8525
|
* Use a mutable data object for debug data so as to not create a new
|
|
8526
8526
|
* object every frame.
|
|
@@ -8537,7 +8537,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
8537
8537
|
/**
|
|
8538
8538
|
* A unique ID generated for every projection node.
|
|
8539
8539
|
*/
|
|
8540
|
-
this.id = id$
|
|
8540
|
+
this.id = id$2++;
|
|
8541
8541
|
/**
|
|
8542
8542
|
* An id that represents a unique session instigated by startUpdate.
|
|
8543
8543
|
*/
|
|
@@ -11028,7 +11028,7 @@ const motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomM
|
|
|
11028
11028
|
|
|
11029
11029
|
function useIsMounted() {
|
|
11030
11030
|
const isMounted = useRef(false);
|
|
11031
|
-
useIsomorphicLayoutEffect$
|
|
11031
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
11032
11032
|
isMounted.current = true;
|
|
11033
11033
|
return () => {
|
|
11034
11034
|
isMounted.current = false;
|
|
@@ -11238,7 +11238,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
|
|
|
11238
11238
|
// If this is the initial component render, just deal with logic surrounding whether
|
|
11239
11239
|
// we play onMount animations or not.
|
|
11240
11240
|
const isInitialRender = useRef(true);
|
|
11241
|
-
useIsomorphicLayoutEffect$
|
|
11241
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
11242
11242
|
isInitialRender.current = false;
|
|
11243
11243
|
updateChildLookup(filteredChildren, allChildren);
|
|
11244
11244
|
presentChildren.current = childrenToRender;
|
|
@@ -15343,7 +15343,7 @@ function deepPreserveProps(instanceProps, componentProps) {
|
|
|
15343
15343
|
});
|
|
15344
15344
|
}
|
|
15345
15345
|
|
|
15346
|
-
var useIsomorphicLayoutEffect$
|
|
15346
|
+
var useIsomorphicLayoutEffect$1 = isBrowser$7 ? useLayoutEffect : useEffect;
|
|
15347
15347
|
function useMutableBox(initialValue) {
|
|
15348
15348
|
// Using refs instead of state as it's recommended to not store imperative
|
|
15349
15349
|
// values in state due to memory problems in React(?)
|
|
@@ -15482,7 +15482,7 @@ function TippyGenerator(tippy) {
|
|
|
15482
15482
|
|
|
15483
15483
|
var deps = [reference].concat(children ? [children.type] : []); // CREATE
|
|
15484
15484
|
|
|
15485
|
-
useIsomorphicLayoutEffect$
|
|
15485
|
+
useIsomorphicLayoutEffect$1(function () {
|
|
15486
15486
|
var element = reference;
|
|
15487
15487
|
|
|
15488
15488
|
if (reference && reference.hasOwnProperty('current')) {
|
|
@@ -15517,7 +15517,7 @@ function TippyGenerator(tippy) {
|
|
|
15517
15517
|
};
|
|
15518
15518
|
}, deps); // UPDATE
|
|
15519
15519
|
|
|
15520
|
-
useIsomorphicLayoutEffect$
|
|
15520
|
+
useIsomorphicLayoutEffect$1(function () {
|
|
15521
15521
|
var _instance$popperInsta;
|
|
15522
15522
|
|
|
15523
15523
|
// Prevent this effect from running on 1st render
|
|
@@ -15553,7 +15553,7 @@ function TippyGenerator(tippy) {
|
|
|
15553
15553
|
});
|
|
15554
15554
|
}
|
|
15555
15555
|
});
|
|
15556
|
-
useIsomorphicLayoutEffect$
|
|
15556
|
+
useIsomorphicLayoutEffect$1(function () {
|
|
15557
15557
|
var _instance$props$poppe;
|
|
15558
15558
|
|
|
15559
15559
|
if (!render) {
|
|
@@ -17660,6 +17660,11 @@ SwitchTransition.defaultProps = {
|
|
|
17660
17660
|
mode: modes.out
|
|
17661
17661
|
};
|
|
17662
17662
|
|
|
17663
|
+
var useId = function useId(defaultId) {
|
|
17664
|
+
var id = useId$1();
|
|
17665
|
+
return defaultId || id;
|
|
17666
|
+
};
|
|
17667
|
+
|
|
17663
17668
|
var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handler) {
|
|
17664
17669
|
useEffect(function () {
|
|
17665
17670
|
var listener = function listener(event) {
|
|
@@ -18998,147 +19003,6 @@ var Callout = function Callout(_ref) {
|
|
|
18998
19003
|
})), children);
|
|
18999
19004
|
};
|
|
19000
19005
|
|
|
19001
|
-
function canUseDOM$1() {
|
|
19002
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
19003
|
-
}
|
|
19004
|
-
|
|
19005
|
-
/**
|
|
19006
|
-
* React currently throws a warning when using useLayoutEffect on the server. To
|
|
19007
|
-
* get around it, we can conditionally useEffect on the server (no-op) and
|
|
19008
|
-
* useLayoutEffect in the browser. We occasionally need useLayoutEffect to
|
|
19009
|
-
* ensure we don't get a render flash for certain operations, but we may also
|
|
19010
|
-
* need affected components to render on the server. One example is when setting
|
|
19011
|
-
* a component's descendants to retrieve their index values.
|
|
19012
|
-
*
|
|
19013
|
-
* Important to note that using this hook as an escape hatch will break the
|
|
19014
|
-
* eslint dependency warnings unless you rename the import to `useLayoutEffect`.
|
|
19015
|
-
* Use sparingly only when the effect won't effect the rendered HTML to avoid
|
|
19016
|
-
* any server/client mismatch.
|
|
19017
|
-
*
|
|
19018
|
-
* If a useLayoutEffect is needed and the result would create a mismatch, it's
|
|
19019
|
-
* likely that the component in question shouldn't be rendered on the server at
|
|
19020
|
-
* all, so a better approach would be to lazily render those in a parent
|
|
19021
|
-
* component after client-side hydration.
|
|
19022
|
-
*
|
|
19023
|
-
* https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
19024
|
-
* https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js
|
|
19025
|
-
*
|
|
19026
|
-
* @param effect
|
|
19027
|
-
* @param deps
|
|
19028
|
-
*/
|
|
19029
|
-
|
|
19030
|
-
var useIsomorphicLayoutEffect$1 = /*#__PURE__*/canUseDOM$1() ? useLayoutEffect : useEffect;
|
|
19031
|
-
|
|
19032
|
-
/*
|
|
19033
|
-
* Welcome to @reach/auto-id!
|
|
19034
|
-
|
|
19035
|
-
* Let's see if we can make sense of why this hook exists and its
|
|
19036
|
-
* implementation.
|
|
19037
|
-
*
|
|
19038
|
-
* Some background:
|
|
19039
|
-
* 1. Accessibiliy APIs rely heavily on element IDs
|
|
19040
|
-
* 2. Requiring developers to put IDs on every element in Reach UI is both
|
|
19041
|
-
* cumbersome and error-prone
|
|
19042
|
-
* 3. With a component model, we can generate IDs for them!
|
|
19043
|
-
*
|
|
19044
|
-
* Solution 1: Generate random IDs.
|
|
19045
|
-
*
|
|
19046
|
-
* This works great as long as you don't server render your app. When React (in
|
|
19047
|
-
* the client) tries to reuse the markup from the server, the IDs won't match
|
|
19048
|
-
* and React will then recreate the entire DOM tree.
|
|
19049
|
-
*
|
|
19050
|
-
* Solution 2: Increment an integer
|
|
19051
|
-
*
|
|
19052
|
-
* This sounds great. Since we're rendering the exact same tree on the server
|
|
19053
|
-
* and client, we can increment a counter and get a deterministic result between
|
|
19054
|
-
* client and server. Also, JS integers can go up to nine-quadrillion. I'm
|
|
19055
|
-
* pretty sure the tab will be closed before an app never needs
|
|
19056
|
-
* 10 quadrillion IDs!
|
|
19057
|
-
*
|
|
19058
|
-
* Problem solved, right?
|
|
19059
|
-
*
|
|
19060
|
-
* Ah, but there's a catch! React's concurrent rendering makes this approach
|
|
19061
|
-
* non-deterministic. While the client and server will end up with the same
|
|
19062
|
-
* elements in the end, depending on suspense boundaries (and possibly some user
|
|
19063
|
-
* input during the initial render) the incrementing integers won't always match
|
|
19064
|
-
* up.
|
|
19065
|
-
*
|
|
19066
|
-
* Solution 3: Don't use IDs at all on the server; patch after first render.
|
|
19067
|
-
*
|
|
19068
|
-
* What we've done here is solution 2 with some tricks. With this approach, the
|
|
19069
|
-
* ID returned is an empty string on the first render. This way the server and
|
|
19070
|
-
* client have the same markup no matter how wild the concurrent rendering may
|
|
19071
|
-
* have gotten.
|
|
19072
|
-
*
|
|
19073
|
-
* After the render, we patch up the components with an incremented ID. This
|
|
19074
|
-
* causes a double render on any components with `useId`. Shouldn't be a problem
|
|
19075
|
-
* since the components using this hook should be small, and we're only updating
|
|
19076
|
-
* the ID attribute on the DOM, nothing big is happening.
|
|
19077
|
-
*
|
|
19078
|
-
* It doesn't have to be an incremented number, though--we could do generate
|
|
19079
|
-
* random strings instead, but incrementing a number is probably the cheapest
|
|
19080
|
-
* thing we can do.
|
|
19081
|
-
*
|
|
19082
|
-
* Additionally, we only do this patchup on the very first client render ever.
|
|
19083
|
-
* Any calls to `useId` that happen dynamically in the client will be
|
|
19084
|
-
* populated immediately with a value. So, we only get the double render after
|
|
19085
|
-
* server hydration and never again, SO BACK OFF ALRIGHT?
|
|
19086
|
-
*/
|
|
19087
|
-
var serverHandoffComplete = false;
|
|
19088
|
-
var id$2 = 0;
|
|
19089
|
-
|
|
19090
|
-
var genId = function genId() {
|
|
19091
|
-
return ++id$2;
|
|
19092
|
-
};
|
|
19093
|
-
/**
|
|
19094
|
-
* useId
|
|
19095
|
-
*
|
|
19096
|
-
* Autogenerate IDs to facilitate WAI-ARIA and server rendering.
|
|
19097
|
-
*
|
|
19098
|
-
* Note: The returned ID will initially be `null` and will update after a
|
|
19099
|
-
* component mounts. Users may need to supply their own ID if they need
|
|
19100
|
-
* consistent values for SSR.
|
|
19101
|
-
*
|
|
19102
|
-
* @see Docs https://reach.tech/auto-id
|
|
19103
|
-
*/
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
function useId(idFromProps) {
|
|
19107
|
-
/*
|
|
19108
|
-
* If this instance isn't part of the initial render, we don't have to do the
|
|
19109
|
-
* double render/patch-up dance. We can just generate the ID and return it.
|
|
19110
|
-
*/
|
|
19111
|
-
var initialId = idFromProps || (serverHandoffComplete ? genId() : null);
|
|
19112
|
-
|
|
19113
|
-
var _React$useState = useState(initialId),
|
|
19114
|
-
id = _React$useState[0],
|
|
19115
|
-
setId = _React$useState[1];
|
|
19116
|
-
|
|
19117
|
-
useIsomorphicLayoutEffect$1(function () {
|
|
19118
|
-
if (id === null) {
|
|
19119
|
-
/*
|
|
19120
|
-
* Patch the ID after render. We do this in `useLayoutEffect` to avoid any
|
|
19121
|
-
* rendering flicker, though it'll make the first render slower (unlikely
|
|
19122
|
-
* to matter, but you're welcome to measure your app and let us know if
|
|
19123
|
-
* it's a problem).
|
|
19124
|
-
*/
|
|
19125
|
-
setId(genId());
|
|
19126
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19127
|
-
|
|
19128
|
-
}, []);
|
|
19129
|
-
useEffect(function () {
|
|
19130
|
-
if (serverHandoffComplete === false) {
|
|
19131
|
-
/*
|
|
19132
|
-
* Flag all future uses of `useId` to skip the update dance. This is in
|
|
19133
|
-
* `useEffect` because it goes after `useLayoutEffect`, ensuring we don't
|
|
19134
|
-
* accidentally bail out of the patch-up dance prematurely.
|
|
19135
|
-
*/
|
|
19136
|
-
serverHandoffComplete = true;
|
|
19137
|
-
}
|
|
19138
|
-
}, []);
|
|
19139
|
-
return id != null ? String(id) : undefined;
|
|
19140
|
-
}
|
|
19141
|
-
|
|
19142
19006
|
var _excluded$v = ["children", "className", "required", "helpIconProps"],
|
|
19143
19007
|
_excluded2$3 = ["onClick", "icon", "tooltipProps", "className"];
|
|
19144
19008
|
var Label = function Label(_ref) {
|
|
@@ -29118,8 +28982,7 @@ var Slider = function Slider(_ref) {
|
|
|
29118
28982
|
error = _ref.error,
|
|
29119
28983
|
helpText = _ref.helpText,
|
|
29120
28984
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$c);
|
|
29121
|
-
var
|
|
29122
|
-
var id = otherProps.id || _id;
|
|
28985
|
+
var id = useId(otherProps.id);
|
|
29123
28986
|
var errorId = "error_".concat(id);
|
|
29124
28987
|
var helpTextId = "helpText_".concat(id);
|
|
29125
28988
|
return /*#__PURE__*/React__default.createElement(_ConfigProvider, {
|
|
@@ -29180,6 +29043,36 @@ var Slider = function Slider(_ref) {
|
|
|
29180
29043
|
}, helpText)));
|
|
29181
29044
|
};
|
|
29182
29045
|
|
|
29046
|
+
var Stepper = function Stepper(_ref) {
|
|
29047
|
+
var steps = _ref.steps,
|
|
29048
|
+
activeIndex = _ref.activeIndex,
|
|
29049
|
+
setActiveIndex = _ref.setActiveIndex;
|
|
29050
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
29051
|
+
className: "neeto-ui-stepper__wrapper"
|
|
29052
|
+
}, steps.map(function (_ref2, index) {
|
|
29053
|
+
var id = _ref2.id,
|
|
29054
|
+
label = _ref2.label;
|
|
29055
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
29056
|
+
"data-testid": "stepper-item-".concat(id),
|
|
29057
|
+
key: id,
|
|
29058
|
+
className: classnames$1("neeto-ui-stepper-item__wrapper", {
|
|
29059
|
+
"neeto-ui-stepper-item__wrapper--active": index === activeIndex,
|
|
29060
|
+
"neeto-ui-stepper-item__wrapper--done": index < activeIndex
|
|
29061
|
+
})
|
|
29062
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
29063
|
+
className: "neeto-ui-stepper-item",
|
|
29064
|
+
onClick: function onClick() {
|
|
29065
|
+
return setActiveIndex(index);
|
|
29066
|
+
}
|
|
29067
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
29068
|
+
className: "neeto-ui-stepper-item__stage"
|
|
29069
|
+
}, /*#__PURE__*/React__default.createElement("span", null, id)), /*#__PURE__*/React__default.createElement("span", {
|
|
29070
|
+
className: "neeto-ui-stepper-item__label",
|
|
29071
|
+
"data-text": label
|
|
29072
|
+
}, label)));
|
|
29073
|
+
}));
|
|
29074
|
+
};
|
|
29075
|
+
|
|
29183
29076
|
var _excluded$b = ["label", "required", "className", "error", "onChange", "labelProps", "children"];
|
|
29184
29077
|
var Switch = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
29185
29078
|
var _ref$label = _ref.label,
|
|
@@ -38777,8 +38670,7 @@ var TimePickerInput = function TimePickerInput(_ref) {
|
|
|
38777
38670
|
_ref$error = _ref.error,
|
|
38778
38671
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
38779
38672
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
38780
|
-
var
|
|
38781
|
-
var id = otherProps.id || _id;
|
|
38673
|
+
var id = useId(otherProps.id);
|
|
38782
38674
|
var errorId = "error_".concat(id);
|
|
38783
38675
|
var handleChange = function handleChange(value) {
|
|
38784
38676
|
var date = dayjs(value, "HH:mm:ss");
|
|
@@ -41708,5 +41600,5 @@ var TreeSelect = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
41708
41600
|
});
|
|
41709
41601
|
TreeSelect.displayName = "TreeSelect";
|
|
41710
41602
|
|
|
41711
|
-
export { Accordion, ActionDropdown, Alert, Avatar, Button, Callout, Checkbox, ColorPicker, DatePicker, Dropdown, Input$3 as Input, Kbd, Label, Modal, MultiEmailInput, NoData, Pagination, Pane, Popover, Radio, Select, Slider, Spinner, Switch, Tab, Table, Tag, Textarea, TimePicker$1 as TimePicker, TimePickerInput, Toastr, Tooltip, TreeSelect, Typography };
|
|
41603
|
+
export { Accordion, ActionDropdown, Alert, Avatar, Button, Callout, Checkbox, ColorPicker, DatePicker, Dropdown, Input$3 as Input, Kbd, Label, Modal, MultiEmailInput, NoData, Pagination, Pane, Popover, Radio, Select, Slider, Spinner, Stepper, Switch, Tab, Table, Tag, Textarea, TimePicker$1 as TimePicker, TimePickerInput, Toastr, Tooltip, TreeSelect, Typography };
|
|
41712
41604
|
//# sourceMappingURL=index.js.map
|