@ctlyst.id/internal-ui 1.0.4-canary.2 → 1.0.4-canary.4

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.
@@ -4,6 +4,8 @@ export interface DatePickerMonthProps {
4
4
  'data-test-id'?: string;
5
5
  min: string;
6
6
  max: string;
7
+ widthEmpty?: string | number;
8
+ widthFilled?: string | number;
7
9
  }
8
10
  declare const DatePickerMonth: FC<DatePickerMonthProps>;
9
11
  export default DatePickerMonth;
@@ -4,6 +4,8 @@ export interface MultiDatePickerMonthProps {
4
4
  min?: string;
5
5
  max?: string;
6
6
  isError?: boolean;
7
+ widthEmpty?: string | number;
8
+ widthFilled?: string | number;
7
9
  }
8
10
  declare const MultiDatePickerMonth: FC<MultiDatePickerMonthProps>;
9
11
  export default MultiDatePickerMonth;
@@ -0,0 +1,2 @@
1
+ declare const CustomerIcon: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"svg", import("@chakra-ui/icon/dist/icon").IconProps>;
2
+ export default CustomerIcon;
@@ -0,0 +1,2 @@
1
+ import type { IconType } from 'react-icons/lib';
2
+ export declare const mappingIcon: Map<string, IconType>;
@@ -1,7 +1,7 @@
1
1
  import type { IconType } from 'react-icons/lib';
