@sikka/hawa 0.0.63 → 0.0.65

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.
Files changed (69) hide show
  1. package/countries.js +1934 -0
  2. package/es/index.es.js +1 -1
  3. package/lib/index.js +1 -1
  4. package/package.json +2 -10
  5. package/src/elements/HawaPhoneInput.js +85 -53
  6. package/src/elements/HawaSelectInput.js +43 -6
  7. package/src/elements/HawaTextField.js +13 -4
  8. package/src/elements/index.js +0 -1
  9. package/src/styles.css +2 -2
  10. package/src/tailwind.css +19 -5
  11. package/storybook-static/0.1104ca18.iframe.bundle.js +3 -0
  12. package/storybook-static/{0.58b40425.iframe.bundle.js.LICENSE.txt → 0.1104ca18.iframe.bundle.js.LICENSE.txt} +0 -0
  13. package/storybook-static/0.1104ca18.iframe.bundle.js.map +1 -0
  14. package/storybook-static/0.cf71f8aa82edef0a7186.manager.bundle.js +2 -0
  15. package/storybook-static/{10.265ea9add491253ee249.manager.bundle.js.LICENSE.txt → 0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt} +0 -0
  16. package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +1 -0
  17. package/storybook-static/1.e3eafd38.iframe.bundle.js +1 -0
  18. package/storybook-static/2.3841b1a5.iframe.bundle.js +1 -0
  19. package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +2 -0
  20. package/storybook-static/{12.145180cacdb73a1c41fa.manager.bundle.js.LICENSE.txt → 5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt} +0 -0
  21. package/storybook-static/6.6023eba1.iframe.bundle.js +3 -0
  22. package/storybook-static/{6.0a3ea46a.iframe.bundle.js.LICENSE.txt → 6.6023eba1.iframe.bundle.js.LICENSE.txt} +0 -0
  23. package/storybook-static/6.6023eba1.iframe.bundle.js.map +1 -0
  24. package/storybook-static/6.b34ce31193a7fa1dd965.manager.bundle.js +1 -0
  25. package/storybook-static/7.632f8551.iframe.bundle.js +1 -0
  26. package/storybook-static/7.72879af713f755a7aa7e.manager.bundle.js +1 -0
  27. package/storybook-static/8.9a8f8b69.iframe.bundle.js +1 -0
  28. package/storybook-static/8.f9b98ef3e089be1a16d6.manager.bundle.js +2 -0
  29. package/storybook-static/{15.f91ba9c8a1383d676abf.manager.bundle.js.LICENSE.txt → 8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt} +0 -0
  30. package/storybook-static/9.1e1335092fade49cc986.manager.bundle.js +1 -0
  31. package/storybook-static/9.63a5cf7a.iframe.bundle.js +3 -0
  32. package/storybook-static/{9.6bf309ed.iframe.bundle.js.LICENSE.txt → 9.63a5cf7a.iframe.bundle.js.LICENSE.txt} +0 -0
  33. package/storybook-static/9.63a5cf7a.iframe.bundle.js.map +1 -0
  34. package/storybook-static/iframe.html +1 -1
  35. package/storybook-static/index.html +1 -1
  36. package/storybook-static/{main.20ee7e8a2af7ee58cc1f.manager.bundle.js → main.4bd27e4e7faa098302d1.manager.bundle.js} +1 -1
  37. package/storybook-static/main.8587302b.iframe.bundle.js +1 -0
  38. package/storybook-static/project.json +1 -1
  39. package/storybook-static/{runtime~main.6b765954.iframe.bundle.js → runtime~main.67ec6e92.iframe.bundle.js} +1 -1
  40. package/storybook-static/runtime~main.a58df7ba92d01c5088d3.manager.bundle.js +1 -0
  41. package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +2 -0
  42. package/storybook-static/{vendors~main.bf986892b9b6ed78a230.manager.bundle.js.LICENSE.txt → vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt} +0 -0
  43. package/storybook-static/vendors~main.d5e21618.iframe.bundle.js +3 -0
  44. package/storybook-static/{vendors~main.e7c4fe25.iframe.bundle.js.LICENSE.txt → vendors~main.d5e21618.iframe.bundle.js.LICENSE.txt} +0 -6
  45. package/storybook-static/vendors~main.d5e21618.iframe.bundle.js.map +1 -0
  46. package/countries.json +0 -1
  47. package/src/elements/HawaPhoneInput2.js +0 -78
  48. package/storybook-static/0.58b40425.iframe.bundle.js +0 -3
  49. package/storybook-static/0.58b40425.iframe.bundle.js.map +0 -1
  50. package/storybook-static/1.8a994862.iframe.bundle.js +0 -1
  51. package/storybook-static/10.265ea9add491253ee249.manager.bundle.js +0 -2
  52. package/storybook-static/11.849df77e390cb885446a.manager.bundle.js +0 -1
  53. package/storybook-static/12.145180cacdb73a1c41fa.manager.bundle.js +0 -2
  54. package/storybook-static/13.575f17b8db12e674bbfd.manager.bundle.js +0 -1
  55. package/storybook-static/14.46316235b334885ad26e.manager.bundle.js +0 -1
  56. package/storybook-static/15.f91ba9c8a1383d676abf.manager.bundle.js +0 -2
  57. package/storybook-static/16.126410c9b7b02fbc5c26.manager.bundle.js +0 -1
  58. package/storybook-static/2.427819b2.iframe.bundle.js +0 -1
  59. package/storybook-static/6.0a3ea46a.iframe.bundle.js +0 -3
  60. package/storybook-static/6.0a3ea46a.iframe.bundle.js.map +0 -1
  61. package/storybook-static/7.9cd3bcaf.iframe.bundle.js +0 -1
  62. package/storybook-static/8.52752021.iframe.bundle.js +0 -1
  63. package/storybook-static/9.6bf309ed.iframe.bundle.js +0 -3
  64. package/storybook-static/9.6bf309ed.iframe.bundle.js.map +0 -1
  65. package/storybook-static/main.d86b3f87.iframe.bundle.js +0 -1
  66. package/storybook-static/runtime~main.84749e9163e4b198514f.manager.bundle.js +0 -1
  67. package/storybook-static/vendors~main.bf986892b9b6ed78a230.manager.bundle.js +0 -2
  68. package/storybook-static/vendors~main.e7c4fe25.iframe.bundle.js +0 -3
  69. package/storybook-static/vendors~main.e7c4fe25.iframe.bundle.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -18,7 +18,6 @@
