@sikka/hawa 0.0.13 → 0.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "UI Kit",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.es.js",
@@ -0,0 +1,47 @@
1
+ import React from "react";
2
+ import Container from "@mui/material/Container";
3
+ import { HawaPricingCard, HawaRadio } from "../../elements";
4
+
5
+ export const PricingPlans = (props) => {
6
+ return (
7
+ <Container style={{ width: "fit-content" }} variant="plain">
8
+ <div
9
+ style={{
10
+ display: "flex",
11
+ flexDirection: "row",
12
+ justifyContent: "space-between",
13
+
14
+ marginBottom: 10
15
+ }}
16
+ >
17
+ <HawaRadio
18
+ location="inPricing"
19
+ handleChange={(e) => console.log("changing to ", e)}
20
+ defaultValue="usd"
21
+ options={[
22
+ { label: `Monthly`, value: `usd` },
23
+ { label: `3 Months`, value: `3-months` },
24
+ { label: `6 Months`, value: `6-months` },
25
+ { label: `Annually`, value: `annual` }
26
+ ]}
27
+ />
28
+
29
+ <HawaRadio
30
+ location="inPricing"
31
+ handleChange={(e) => console.log("changing to ", e)}
32
+ defaultValue="usd"
33
+ options={[
34
+ { label: `USD`, value: `usd` },
35
+ { label: `SAR`, value: `sar` }
36
+ ]}
37
+ />
38
+ </div>
39
+
40
+ <Container variant="pricing">
41
+ {props.plans.map((plan) => {
42
+ return <HawaPricingCard lang={props.lang} {...plan} />;
43
+ })}
44
+ </Container>
45
+ </Container>
46
+ );
47
+ };
@@ -0,0 +1,115 @@
1
+ import React from "react";
2
+ import Container from "@mui/material/Container";
3
+ import { Button, Typography } from "@mui/material";
4
+ import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
5
+ export const HawaPricingCard = (props) => {
6
+ return (
7
+ <Container
8
+ maxWidth="xs"
9
+ variant={props.selectedPlan ? "selected-plan-card" : "plan-card"}
10
+ style={{ direction: props.lang === "ar" ? "rtl" : "ltr" }}
11
+ >
12
+ <Container variant="plan-header">
13
+ <Typography variant="h3" fontWeight={500}>
14
+ {props.title}
15
+ </Typography>
16
+ <Typography variant="caption">{props.subtitle}</Typography>
17
+ <br />
18
+ <Typography
19
+ variant="h4"
20
+ fontWeight={500}
21
+ style={{
22
+ display: "flex",
23
+ // flexDirection: "column",
24
+ alignItems: "center"
25
+ // justifyContent: props.lang === "ar" ? "" : "center"
26
+ }}
27
+ >
28
+ {props.lang === "ar" ? (
29
+ <div
30
+ style={{
31
+ width: "100%",
32
+ display: "flex",
33
+ flexDirection: "column",
34
+ justifyContent: "center"
35
+ // alignItems: "center"
36
+ }}
37
+ >
38
+ <div style={{ display: "flex", flexDirection: "row" }}>
39
+ {props.price}
40
+ <div style={{ width: 5 }} />
41
+ <Typography>{props.currency}</Typography>
42
+ </div>
43
+ <Typography style={{ fontSize: 14, margin: 5 }}>
44
+ {props.cycleText}
45
+ </Typography>
46
+ </div>
47
+ ) : (
48
+ <div
49
+ style={{
50
+ width: "100%",
51
+ display: "flex",
52
+ flexDirection: "column",
53
+ justifyContent: "center"
54
+ // alignItems: "center"
55
+ }}
56
+ >
57
+ <div style={{ display: "flex", flexDirection: "row" }}>
58
+ <Typography>{props.currency}</Typography>
59
+ <div style={{ width: 5 }} />
60
+ {props.price}
61
+ </div>
62
+ <Typography style={{ fontSize: 14, margin: 5 }}>
63
+ {props.cycleText}
64
+ </Typography>
65
+ </div>
66
+ )}
67
+ {/* {props.lang === "ar" ? null : (
68
+ <Typography style={{ fontSize: 14, margin: 5 }}>
69
+ {" / "}
70
+ {props.cycleText}
71
+ </Typography>
72
+ )} */}
73
+ </Typography>
74
+ </Container>
75
+
76
+ <div
77
+ style={{ padding: 20, color: props.selectedPlan ? "white" : "black" }}
78
+ >
79
+ {props.features?.map((feature) => {
80
+ return (
81
+ <div
82
+ style={{
83
+ display: "flex",
84
+ flexDirection: "row",
85
+ alignItems: "center",
86
+ justifyContent: "flex-start",
87
+ marginTop: 10,
88
+ width: "100%"
89
+ }}
90
+ >
91
+ <div
92
+ style={{
93
+ display: "flex",
94
+ flexDirection: "row",
95
+ justifyContent: "flex-end",
96
+ width: "10%"
97
+ }}
98
+ >
99
+ <CheckIcon fontSize="small" />
100
+ </div>
101
+ <div style={{ width: 10 }} />
102
+ <Typography variant="subtitle2">{feature}</Typography>
103
+ </div>
104
+ );
105
+ })}
106
+ </div>
107
+ <Button
108
+ variant={props.selectedPlan ? "outlined" : "contained"}
109
+ style={{ margin: 20 }}
110
+ >
111
+ {props.buttonText}
112
+ </Button>
113
+ </Container>
114
+ );
115
+ };
@@ -5,9 +5,7 @@ import Container from "@mui/material/Container";
5
5
  export const HawaRadio = (props) => {
6
6
  const [value, setValue] = useState(props.defaultValue);
7
7
  return (
8
- <Container
9
- variant={props.location === "inSettings" ? "inSettings" : "panelTabs"}
10
- >
8
+ <Container variant={props.location || "panelTabs"}>
11
9
  {props.options.map((singleOption, i) => {
12
10
  return (
13
11
  <Button
@@ -2,7 +2,7 @@ export * from "./AdaptiveButton";
2
2
  export * from "./ActionButton";
3
3
  export * from "./HawaCheckbox";
4
4
  export * from "./HawaRadio";
5
- export * from "./HawaCard";
5
+ export * from "./HawaPricingCard";
6
6
  export * from "./HawaSettingsRow";
7
7
  export * from "./HawaLogoButton";
8
8
  export * from "./HawaButton";
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ import { PricingPlans } from "../../../blocks/Pricing/PricingPlans";
3
+
4
+ export default {
5
+ title: "Blocks/Pricing/In Billing",
6
+ component: [PricingPlans],
7
+ argTypes: {}
8
+ };
9
+
10
+ export const InBilling = (args) => {
11
+ return (
12
+ <PricingPlans
13
+ {...args}
14
+ plans={[
15
+ {
16
+ title: "Free",
17
+ subtitle: "For everyone",
18
+ price: 0,
19
+ currency: "SAR",
20
+ cycleText: "Monthly",
21
+ buttonText: "Select Plan",
22
+ features: ["one", "two", "three"]
23
+ },
24
+ {
25
+ title: "Intro",
26
+ subtitle: "For beginners",
27
+ selectedPlan: true,
28
+ price: 10,
29
+ currency: "SAR",
30
+ cycleText: "Monthly",
31
+ buttonText: "Current Plan",
32
+ features: ["one", "two", "three"]
33
+ },
34
+ {
35
+ title: "Pro",
36
+ subtitle: "For professionals",
37
+ price: 30,
38
+ currency: "SAR",
39
+ cycleText: "Monthly",
40
+ buttonText: "Select Plan",
41
+ features: ["one", "two", "three"]
42
+ }
43
+ ]}
44
+ />
45
+ );
46
+ };
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import { PricingPlans } from "../../../blocks/Pricing/PricingPlans";
3
+
4
+ export default {
5
+ title: "Blocks/Pricing/In Landing",
6
+ component: [PricingPlans],
7
+ argTypes: {}
8
+ };
9
+
10
+ export const InLanding = (args) => {
11
+ return (
12
+ <PricingPlans
13
+ {...args}
14
+ plans={[
15
+ {
16
+ title: "Free",
17
+ subtitle: "For everyone",
18
+ price: 0,
19
+ currency: "SAR",
20
+ cycleText: "Monthly",
21
+ buttonText: "Select Plan",
22
+ features: ["one", "two", "three"]
23
+ },
24
+ {
25
+ title: "Intro",
26
+ subtitle: "For beginners",
27
+ price: 10,
28
+ currency: "SAR",
29
+ cycleText: "Monthly",
30
+ buttonText: "Select Plan",
31
+ features: ["one", "two", "three"]
32
+ },
33
+ {
34
+ title: "Pro",
35
+ subtitle: "For professionals",
36
+ price: 30,
37
+ currency: "SAR",
38
+ cycleText: "Monthly",
39
+ buttonText: "Select Plan",
40
+ features: ["one", "two", "three"]
41
+ }
42
+ ]}
43
+ />
44
+ );
45
+ };
@@ -1,27 +1,91 @@
1
- import { Container } from "@mui/material";
2
1
  import React from "react";
3
- import { HawaCard } from "../../elements";
2
+ import { HawaPricingCard } from "../../elements";
4
3
 
5
4
  export default {
6
5
  title: "Elements/Cards/Pricing",
7
- component: [HawaCard],
6
+ component: [HawaPricingCard],
8
7
  argTypes: {
9
- buttonLabel: {
8
+ title: {
10
9
  control: "text",
11
- description: "The text next to the logo"
10
+ description: "The title of the pricing package"
11
+ },
12
+ subtitle: {
13
+ control: "text",
14
+ description: "The subtitle of the pricing package"
15
+ },
16
+ price: {
17
+ control: "number",
18
+ description: "The price of the pricing package"
19
+ },
20
+ currency: {
21
+ control: "text",
22
+ description: "The currency of the price",
23
+ table: {
24
+ type: {
25
+ summary: "Examples",
26
+ detail: "$, SAR, ريال, دولار"
27
+ }
28
+ }
29
+ },
30
+ cycleText: {
31
+ control: "text",
32
+ description: "The cycle period of the payment",
33
+ table: {
34
+ type: {
35
+ summary: "Examples",
36
+ detail: "Monthly, Annually, Quarterly, Every 3 Months, Every 6 Months"
37
+ }
38
+ }
39
+ },
40
+ features: {
41
+ control: "array",
42
+ description: "An Array of strings for the package features"
43
+ },
44
+ lang: {
45
+ control: "text",
46
+ description: "The language of the card to change the direction",
47
+ table: {
48
+ type: {
49
+ summary: "Options",
50
+ detail: "ar, en"
51
+ }
52
+ }
53
+ },
54
+ buttonText: {
55
+ control: "text",
56
+ description: "The text of the button"
12
57
  }
58
+ },
59
+ args: {
60
+ title: "Pro",
61
+ subtitle: "For small businesses",
62
+ price: 300,
63
+ currency: "$",
64
+ cycleText: "Monthly",
65
+ buttonText: "Select Plan"
13
66
  }
14
67
  };
15
68
 
16
- export const Pricing = (args) => {
69
+ export const LTR = (args) => {
17
70
  return (
18
- <HawaCard
19
- title="Pro"
20
- subtitle="For small business"
21
- price="300"
22
- currency="SAR"
23
- cycleText="Every 6 months"
71
+ <HawaPricingCard
72
+ {...args}
24
73
  features={["Unlimited Menus", "Unlimited Items", "Custom Handle"]}
25
74
  />
26
75
  );
27
76
  };
77
+
78
+ export const RTL = (args) => {
79
+ return (
80
+ <HawaPricingCard
81
+ lang="ar"
82
+ title="الإحترافي"
83
+ subtitle="للمنشئات الصغيرة"
84
+ price="300"
85
+ currency="ريال"
86
+ cycleText="كل 6 أشهر"
87
+ buttonText="إختر الباقة"
88
+ features={["قوائم لا محدودة", "عناصر لا محدودة", "أسم مخصص"]}
89
+ />
90
+ );
91
+ };
package/src/styles.css CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  .reset_password_root {
2
3
  display: flex;
3
4
  flex-direction: column;
@@ -345,4 +345,4 @@
345
345
 
346
346
 
347
347
 
348
- window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.f1ebae9b.iframe.bundle.js"></script><script src="vendors~main.5eab66d3.iframe.bundle.js"></script><script src="main.00b064cb.iframe.bundle.js"></script></body></html>
348
+ window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.f1ebae9b.iframe.bundle.js"></script><script src="vendors~main.5eab66d3.iframe.bundle.js"></script><script src="main.e382d866.iframe.bundle.js"></script></body></html>
@@ -37,7 +37,7 @@
37
37
  /* eslint-enable object-shorthand */
38
38
  })
39
39
  );
40
- };</script><link rel="shortcut icon" href="/favicon.ico"/><link rel="icon" type="image/png" href="/hawa-icon.png" sizes="192x192"/><style>#root[hidden],
40
+ };</script><link rel="shortcut icon" href="/favicon.ico"/><link rel="icon" type="image/png" href="/hawa-icon.png" sizes="192x192"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&display=swap" rel="stylesheet"/><style>#root[hidden],
41
41
  #docs-root[hidden] {
42
42
  display: none !important;
43
43
  }</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";