@northlight/ui 2.28.0 → 2.28.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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@chakra-ui/react'), require('react'), require('chakra-react-select'), require('ramda'), require('@react-aria/focus'), require('react-hook-form'), require('@chakra-ui/system'), require('@northlight/tokens'), require('@northlight/icons'), require('@hookform/resolvers/joi'), require('@react-aria/checkbox'), require('@react-aria/radio'), require('@react-aria/utils'), require('@react-stately/radio'), require('@react-stately/checkbox'), require('@chakra-ui/theme-tools'), require('@react-aria/datepicker'), require('@react-stately/datepicker'), require('@internationalized/date'), require('@react-aria/button'), require('@react-aria/i18n'), require('@react-stately/calendar'), require('@react-aria/calendar'), require('react-router-dom'), require('@chakra-ui/clickable'), require('framer-motion'), require('@dnd-kit/core'), require('@dnd-kit/utilities'), require('@dnd-kit/sortable'), require('@dnd-kit/modifiers'), require('react-window'), require('react-virtualized-auto-sizer'), require('react-avatar-editor'), require('react-number-format'), require('react-input-mask')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@chakra-ui/react', 'react', 'chakra-react-select', 'ramda', '@react-aria/focus', 'react-hook-form', '@chakra-ui/system', '@northlight/tokens', '@northlight/icons', '@hookform/resolvers/joi', '@react-aria/checkbox', '@react-aria/radio', '@react-aria/utils', '@react-stately/radio', '@react-stately/checkbox', '@chakra-ui/theme-tools', '@react-aria/datepicker', '@react-stately/datepicker', '@internationalized/date', '@react-aria/button', '@react-aria/i18n', '@react-stately/calendar', '@react-aria/calendar', 'react-router-dom', '@chakra-ui/clickable', 'framer-motion', '@dnd-kit/core', '@dnd-kit/utilities', '@dnd-kit/sortable', '@dnd-kit/modifiers', 'react-window', 'react-virtualized-auto-sizer', 'react-avatar-editor', 'react-number-format', 'react-input-mask'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.northlight = {}, global.react, global.React, global.chakraReactSelect, global.ramda, global.focus, global.reactHookForm, global.system, global.tokens, global.icons, global.joi, global.checkbox$1, global.radio$1, global.utils, global.radio, global.checkbox, global.themeTools, global.datepicker, global.datepicker$1, global.date, global.button, global.i18n, global.calendar$1, global.calendar, global.reactRouterDom, global.clickable, global.framerMotion, global.core, global.utilities, global.sortable, global.modifiers, global.reactWindow, global.AutoSizer, global.AvatarEditor, global.reactNumberFormat, global.InputMask));
5
- })(this, (function (exports, react, React, chakraReactSelect, ramda, focus, reactHookForm, system, tokens, icons, joi, checkbox$1, radio$1, utils, radio, checkbox, themeTools, datepicker, datepicker$1, date, button, i18n, calendar$1, calendar, reactRouterDom, clickable, framerMotion, core, utilities, sortable, modifiers, reactWindow, AutoSizer, AvatarEditor, reactNumberFormat, InputMask) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@chakra-ui/react'), require('react'), require('chakra-react-select'), require('ramda'), require('@react-aria/focus'), require('react-hook-form'), require('@chakra-ui/system'), require('@northlight/tokens'), require('@northlight/icons'), require('@hookform/resolvers/joi'), require('@react-aria/checkbox'), require('@react-aria/radio'), require('@react-aria/utils'), require('@react-stately/radio'), require('@react-stately/checkbox'), require('@chakra-ui/theme-tools'), require('@react-aria/datepicker'), require('@react-stately/datepicker'), require('@internationalized/date'), require('@react-aria/button'), require('@react-aria/i18n'), require('@react-stately/calendar'), require('@react-aria/calendar'), require('react-router-dom'), require('@chakra-ui/clickable'), require('framer-motion'), require('@dnd-kit/core'), require('@dnd-kit/utilities'), require('@dnd-kit/sortable'), require('@dnd-kit/modifiers'), require('react-window'), require('react-virtualized-auto-sizer'), require('react-avatar-editor'), require('react-number-format'), require('react-input-mask'), require('yafu')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@chakra-ui/react', 'react', 'chakra-react-select', 'ramda', '@react-aria/focus', 'react-hook-form', '@chakra-ui/system', '@northlight/tokens', '@northlight/icons', '@hookform/resolvers/joi', '@react-aria/checkbox', '@react-aria/radio', '@react-aria/utils', '@react-stately/radio', '@react-stately/checkbox', '@chakra-ui/theme-tools', '@react-aria/datepicker', '@react-stately/datepicker', '@internationalized/date', '@react-aria/button', '@react-aria/i18n', '@react-stately/calendar', '@react-aria/calendar', 'react-router-dom', '@chakra-ui/clickable', 'framer-motion', '@dnd-kit/core', '@dnd-kit/utilities', '@dnd-kit/sortable', '@dnd-kit/modifiers', 'react-window', 'react-virtualized-auto-sizer', 'react-avatar-editor', 'react-number-format', 'react-input-mask', 'yafu'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.northlight = {}, global.react, global.React, global.chakraReactSelect, global.ramda, global.focus, global.reactHookForm, global.system, global.tokens, global.icons, global.joi, global.checkbox$1, global.radio$1, global.utils, global.radio, global.checkbox, global.themeTools, global.datepicker, global.datepicker$1, global.date, global.button, global.i18n, global.calendar$1, global.calendar, global.reactRouterDom, global.clickable, global.framerMotion, global.core, global.utilities, global.sortable, global.modifiers, global.reactWindow, global.AutoSizer, global.AvatarEditor, global.reactNumberFormat, global.InputMask, global.yafu));
5
+ })(this, (function (exports, react, React, chakraReactSelect, ramda, focus, reactHookForm, system, tokens, icons, joi, checkbox$1, radio$1, utils, radio, checkbox, themeTools, datepicker, datepicker$1, date, button, i18n, calendar$1, calendar, reactRouterDom, clickable, framerMotion, core, utilities, sortable, modifiers, reactWindow, AutoSizer, AvatarEditor, reactNumberFormat, InputMask, yafu) { 'use strict';
6
6
 
7
7
  var __defProp$2q = Object.defineProperty;
8
8
  var __getOwnPropSymbols$2q = Object.getOwnPropertySymbols;
@@ -13932,26 +13932,26 @@
13932
13932
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
13933
13933
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13934
13934
  var __spreadValues = (a, b) => {
13935
- for (var prop in b || (b = {}))
13936
- if (__hasOwnProp.call(b, prop))
13937
- __defNormalProp(a, prop, b[prop]);
13935
+ for (var prop2 in b || (b = {}))
13936
+ if (__hasOwnProp.call(b, prop2))
13937
+ __defNormalProp(a, prop2, b[prop2]);
13938
13938
  if (__getOwnPropSymbols)
13939
- for (var prop of __getOwnPropSymbols(b)) {
13940
- if (__propIsEnum.call(b, prop))
13941
- __defNormalProp(a, prop, b[prop]);
13939
+ for (var prop2 of __getOwnPropSymbols(b)) {
13940
+ if (__propIsEnum.call(b, prop2))
13941
+ __defNormalProp(a, prop2, b[prop2]);
13942
13942
  }
13943
13943
  return a;
13944
13944
  };
13945
13945
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13946
13946
  var __objRest = (source, exclude) => {
13947
13947
  var target = {};
13948
- for (var prop in source)
13949
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
13950
- target[prop] = source[prop];
13948
+ for (var prop2 in source)
13949
+ if (__hasOwnProp.call(source, prop2) && exclude.indexOf(prop2) < 0)
13950
+ target[prop2] = source[prop2];
13951
13951
  if (source != null && __getOwnPropSymbols)
13952
- for (var prop of __getOwnPropSymbols(source)) {
13953
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
13954
- target[prop] = source[prop];
13952
+ for (var prop2 of __getOwnPropSymbols(source)) {
13953
+ if (exclude.indexOf(prop2) < 0 && __propIsEnum.call(source, prop2))
13954
+ target[prop2] = source[prop2];
13955
13955
  }
13956
13956
  return target;
13957
13957
  };
@@ -14040,7 +14040,7 @@
14040
14040
  onOptionChange(option);
14041
14041
  };
14042
14042
  const combinedOptions = React.useMemo(
14043
- () => [...standardOptions, ...createdOptions],
14043
+ () => yafu.uniqBy(ramda.prop("value"), [...standardOptions, ...createdOptions]),
14044
14044
  [standardOptions, createdOptions]
14045
14045
  );
14046
14046
  const customOptions = [
@@ -14056,55 +14056,64 @@
14056
14056
  setSelectedOption(newSelectedOption);
14057
14057
  }
14058
14058
  }, [value, combinedOptions]);
14059
- return /* @__PURE__ */ React.createElement(react.Box, { ref, w: "sm", maxW: "full" }, createNewOption && /* @__PURE__ */ React.createElement(
14060
- EditableText,
14059
+ return /* @__PURE__ */ React.createElement(
14060
+ react.Box,
14061
14061
  {
14062
- value: addFieldInputValue,
14063
- startWithEditView: true,
14064
- onChange: (v) => {
14065
- setAddFieldInputValue(v);
14066
- },
14067
- submitOnBlur: false,
14068
- onCancel: () => {
14069
- setAddFieldInputValue("");
14070
- setCreateNewOption(false);
14071
- },
14072
- onSubmit: (v) => {
14073
- handleCreateOption(v);
14074
- setCreateNewOption(false);
14075
- },
14076
- variant: "brand",
14077
- sx: {
14078
- minWidth: "100%",
14079
- width: "100%"
14080
- }
14081
- }
14082
- ), !createNewOption && /* @__PURE__ */ React.createElement(
14083
- chakraReactSelect.CreatableSelect,
14084
- __spreadValues({
14085
- menuPlacement,
14086
- chakraStyles: __spreadProps(__spreadValues({}, customSelectStyles), {
14087
- container: (provided) => __spreadProps(__spreadValues({}, provided), {
14062
+ ref,
14063
+ w: "full",
14064
+ borderRadius: "none"
14065
+ },
14066
+ createNewOption && /* @__PURE__ */ React.createElement(
14067
+ EditableText,
14068
+ {
14069
+ value: addFieldInputValue,
14070
+ startWithEditView: true,
14071
+ onChange: (v) => {
14072
+ setAddFieldInputValue(v);
14073
+ },
14074
+ submitOnBlur: false,
14075
+ onCancel: () => {
14076
+ setAddFieldInputValue("");
14077
+ setCreateNewOption(false);
14078
+ },
14079
+ onSubmit: (v) => {
14080
+ handleCreateOption(v);
14081
+ setCreateNewOption(false);
14082
+ },
14083
+ variant: "brand",
14084
+ sx: {
14085
+ minWidth: "100%",
14088
14086
  width: "100%"
14087
+ }
14088
+ }
14089
+ ),
14090
+ !createNewOption && /* @__PURE__ */ React.createElement(
14091
+ chakraReactSelect.CreatableSelect,
14092
+ __spreadValues({
14093
+ menuPlacement,
14094
+ chakraStyles: __spreadProps(__spreadValues({}, customSelectStyles), {
14095
+ container: (provided) => __spreadProps(__spreadValues({}, provided), {
14096
+ width: "100%"
14097
+ }),
14098
+ option: (provided, { isSelected }) => __spreadValues(__spreadValues({}, provided), isSelected && {
14099
+ color: "black"
14100
+ })
14089
14101
  }),
14090
- option: (provided, { isSelected }) => __spreadValues(__spreadValues({}, provided), isSelected && {
14091
- color: "black"
14092
- })
14093
- }),
14094
- components: getCustomComponents(),
14095
- options: customOptions,
14096
- value: selectedOption,
14097
- onChange: handleChange,
14098
- isMulti: false,
14099
- onCreateOption: (v) => {
14100
- setCreateNewOption(true);
14101
- setAddFieldInputValue(v);
14102
- },
14103
- placeholder: newOptionPlaceholder,
14104
- useBasicStyles: true,
14105
- variant
14106
- }, restProps)
14107
- ));
14102
+ components: getCustomComponents(),
14103
+ options: customOptions,
14104
+ value: selectedOption,
14105
+ onChange: handleChange,
14106
+ isMulti: false,
14107
+ onCreateOption: (v) => {
14108
+ setCreateNewOption(true);
14109
+ setAddFieldInputValue(v);
14110
+ },
14111
+ placeholder: newOptionPlaceholder,
14112
+ useBasicStyles: true,
14113
+ variant
14114
+ }, restProps)
14115
+ )
14116
+ );
14108
14117
  };
14109
14118
 
14110
14119
  Object.defineProperty(exports, 'AbsoluteCenter', {