18
18
  "devDependencies": {
19
19
  "@babel/core": "^7.12.10",
20
20
  "@babel/preset-react": "^7.12.10",
21
- "@mui/system": "^5.10.1",
22
21
  "@paypal/react-paypal-js": "^7.6.0",
23
22
  "@rollup/plugin-commonjs": "^21.0.1",
24
23
  "@rollup/plugin-node-resolve": "^11.1.1",
@@ -35,9 +34,7 @@
35
34
  "crypto-js": "^4.1.1",
36
35
  "emotion-theming": "^11.0.0",
37
36
  "framer-motion": "^4.1.7",
38
- "next": "^12.1.0",
39
37
  "next-scripts": "^0.3.4",
40
- "next-translate": "^1.3.5",
41
38
  "postcss-focus-visible": "^7.1.0",
42
39
  "qs": "^6.10.3",
43
40
  "react": "^17.0.1",
@@ -57,12 +54,8 @@
57
54
  "tinycolor2": "^1.4.2"
58
55
  },
59
56
  "peerDependencies": {
60
- "@emotion/react": "^11.8.2",
61
- "@emotion/styled": "^11.8.1",
62
- "@mui/icons-material": "^5.5.1",
63
- "@mui/material": "^5.5.1",
64
- "@mui/system": "^5.10.1",
65
57
  "crypto-js": "^4.1.1",
58
+ "flowbite": "^1.5.3",
66
59
  "next-scripts": "^0.3.4",
67
60
  "prop-types": "^15.7.2",
68
61
  "react": "^17.0.1",
@@ -83,7 +76,6 @@
83
76
  "@storybook/manager-webpack4/webpack": "^5"
84
77
  },
85
78
  "dependencies": {
86
- "flowbite": "^1.5.3",
87
79
  "react-dropzone": "^12.0.4",
88
80
  "react-icons": "^4.6.0"
89
81
  }
@@ -1,61 +1,93 @@
1
- // import PhoneInput from "react-phone-input-2";
2
- // import "react-phone-input-2/lib/material.css";
1
+ import { useState } from "react";
2
+ import Countries from "../../countries";
3
+ import Select from "react-select";
4
+ const Option = ({ cx, children, getStyles, innerRef, ...props }) => (
5
+ <div
6
+ ref={innerRef}
7
+ className="m-2 p-1 px-3 rounded-lg flex flex-row items-center justify-between hover:bg-blue-200"
8
+ >
9
+ <img className="h-8 w-8" src={props.data.image}></img>
10
+ {children}
11
+ </div>
12
+ );
3
13
 