2
2
  export declare type NavigationLink = {
3
3
  title: string;
4
- icon: IconType;
4
+ icon?: IconType;
5
5
  navLink?: string;
6
6
  navHost?: string;
7
7
  children?: Omit<NavigationLink, 'children'>[];
@@ -1208,6 +1208,8 @@ const DatePickerMonth = ({
1208
1208
  onChange,
1209
1209
  min,
1210
1210
  max,
1211
+ widthEmpty,
1212
+ widthFilled,
1211
1213
  ...props
1212
1214
  }) => {
1213
1215
  const [date, setDate] = React__default.useState(null);
@@ -1220,14 +1222,11 @@ const DatePickerMonth = ({
1220
1222
  display: none;
1221
1223
  -webkit-appearance: none;
1222
1224
  }
1223
- input[value=''] {
1224
- width: 58px;
1225
- }
1226
1225
  `
1227
1226
  }, /*#__PURE__*/React__default.createElement(react.Input, {
1228
1227
  "data-test-id": props['data-test-id'],
1229
1228
  type: "date",
1230
- width: date ? '51px' : '58px',
1229
+ width: date ? widthFilled : widthEmpty,
1231
1230
  onChange: e => {
1232
1231
  onChange(e.target.value);
1233
1232
  setDate(e.target.value);
@@ -1252,7 +1251,9 @@ const DatePickerMonth = ({
1252
1251
  }));
1253
1252
  };
1254
1253
  DatePickerMonth.defaultProps = {
1255
- 'data-test-id': ''
1254
+ 'data-test-id': '',
1255
+ widthEmpty: '58px',
1256
+ widthFilled: '51px'
1256
1257
  };
1257
1258
 
1258
1259
  const transparent = 'transparent';
@@ -1662,7 +1663,9 @@ const MultiDatePickerMonth = ({
1662
1663
  onChange,
1663
1664
  isError = false,
1664
1665
  min = '2020-01-01',
1665
- max = '2020-12-31'
1666
+ max = '2020-12-31',
1667
+ widthEmpty,
1668
+ widthFilled
1666
1669
  }) => {
1667
1670
  const [date, setDate] = React__default.useState([null, null]);
1668
1671
  return /*#__PURE__*/React__default.createElement(MultiDateWrapper, {
@@ -1674,7 +1677,9 @@ const MultiDatePickerMonth = ({
1674
1677
  setDate([val, date[1]]);
1675
1678
  },
1676
1679
  min: min,
1677
- max: max
1680
+ max: max,
1681
+ widthEmpty: widthEmpty,
1682
+ widthFilled: widthFilled
1678
1683
  }), /*#__PURE__*/React__default.createElement(react.Box, null, "-"), /*#__PURE__*/React__default.createElement(DatePickerMonth, {
1679
1684
  "data-test-id": "CT_DatePickerMonth_EndDate",
1680
1685
  onChange: val => {
@@ -1682,13 +1687,17 @@ const MultiDatePickerMonth = ({
1682
1687
  setDate([date[0], val]);
1683
1688
  },
1684
1689
  min: min,
1685
- max: max
1690
+ max: max,
1691
+ widthEmpty: widthEmpty,
1692
+ widthFilled: widthFilled
1686
1693
  }));
1687
1694
  };
1688
1695
  MultiDatePickerMonth.defaultProps = {
1689
1696
  min: '2020-01-01',
1690
1697
  max: '2020-12-31',
1691
- isError: false
1698
+ isError: false,
1699
+ widthEmpty: '58px',
1700
+ widthFilled: '51px'
1692
1701
  };
1693
1702
 
1694
1703
  /* eslint-disable no-nested-ternary */
@@ -2007,6 +2016,28 @@ const ModalHeader = /*#__PURE__*/React.forwardRef(({
2007
2016
  }, rest), children);
2008
2017
  });
2009
2018
 
2019
+ const CustomerIcon = /*#__PURE__*/react.createIcon({
2020
+ displayName: 'CustomerIcon',
2021
+ viewBox: '0 0 16 16',
2022
+ path: [/*#__PURE__*/React__default.createElement("path", {
2023
+ fill: "currentColor",
2024
+ fillRule: "inherit",
2025
+ d: "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM.667 8a7.333 7.333 0 1 1 14.666 0A7.333 7.333 0 0 1 .667 8Z",
2026
+ clipRule: "inherit"
2027
+ }), /*#__PURE__*/React__default.createElement("path", {
2028
+ fill: "currentColor",
2029
+ d: "M12.416 12.698a1.997 1.997 0 0 0-1.75-1.031H5.334a2 2 0 0 0-1.864 1.277 7.722 7.722 0 0 1-.943-1.074 3.329 3.329 0 0 1 2.807-1.537h5.334a3.333 3.333 0 0 1 2.703 1.384c-.275.325-.594.66-.954.98Z"
2030
+ }), /*#__PURE__*/React__default.createElement("path", {
2031
+ fill: "currentColor",
2032
+ fillRule: "inherit",
2033
+ d: "M8 5.333A1.333 1.333 0 1 0 8 8a1.333 1.333 0 0 0 0-2.667ZM5.333 6.667a2.667 2.667 0 1 1 5.334 0 2.667 2.667 0 0 1-5.334 0Z",
2034
+ clipRule: "inherit"
2035
+ })]
2036
+ });
2037
+
2038
+ /* eslint-disable import/prefer-default-export */
2039
+ const mappingIcon = /*#__PURE__*/new Map([['Order', fi.FiShoppingBag], ['Fulfillment', fi.FiShoppingCart], ['Transfer Stock', fi.FiRepeat], ['Stock', fi.FiBox], ['Product Database', fi.FiLayers], ['Purchasing', fi.FiDollarSign], ['Reseller', fi.FiUsers], ['Retur', fi.FiRotateCcw], ['Other', fi.FiSettings], ['Content', fi.FiLayout], ['Voucher', fi.FiGift], ['Customer', CustomerIcon]]);
2040
+
2010
2041
  /* eslint-disable react-hooks/rules-of-hooks */
2011
2042
  const Navigation = ({
2012
2043
  navigations,
@@ -2046,7 +2077,7 @@ const Navigation = ({
2046
2077
  color: isActive ? 'white' : 'inherit',
2047
2078
  p: 2
2048
2079
  }, /*#__PURE__*/React.createElement(react.Icon, {
2049
- as: navigation.icon,
2080
+ as: mappingIcon.get(navigation.title),
2050
2081
  mr: 2
2051
2082
  }), /*#__PURE__*/React.createElement(react.Text, {
2052
2083
  whiteSpace: "nowrap",
@@ -2066,8 +2097,7 @@ const Navigation = ({
2066
2097
  }, navigation.children.map(({
2067
2098
  title,
2068
2099
  navHost,
2069
- navLink,
2070
- icon
2100
+ navLink
2071
2101
  }) => {
2072
2102
  const link = navHost ? `${navHost}${navLink}` : navLink;
2073
2103
  const isLocalLink = host === navHost;
@@ -2104,7 +2134,7 @@ const Navigation = ({
2104
2134
  px: 6,
2105
2135
  py: 4
2106
2136
  }, /*#__PURE__*/React.createElement(react.Icon, {
2107
- as: icon,
2137
+ as: mappingIcon.get(navigation.title),
2108
2138
  mr: 3
2109
2139
  }), /*#__PURE__*/React.createElement(react.Text, {
2110
2140
  fontSize: "text.sm"