@sikka/hawa 0.0.84 → 0.0.86

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 (56) hide show
  1. package/dist/styles.css +3 -0
  2. package/es/index.es.js +1 -1
  3. package/lib/index.js +1 -1
  4. package/package.json +1 -1
  5. package/src/blocks/AuthForms/AppLanding.js +5 -46
  6. package/src/blocks/AuthForms/SignUpForm.js +3 -3
  7. package/src/blocks/AuthForms/index.js +1 -0
  8. package/src/elements/HawaAccordian.js +4 -2
  9. package/src/elements/HawaModal.js +55 -4
  10. package/src/elements/HawaRange.js +23 -9
  11. package/src/elements/HawaSnackbar.js +1 -0
  12. package/src/styles.css +3 -0
  13. package/storybook-static/0.1104ca18.iframe.bundle.js +3 -0
  14. package/storybook-static/{0.60b9c65419c3ce80ab72.manager.bundle.js.LICENSE.txt → 0.1104ca18.iframe.bundle.js.LICENSE.txt} +0 -0
  15. package/storybook-static/0.1104ca18.iframe.bundle.js.map +1 -0
  16. package/storybook-static/{0.60b9c65419c3ce80ab72.manager.bundle.js → 0.cf71f8aa82edef0a7186.manager.bundle.js} +2 -2
  17. package/storybook-static/{0.e2b91f98.iframe.bundle.js.LICENSE.txt → 0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt} +0 -0
  18. package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +1 -0
  19. package/storybook-static/{1.e2210f7b.iframe.bundle.js → 1.e3eafd38.iframe.bundle.js} +0 -0
  20. package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +2 -0
  21. package/storybook-static/{5.c1ea708e0305a3f2690d.manager.bundle.js.LICENSE.txt → 5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt} +0 -0
  22. package/storybook-static/{6.fadd6632.iframe.bundle.js → 6.6023eba1.iframe.bundle.js} +2 -2
  23. package/storybook-static/{6.fadd6632.iframe.bundle.js.LICENSE.txt → 6.6023eba1.iframe.bundle.js.LICENSE.txt} +0 -0
  24. package/storybook-static/6.6023eba1.iframe.bundle.js.map +1 -0
  25. package/storybook-static/{6.aa9b5ae07e5f3bc21475.manager.bundle.js → 6.b34ce31193a7fa1dd965.manager.bundle.js} +1 -1
  26. package/storybook-static/{7.12834585.iframe.bundle.js → 7.632f8551.iframe.bundle.js} +0 -0
  27. package/storybook-static/{7.f95843e9a2777ac17dbf.manager.bundle.js → 7.72879af713f755a7aa7e.manager.bundle.js} +1 -1
  28. package/storybook-static/{8.15e99a30b6a9bc116f34.manager.bundle.js → 8.f9b98ef3e089be1a16d6.manager.bundle.js} +2 -2
  29. package/storybook-static/{8.15e99a30b6a9bc116f34.manager.bundle.js.LICENSE.txt → 8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt} +0 -0
  30. package/storybook-static/{9.78e4df0068efee922f9a.manager.bundle.js → 9.1e1335092fade49cc986.manager.bundle.js} +1 -1
  31. package/storybook-static/{9.51450e03.iframe.bundle.js → 9.63a5cf7a.iframe.bundle.js} +2 -2
  32. package/storybook-static/{9.51450e03.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.4bd27e4e7faa098302d1.manager.bundle.js +1 -0
  37. package/storybook-static/main.c9ced472.iframe.bundle.js +1 -0
  38. package/storybook-static/project.json +1 -1
  39. package/storybook-static/{runtime~main.49eed76e.iframe.bundle.js → runtime~main.67ec6e92.iframe.bundle.js} +1 -1
  40. package/storybook-static/{runtime~main.4d99c291be326901006a.manager.bundle.js → runtime~main.a58df7ba92d01c5088d3.manager.bundle.js} +1 -1
  41. package/storybook-static/vendors~main.30019f92.iframe.bundle.js +3 -0
  42. package/storybook-static/{vendors~main.a425b282.iframe.bundle.js.LICENSE.txt → vendors~main.30019f92.iframe.bundle.js.LICENSE.txt} +0 -0
  43. package/storybook-static/vendors~main.30019f92.iframe.bundle.js.map +1 -0
  44. package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +2 -0
  45. package/storybook-static/{vendors~main.86108d25403f3f41d9ea.manager.bundle.js.LICENSE.txt → vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt} +0 -0
  46. package/storybook-static/0.e2b91f98.iframe.bundle.js +0 -3
  47. package/storybook-static/0.e2b91f98.iframe.bundle.js.map +0 -1
  48. package/storybook-static/1.fcf12768b56cacc8bdd8.manager.bundle.js +0 -1
  49. package/storybook-static/5.c1ea708e0305a3f2690d.manager.bundle.js +0 -2
  50. package/storybook-static/6.fadd6632.iframe.bundle.js.map +0 -1
  51. package/storybook-static/9.51450e03.iframe.bundle.js.map +0 -1
  52. package/storybook-static/main.2539e901.iframe.bundle.js +0 -1
  53. package/storybook-static/main.3b67cd32d74b4c684f1b.manager.bundle.js +0 -1
  54. package/storybook-static/vendors~main.86108d25403f3f41d9ea.manager.bundle.js +0 -2
  55. package/storybook-static/vendors~main.a425b282.iframe.bundle.js +0 -3
  56. package/storybook-static/vendors~main.a425b282.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.84",
3
+ "version": "0.0.86",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -1,22 +1,9 @@
1
1
  import React from "react";
2
- import {
3
- HawaTextField,
4
- HawaLogoButton,
5
- HawaAlert,
6
- HawaButton
7
- } from "../../elements";
8
- import { Controller, useForm } from "react-hook-form";
2
+ import { HawaButton } from "../../elements";
9
3
  import PropTypes from "prop-types";
10
4
  import { HawaContainer } from "../../layout/HawaContainer";
11
5
 
12
6
  export const AppLanding = (props) => {
13
- const methods = useForm();
14
- const {
15
- formState: { errors },
16
- handleSubmit,
17
- control
18
- } = methods;
19
-
20
7
  return (
21
8
  <HawaContainer>
22
9
  <HawaButton fullWidth text={"Sign In"} />
@@ -26,37 +13,9 @@ export const AppLanding = (props) => {
26
13
  );
27
14
  };
28
15
  AppLanding.propTypes = {
29
- /**
30
- * An object of all the texts in the blocks
31
- */
32
16
  texts: PropTypes.shape({
33
- emailLabel: PropTypes.string,
34
- emailPlaceholder: PropTypes.string,
35
- emailRequiredText: PropTypes.string,
36
- emailInvalidText: PropTypes.string,
37
- usernameLabel: PropTypes.string,
38
- usernamePlaceholder: PropTypes.string,
39
- usernameRequired: PropTypes.string,
40
- passwordLabel: PropTypes.string,
41
- passwordPlaceholder: PropTypes.string,
42
- passwordRequiredText: PropTypes.string,
43
- forgotPasswordText: PropTypes.string,
44
- newUserText: PropTypes.string,
45
- signUpText: PropTypes.string,
46
- signInText: PropTypes.string,
47
- googleButtonLabel: PropTypes.string,
48
- githubButtonLabel: PropTypes.string,
49
- twitterButtonLabel: PropTypes.string
50
- }),
51
- viaGoogle: PropTypes.bool,
52
- viaGithub: PropTypes.bool,
53
- viaTwitter: PropTypes.bool,
54
- handleSignIn: PropTypes.func,
55
- handleRouteToSignUp: PropTypes.func,
56
- handleGoogleSignIn: PropTypes.func,
57
- handleGithubSignIn: PropTypes.func,
58
- handleTwitterSignIn: PropTypes.func,
59
- handleForgotPassword: PropTypes.func,
60
-
61
- withoutSignUp: PropTypes.bool
17
+ signIn: PropTypes.string,
18
+ signUp: PropTypes.string,
19
+ language: PropTypes.string
20
+ })
62
21
  };