4
- export default function HawaPhoneInput(props) {
5
- const {
6
- country,
7
- onChange,
8
- value,
9
- onlyContries,
10
- preferredCountries,
11
- inputProps,
12
- required,
13
- placeholder,
14
- name,
15
- label,
16
- // onChange,
17
- ...rest
18
- } = props;
14
+ export default function HawaPhoneInput({ preferredCountry }) {
15
+ const [code, setCode] = useState(preferredCountry ?? "");
16
+ const [selectedCountry, setSelectedCountry] = useState("+966");
17
+ const [tel, setTel] = useState("");
18
+ const handleChangePhone = (phone) => {
19
+ if (phone.length == 0) {
20
+ setTel("");
21
+ setCode("");
22
+ return;
23
+ }
24
+ if (!phone.startsWith("+")) phone = "+".concat(phone);
25
+ if (phone.length >= 5) {
26
+ setTel(phone);
27
+ return;
28
+ }
29
+ let findDialCode = Countries.find((country) => country.dial_code == phone);
30
+ if (findDialCode != undefined && findDialCode != null) {
31
+ setCode(findDialCode.code);
32
+ }
33
+ setTel(phone);
34
+ };
19
35
 
20
36
  return (
21
- <div>
22
- <label
23
- for="first_name"
24
- className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
25
- >
26
- {props.label}
27
- </label>
28
- <input
29
- {...props}
30
- className="mb-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
31
- />
32
-
33
- {/* {label && <InputLabel>{props.label}</InputLabel>} */}
34
- {/* <PhoneInput
35
- country={country ?? null}
36
- onChange={(e) => onChange(e)}
37
- value={value ?? value}
38
- onlyCountries={onlyContries?.length > 0 ? onlyContries : []}
39
- preferredCountries={
40
- preferredCountries?.length > 0 ? preferredCountries : []
41
- }
42
- inputProps={{
43
- required: required ?? false,
44
- name: name ?? null
37
+ <div
38
+ style={{
39
+ display: "flex",
40
+ flexDirection: "row",
41
+ justifyContent: "center",
42
+ alignItems: "center",
43
+ height: "100%"
44
+ }}
45
+ >
46
+ <Select
47
+ styles={{
48
+ input: (base) => ({
49
+ ...base,
50
+ fontSize: "0.875rem",
51
+ "input:focus": {
52
+ boxShadow: "none"
53
+ },
54
+ lineHeight: "1.25rem",
55
+ padding: "0.37rem"
56
+ }),
57
+ control: (base) => ({
58
+ ...base,
59
+ width: 80,
60
+ borderRadius: "0.75rem",
61
+ borderTopRightRadius: 0,
62
+ borderBottomRightRadius: 0
63
+ }),
64
+ menu: (base) => ({
65
+ ...base,
66
+ width: 190,
67
+ borderRadius: "0.75rem"
68
+ })
45
69
  }}
46
- specialLabel={""}
47
- placeholder={placeholder ?? ""}
48
- inputStyle={{
49
- width: "100%"
70
+ components={{
71
+ Option,
72
+ DropdownIndicator: () => null,
73
+ IndicatorSeparator: () => null
50
74
  }}
51
- // inputClass="bg-red-900"
52
- // inputClass="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
53
- dropdownClass="bg-blue-900"
54
- buttonClass="bg-green-900"
55
- // containerClass="bg-orange-900"
56
- // containerClass="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
57
- {...rest}
58
- /> */}
75
+ options={Countries}
76
+ isCreatable={false}
77
+ isMulti={false}
78
+ isSearchable={true}
79
+ isClearable={true}
80
+ placeholder="+966"
81
+ // value={selectedCountry}
82
+ // inputValue={selectedCountry}
83
+ onChange={(newValue, action) => {
84
+ console.log("test n", newValue);
85
+ setSelectedCountry(newValue);
86
+ }}
87
+ />
88
+ <div>
89
+ <input className="bg-gray-50 border rounded-l-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 border-l-0" />
90
+ </div>
59
91
  </div>
60
92
  );
61
93
  }
@@ -1,28 +1,65 @@
1
1
  import Select from "react-select";
2
- import Creatable from "react-select/creatable";
2
+ import CreatableSelect from "react-select/creatable";
3
3
 
4
4
  export default function HawaSelectInput(props) {
5
5
  return (
6
6
  <>
7
7
  {!props.isCreatable && (
8
8
  <Select
9
+ styles={{
10
+ input: (base) => ({
11
+ ...base,
12
+ "input:focus": {
13
+ boxShadow: "none"
14
+ }
15
+ }),
16
+ control: (base) => ({
17
+ ...base,
18
+ borderRadius: "0.75rem",
19
+ padding: 3
20
+ }),
21
+ menu: (base) => ({
22
+ ...base,
23
+ borderRadius: "0.75rem"
24
+ })
25
+ }}
9
26
  options={props.options}
10
27
  isClearable={props.isClearable}
11
28
  isMulti={props.isMulti}
12
29
  isSearchable={props.isSearchable}
13
30
  onChange={(newValue, action) => props.onChange(newValue, action)}
31
+ components={props.components}
14
32
  />
15
33
  )}
16
34
  {props.isCreatable && (
17
- <Creatable
35
+ <CreatableSelect
36
+ styles={{
37
+ input: (base) => ({
38
+ ...base,
39
+ "input:focus": {
40
+ padding: 20,
41
+ boxShadow: "none"
42
+ }
43
+ }),
44
+ control: (base) => ({
45
+ ...base,
46
+ borderRadius: "0.75rem",
47
+ padding: 8
48
+ })
49
+ }}
18
50
  options={props.options}
19
51
  isClearable={props.isClearable}
20
52
  isMulti={props.isMulti}
21
53
  isSearchable={props.isSearchable}
22
- onChange={(newValue, action) => props.onChange(newValue, action)}
23
- onInputChange={(newValue, action) =>
24
- props.onInputChange(newValue, action)
25
- }
54
+ onCreateOption={() => console.log("im changing")}
55
+ onChange={(newValue, action) => {
56
+ console.log("this is onChange", newValue);
57
+ props.onChange(newValue, action);
58
+ }}
59
+ onInputChange={(newValue, action) => {
60
+ console.log("onInputChange====", newValue);
61
+ props.onInputChange(newValue, action);
62
+ }}
26
63
  />
27
64
  )}
28
65
  </>
@@ -9,10 +9,19 @@ export const HawaTextField = (props) => {
9
9
  >
10
10
  {props.label}
11
11
  </label>
12
- <input
13
- {...props}
14
- className="mb-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
15
- />
12
+ {props.multiline ? (
13
+ <textarea
14
+ id="message"
15
+ rows="4"
16
+ class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
17
+ placeholder="Your message..."
18
+ ></textarea>
19
+ ) : (
20
+ <input
21
+ {...props}
22
+ className="mb-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
23
+ />
24
+ )}
16
25
 
17
26
  {props.helperText && (
18
27
  <p className="mt-2 text-sm text-red-600 dark:text-red-500">
@@ -20,7 +20,6 @@ export * from "./HawaAccordian";
20
20
  export * from "./DragDropImages";
21
21
  export * from "./DraggableCard";
22
22
  export * from "./HawaPhoneInput";
23
- export * from "./HawaPhoneInput2";
24
23
  export * from "./HawaDrawerItem";
25
24
  export * from "./HawaTooltip";
26
25
  export * from "./HawaTabs";
package/src/styles.css CHANGED
@@ -53,10 +53,10 @@
53
53
  cursor: pointer;
54
54
  }
55
55
 
56
- input[type="number"]::-webkit-inner-spin-button,
56
+ /* input[type="number"]::-webkit-inner-spin-button,
57
57
  input[type="number"]::-webkit-outer-spin-button {
58
58
  -webkit-appearance: none;
59
- }
59
+ } */
60
60
 
61
61
  .phoneInput {
62
62
  padding-top: 10px !important;
package/src/tailwind.css CHANGED
@@ -1,7 +1,21 @@
1
- @import 'tailwindcss/base';
2
- @import 'tailwindcss/components';
3
- @import 'tailwindcss/utilities';
1
+ @import "tailwindcss/base";
2
+ @import "tailwindcss/components";
3
+ @import "tailwindcss/utilities";
4
4
 
5
5
  body {
6
- font-family: "IBM Plex Sans Arabic";
7
- }
6
+ font-family: "IBM Plex Sans Arabic";
7
+ }
8
+ /* <div class="react-select-container">
9
+ <div class="react-select__control">
10
+ <div class="react-select__value-container">...</div>
11
+ <div class="react-select__indicators">...</div>
12
+ </div>
13
+ <div class="react-select__menu">
14
+ <div class="react-select__menu-list">
15
+ <div class="react-select__option">...</div>
16
+ </div>
17
+ </div>
18
+ </div> */
19
+ .hawa-select-container {
20
+ background-color: red;
21
+ }