@nulogy/components 10.2.13 → 10.3.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/main.js CHANGED
@@ -21630,14 +21630,18 @@
21630
21630
  };
21631
21631
  }
21632
21632
  function stylesForSize(config, size) {
21633
+ if (size === void 0) {
21634
+ size = "medium";
21635
+ }
21636
+
21633
21637
  return config[size];
21634
21638
  }
21635
- var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
21636
- var isMulti = _ref5.isMulti,
21637
- hasValue = _ref5.hasValue,
21638
- hasDefaultOptions = _ref5.hasDefaultOptions;
21639
- return isMulti && hasValue && hasDefaultOptions;
21640
- };
21639
+ function showIndicatorSeparator(_ref5) {
21640
+ var hasValue = _ref5.hasValue,
21641
+ isClearable = _ref5.isClearable,
21642
+ isMulti = _ref5.isMulti;
21643
+ return hasValue && (isMulti || isClearable);
21644
+ }
21641
21645
 
21642
21646
  var customStyles = function customStyles(_ref6) {
21643
21647
  var theme = _ref6.theme,
@@ -21653,6 +21657,11 @@
21653
21657
  height: 38
21654
21658
  };
21655
21659
  },
21660
+ clearIndicator: function clearIndicator(provided) {
21661
+ return Object.assign(Object.assign({}, provided), {
21662
+ color: theme.colors.midGrey
21663
+ });
21664
+ },
21656
21665
  control: function control(provided, state) {
21657
21666
  return Object.assign(Object.assign({}, provided), {
21658
21667
  display: "flex",
@@ -21664,7 +21673,6 @@
21664
21673
  lineHeight: theme.lineHeights.base,
21665
21674
  color: state.isDisabled ? curriedTransparentize(0.6667, theme.colors.black) : theme.colors.black,
21666
21675
  background: state.isDisabled ? theme.colors.whiteGrey : theme.colors.white,
21667
- border: "1px solid " + theme.colors.grey,
21668
21676
  borderColor: getBorderColor({
21669
21677
  errored: error,
21670
21678
  disabled: state.isDisabled,
@@ -21722,12 +21730,12 @@
21722
21730
  return Object.assign(Object.assign(Object.assign({}, provided), !hasDefaultOptions && {
21723
21731
  display: "none"
21724
21732
  }), {
21725
- color: theme.colors.grey
21733
+ color: theme.colors.midGrey
21726
21734
  });
21727
21735
  },
21728
21736
  indicatorsContainer: function indicatorsContainer(provided) {
21729
21737
  return Object.assign(Object.assign({}, provided), {
21730
- color: theme.colors.grey
21738
+ color: theme.colors.midGrey
21731
21739
  });
21732
21740
  },
21733
21741
  singleValue: function singleValue(provided) {
@@ -21741,8 +21749,8 @@
21741
21749
  },
21742
21750
  valueContainer: function valueContainer(provided, state) {
21743
21751
  return Object.assign(Object.assign(Object.assign({}, provided), {
21744
- display: "flex",
21745
21752
  padding: 0,
21753
+ display: "flex",
21746
21754
  overflow: "auto",
21747
21755
  maxHeight: "150px",
21748
21756
  gap: theme.space.half
@@ -21753,8 +21761,8 @@
21753
21761
  gap: theme.space.x1
21754
21762
  },
21755
21763
  medium: {
21756
- paddingTop: theme.space.half,
21757
- paddingBottom: theme.space.half
21764
+ paddingTop: theme.space.none,
21765
+ paddingBottom: theme.space.none
21758
21766
  }
21759
21767
  }, size));
21760
21768
  },
@@ -21884,9 +21892,9 @@
21884
21892
  indicatorSeparator: function indicatorSeparator(provided, state) {
21885
21893
  return Object.assign(Object.assign({}, provided), {
21886
21894
  display: showIndicatorSeparator({
21887
- isMulti: state.isMulti,
21888
21895
  hasValue: state.hasValue,
21889
- hasDefaultOptions: hasDefaultOptions
21896
+ isClearable: state.selectProps.isClearable,
21897
+ isMulti: state.isMulti
21890
21898
  }) ? "block" : "none",
21891
21899
  borderLeft: "1px solid " + theme.colors.grey
21892
21900
  });
@@ -21899,7 +21907,7 @@
21899
21907
  position: "absolute",
21900
21908
  top: "50%",
21901
21909
  transform: "translateY(-50%)",
21902
- color: state.isDisabled ? curriedTransparentize(0.6667, theme.colors.black) : "hsl(0,0%,50%)"
21910
+ color: state.isDisabled ? curriedTransparentize(0.7, theme.colors.midGrey) : theme.colors.midGrey
21903
21911
  };
21904
21912
  }
21905
21913
  };
@@ -26920,9 +26928,10 @@
26920
26928
  listStyle: "none",
26921
26929
  display: "inline-flex",
26922
26930
  alignSelf: "center",
26923
- color: theme.colors.darkBlue,
26931
+ color: theme.colors.midGrey,
26924
26932
  a: {
26925
- color: theme.colors.darkBlue
26933
+ color: theme.colors.darkBlue,
26934
+ textDecorationLine: "none"
26926
26935
  },
26927
26936
  "a:visited": {
26928
26937
  color: theme.colors.darkBlue
@@ -26938,7 +26947,7 @@
26938
26947
  large: {
26939
26948
  "a, p": {
26940
26949
  py: "x2",
26941
- px: "x1",
26950
+ px: "x0",
26942
26951
  fontSize: "medium"
26943
26952
  }
26944
26953
  },
@@ -51461,6 +51470,7 @@
51461
51470
  onClick = _ref.onClick;
51462
51471
  return /*#__PURE__*/React__default["default"].createElement(AnimatedBox, {
51463
51472
  position: "relative",
51473
+ flexShrink: 0,
51464
51474
  height: "24px",
51465
51475
  width: "48px",
51466
51476
  bg: disabled ? "grey" : getSwitchBackground(toggled),
@@ -21613,14 +21613,18 @@ function getMenuBorderRadius(_ref4) {
21613
21613
  };
21614
21614
  }
21615
21615
  function stylesForSize(config, size) {
21616
+ if (size === void 0) {
21617
+ size = "medium";
21618
+ }
21619
+
21616
21620
  return config[size];
21617
21621
  }
21618
- var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
21619
- var isMulti = _ref5.isMulti,
21620
- hasValue = _ref5.hasValue,
21621
- hasDefaultOptions = _ref5.hasDefaultOptions;
21622
- return isMulti && hasValue && hasDefaultOptions;
21623
- };
21622
+ function showIndicatorSeparator(_ref5) {
21623
+ var hasValue = _ref5.hasValue,
21624
+ isClearable = _ref5.isClearable,
21625
+ isMulti = _ref5.isMulti;
21626
+ return hasValue && (isMulti || isClearable);
21627
+ }
21624
21628
 
21625
21629
  var customStyles = function customStyles(_ref6) {
21626
21630
  var theme = _ref6.theme,
@@ -21636,6 +21640,11 @@ var customStyles = function customStyles(_ref6) {
21636
21640
  height: 38
21637
21641
  };
21638
21642
  },
21643
+ clearIndicator: function clearIndicator(provided) {
21644
+ return Object.assign(Object.assign({}, provided), {
21645
+ color: theme.colors.midGrey
21646
+ });
21647
+ },
21639
21648
  control: function control(provided, state) {
21640
21649
  return Object.assign(Object.assign({}, provided), {
21641
21650
  display: "flex",
@@ -21647,7 +21656,6 @@ var customStyles = function customStyles(_ref6) {
21647
21656
  lineHeight: theme.lineHeights.base,
21648
21657
  color: state.isDisabled ? curriedTransparentize(0.6667, theme.colors.black) : theme.colors.black,
21649
21658
  background: state.isDisabled ? theme.colors.whiteGrey : theme.colors.white,
21650
- border: "1px solid " + theme.colors.grey,
21651
21659
  borderColor: getBorderColor({
21652
21660
  errored: error,
21653
21661
  disabled: state.isDisabled,
@@ -21705,12 +21713,12 @@ var customStyles = function customStyles(_ref6) {
21705
21713
  return Object.assign(Object.assign(Object.assign({}, provided), !hasDefaultOptions && {
21706
21714
  display: "none"
21707
21715
  }), {
21708
- color: theme.colors.grey
21716
+ color: theme.colors.midGrey
21709
21717
  });
21710
21718
  },
21711
21719
  indicatorsContainer: function indicatorsContainer(provided) {
21712
21720
  return Object.assign(Object.assign({}, provided), {
21713
- color: theme.colors.grey
21721
+ color: theme.colors.midGrey
21714
21722
  });
21715
21723
  },
21716
21724
  singleValue: function singleValue(provided) {
@@ -21724,8 +21732,8 @@ var customStyles = function customStyles(_ref6) {
21724
21732
  },
21725
21733
  valueContainer: function valueContainer(provided, state) {
21726
21734
  return Object.assign(Object.assign(Object.assign({}, provided), {
21727
- display: "flex",
21728
21735
  padding: 0,
21736
+ display: "flex",
21729
21737
  overflow: "auto",
21730
21738
  maxHeight: "150px",
21731
21739
  gap: theme.space.half
@@ -21736,8 +21744,8 @@ var customStyles = function customStyles(_ref6) {
21736
21744
  gap: theme.space.x1
21737
21745
  },
21738
21746
  medium: {
21739
- paddingTop: theme.space.half,
21740
- paddingBottom: theme.space.half
21747
+ paddingTop: theme.space.none,
21748
+ paddingBottom: theme.space.none
21741
21749
  }
21742
21750
  }, size));
21743
21751
  },
@@ -21867,9 +21875,9 @@ var customStyles = function customStyles(_ref6) {
21867
21875
  indicatorSeparator: function indicatorSeparator(provided, state) {
21868
21876
  return Object.assign(Object.assign({}, provided), {
21869
21877
  display: showIndicatorSeparator({
21870
- isMulti: state.isMulti,
21871
21878
  hasValue: state.hasValue,
21872
- hasDefaultOptions: hasDefaultOptions
21879
+ isClearable: state.selectProps.isClearable,
21880
+ isMulti: state.isMulti
21873
21881
  }) ? "block" : "none",
21874
21882
  borderLeft: "1px solid " + theme.colors.grey
21875
21883
  });
@@ -21882,7 +21890,7 @@ var customStyles = function customStyles(_ref6) {
21882
21890
  position: "absolute",
21883
21891
  top: "50%",
21884
21892
  transform: "translateY(-50%)",
21885
- color: state.isDisabled ? curriedTransparentize(0.6667, theme.colors.black) : "hsl(0,0%,50%)"
21893
+ color: state.isDisabled ? curriedTransparentize(0.7, theme.colors.midGrey) : theme.colors.midGrey
21886
21894
  };
21887
21895
  }
21888
21896
  };
@@ -26903,9 +26911,10 @@ var BreadcrumbsListItem = styled.li.withConfig({
26903
26911
  listStyle: "none",
26904
26912
  display: "inline-flex",
26905
26913
  alignSelf: "center",
26906
- color: theme.colors.darkBlue,
26914
+ color: theme.colors.midGrey,
26907
26915
  a: {
26908
- color: theme.colors.darkBlue
26916
+ color: theme.colors.darkBlue,
26917
+ textDecorationLine: "none"
26909
26918
  },
26910
26919
  "a:visited": {
26911
26920
  color: theme.colors.darkBlue
@@ -26921,7 +26930,7 @@ var BreadcrumbsListItem = styled.li.withConfig({
26921
26930
  large: {
26922
26931
  "a, p": {
26923
26932
  py: "x2",
26924
- px: "x1",
26933
+ px: "x0",
26925
26934
  fontSize: "medium"
26926
26935
  }
26927
26936
  },
@@ -51444,6 +51453,7 @@ function Switch(_ref) {
51444
51453
  onClick = _ref.onClick;
51445
51454
  return /*#__PURE__*/React__default.createElement(AnimatedBox, {
51446
51455
  position: "relative",
51456
+ flexShrink: 0,
51447
51457
  height: "24px",
51448
51458
  width: "48px",
51449
51459
  bg: disabled ? "grey" : getSwitchBackground(toggled),
@@ -0,0 +1,4 @@
1
+ export declare const provinces: {
2
+ label: string;
3
+ value: string;
4
+ }[];
@@ -22,12 +22,12 @@ export declare function getMenuBorderRadius({ border, menuPlacement, theme, }: {
22
22
  type SizeConfig = {
23
23
  [key in ComponentSize]: CSSObject;
24
24
  };
25
- export declare function stylesForSize(config: SizeConfig, size: ComponentSize): CSSObject;
26
- export declare const showIndicatorSeparator: ({ isMulti, hasValue, hasDefaultOptions }: {
27
- isMulti: any;
25
+ export declare function stylesForSize(config: SizeConfig, size?: ComponentSize): CSSObject;
26
+ export declare function showIndicatorSeparator({ hasValue, isClearable, isMulti }: {
28
27
  hasValue: any;
29
- hasDefaultOptions: any;
30
- }) => any;
28
+ isClearable: any;
29
+ isMulti: any;
30
+ }): any;
31
31
  interface Args {
32
32
  theme: DefaultNDSThemeType;
33
33
  [key: string]: any;
@@ -41,6 +41,7 @@ export declare const WithLongText: {
41
41
  name: string;
42
42
  };
43
43
  };
44
+ export declare const WithContraintWidth: () => React.JSX.Element;
44
45
  export declare const ControlledToggle: () => React.JSX.Element;
45
46
  export declare const UsingRefToControlFocus: {
46
47
  (): React.JSX.Element;
@@ -64,3 +64,4 @@ export declare const OpenByDefault: {
64
64
  };
65
65
  };
66
66
  export declare const WithCustomComponent: () => React.JSX.Element;
67
+ export declare const WithRef: () => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function filterOptions(inputValue: string, options: {
2
+ value: string;
3
+ label: string;
4
+ }[], simulatedNetworkDelayMs?: number): Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "10.2.13",
3
+ "version": "10.3.0",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -52,7 +52,8 @@
52
52
  "@nulogy/icons": "4",
53
53
  "react": ">=16.10.2",
54
54
  "react-dom": ">=16.10.2",
55
- "styled-components": "^5.1.0"
55
+ "styled-components": "^5.1.0",
56
+ "typescript": "4.9.5"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@babel/core": "^7.0.0-0",
@@ -110,7 +111,7 @@
110
111
  "eslint-plugin-prettier": "^3.1.4",
111
112
  "http-server": "^14.0.0",
112
113
  "husky": "^4.3.0",
113
- "jest": "29.5.0",
114
+ "jest": "29.7.0",
114
115
  "jest-environment-jsdom": "^29.5.0",
115
116
  "jest-styled-components": "7",
116
117
  "jscodeshift": "^0.11.0",
@@ -1,5 +0,0 @@
1
- declare const simulatedAPIRequest: (inputValue: string, data: {
2
- value: string;
3
- label: string;
4
- }[], milliseconds?: number) => Promise<Response>;
5
- export default simulatedAPIRequest;