@@ -155,9 +155,9 @@ export const SignUpForm = (props) => {
155
155
  isSearchable={false}
156
156
  isClearable={false ?? false}
157
157
  options={[
158
- { value: "chocolate", label: "Chocolate" },
159
- { value: "strawberry", label: "Strawberry" },
160
- { value: "vanilla", label: "Vanilla" }
158
+ { value: "friend", label: "From a friend" },
159
+ { value: "ad", label: "Advertisement" },
160
+ { value: "other", label: "Other" }
161
161
  ]}
162
162
  onChange={(e, o) => console.log("chooo", e)}
163
163
  onInputChange={(e, o) => console.log("changing", e)}
@@ -4,3 +4,4 @@ export * from "./SignUpForm.js";
4
4
  export * from "./SignInForm.js";
5
5
  export * from "./CodeConfirmation.js";
6
6
  export * from "./SignInPhone";
7
+ export * from "./AppLanding";
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
 
4
4
  const AccordionItem = (props) => {
5
+ const [collapse, setCollapse] = React.useState(false);
5
6
  let noRounding =
6
7
  "flex items-center justify-between w-full p-5 font-medium text-left border border-gray-200 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white";
7
8
  let roundedTop =
@@ -23,6 +24,7 @@ const AccordionItem = (props) => {
23
24
  // ? roundedBottom
24
25
  // : noRounding
25
26
  }
27
+ onClick={() => setCollapse(!collapse)}
26
28
  data-accordion-target={"#accordion-collapse-body-" + props.count}
27
29
  aria-expanded="true"
28
30
  aria-controls={"accordion-collapse-body-" + props.count}
@@ -30,7 +32,7 @@ const AccordionItem = (props) => {
30
32
  <span>What is Flowbite?</span>
31
33
  <svg
32
34
  data-accordion-icon=""
33
- className="w-6 h-6 rotate-180 shrink-0"
35
+ className={`w-6 h-6 ${collapse ? "" : "rotate-180"} shrink-0`}
34
36
  fill="currentColor"
35
37
  viewBox="0 0 20 20"
36
38
  xmlns="http://www.w3.org/2000/svg"
@@ -45,7 +47,7 @@ const AccordionItem = (props) => {
45
47
  </h2>
46
48
  <div
47
49
  id={"accordion-collapse-body-" + props.count}
48
- className=""
50
+ className={`${collapse ? "hidden" : "block"}`}
49
51
  aria-labelledby={"accordion-collapse-heading-" + props.count}
50
52
  >
51
53
  <div className={props.count === -1 ? accPaperRounded : accPaper}>
@@ -1,23 +1,48 @@
1
- import React from "react";
1
+ import React, { useEffect } from "react";
2
2
 
3
- export const HawaModal = (props) => {
3
+ export const HawaModal = ({
4
+ open,
5
+ title,
6
+ onClose,
7
+ closeOnClickOutside,
8
+ ...props
9
+ }) => {
10
+ console.log("open : ", open);
11
+
12
+ useEffect(() => {
13
+ if (closeOnClickOutside) {
14
+ window.onclick = () => {
15
+ console.log("open : ", open);
16
+ if (open) {
17
+ console.log("Im clicing");
18
+ onClose();
19
+ }
20
+ };
21
+ }
22
+ return () => (window.onClick = null);
23
+ }, [open]);
4
24
  return (
5
25
  <div
6
26
  id={props.modalID}
7
27
  tabindex="-1"
8
28
  aria-hidden="true"
9
- className="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center"
29
+ className={`${
30
+ open ? "block" : "hidden"
31
+ } overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center`}
10
32
  >
11
33
  <div className="relative p-4 w-full max-w-2xl h-full md:h-auto">
12
34
  <div className="relative bg-white rounded-lg shadow dark:bg-gray-700">
13
35
  <div className="flex justify-between items-start p-4 rounded-t border-b dark:border-gray-600">
14
36
  <h3 className="text-xl font-semibold text-gray-900 dark:text-white">
15
- Terms of Service
37
+ {title}
16
38
  </h3>
17
39
  <button
18
40
  type="button"
19
41
  className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
20
42
  data-modal-toggle="defaultModal"
43
+ onClick={() => {
44
+ onClose();
45
+ }}
21
46
  >
22
47
  <svg
23
48
  aria-hidden="true"
@@ -70,3 +95,29 @@ export const HawaModal = (props) => {
70
95
  </div>
71
96
  );
72
97
  };
98
+
99
+ export const ModalContent = ({ children, ...props }) => {
100
+ return <div className="p-6 space-y-6">{children}</div>;
101
+ };
102
+
103
+ export const ModalFooter = ({ children, ...props }) => {
104
+ return (
105
+ <div className="flex items-center p-6 space-x-2 rounded-b border-t border-gray-200 dark:border-gray-600">
106
+ {/* <button
107
+ data-modal-toggle="defaultModal"
108
+ type="button"
109
+ className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
110
+ >
111
+ I accept
112
+ </button>
113
+ <button
114
+ data-modal-toggle="defaultModal"
115
+ type="button"
116
+ className="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
117
+ >
118
+ Decline
119
+ </button> */}
120
+ {children}
121
+ </div>
122
+ );
123
+ };
@@ -1,27 +1,39 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
 
4
- export const HawaRange = (props) => {
4
+ export const HawaRange = ({
5
+ value,
6
+ handleChange,
7
+ startElement,
8
+ endElement,
9
+ label,
10
+ ...props
11
+ }) => {
12
+ const [rangeValue, setRangeValue] = React.useState(value);
13
+
5
14
  return (
6
- <div>
7
- {props.label && (
15
+ <div {...props}>
16
+ {label && (
8
17
  <label
9
18
  htmlFor="default-range"
10
19
  className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
11
20
  >
12
- {props.label}
21
+ {label}
13
22
  </label>
14
23
  )}
15
24
  <div className="flex flex-row justify-center items-center w-fit">
16
- <div className="mr-2">{props.startElement}</div>{" "}
25
+ <div className="mr-2">{startElement}</div>{" "}
17
26
  <input
18
27
  id="default-range"
19
28
  type="range"
20
- value={props.value}
21
- onChange={props.handleChange}
29
+ value={rangeValue}
30
+ onChange={(e) => {
31
+ setRangeValue(e.target.value);
32
+ handleChange(e);
33
+ }}
22
34
  className="w-fit h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
23
35
  />
24
- <div className="ml-2">{props.endElement}</div>{" "}
36
+ <div className="ml-2">{endElement}</div>{" "}
25
37
  </div>
26
38
  </div>
27
39
  );
@@ -32,9 +44,11 @@ HawaRange.propTypes = {
32
44
  * Can be an icon
33
45
  */
34
46
  startElement: PropTypes.element,
47
+ value: PropTypes.number,
35
48
  /**
36
49
  * The element at the side where the range value is 100
37
50
  */
38
51
  endElement: PropTypes.element,
39
- handleChange: PropTypes.func
52
+ handleChange: PropTypes.func,
53
+ label : PropTypes.string
40
54
  };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  export const HawaSnackbar = (props) => {
4
+
4
5
  let severities = {
5
6
  info: "bottom-4 fixed flex items-center p-4 w-full max-w-xs text-blue-700 bg-blue-100 rounded-lg shadow dark:text-gray-400 dark:bg-gray-800",
6
7
  warning:
package/src/styles.css CHANGED
@@ -565,6 +565,9 @@ video {
565
565
  .collapse {
566
566
  visibility: collapse;
567
567
  }
568
+ .\!collapse {
569
+ visibility: collapse !important;
570
+ }
568
571
  .fixed {
569
572
  position: fixed;
570
573
  }