@sikka/hawa 0.1.11 → 0.1.13
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/styles.css +62 -0
- package/es/elements/InterfaceSettings.d.ts +2 -2
- package/es/elements/index.d.ts +1 -0
- package/es/index.es.js +3 -3
- package/lib/elements/InterfaceSettings.d.ts +2 -2
- package/lib/elements/index.d.ts +1 -0
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/elements/Button.tsx +1 -1
- package/src/elements/HawaAlert.tsx +1 -1
- package/src/elements/HawaRadio.tsx +3 -3
- package/src/elements/HawaStats.tsx +12 -35
- package/src/elements/HawaTextField.tsx +1 -1
- package/src/elements/InterfaceSettings.tsx +15 -7
- package/src/elements/index.ts +1 -0
- package/src/styles.css +62 -0
- package/src/tailwind.css +48 -1
package/package.json
CHANGED
package/src/elements/Button.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { cn } from "../util"
|
|
|
6
6
|
import { HawaLoading } from "./HawaLoading"
|
|
7
7
|
|
|
8
8
|
const buttonVariants = cva(
|
|
9
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
9
|
+
"inline-flex items-center justify-center select-none rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
@@ -168,7 +168,7 @@ export const HawaAlert: React.FunctionComponent<AlertTypes> = ({
|
|
|
168
168
|
<button
|
|
169
169
|
type="button"
|
|
170
170
|
className={clsx(
|
|
171
|
-
"absolute top-2 inline-flex h-9 w-9 items-center justify-center rounded-inner p-1.5 text-gray-400 transition-all hover:text-gray-900
|
|
171
|
+
"absolute top-2 inline-flex h-9 w-9 items-center justify-center rounded-inner p-1.5 text-gray-400 transition-all hover:text-gray-900",
|
|
172
172
|
closeButtonStyle[props.severity],
|
|
173
173
|
direction === "rtl" ? "left-2" : "right-2"
|
|
174
174
|
)}
|
|
@@ -22,9 +22,9 @@ export const HawaRadio: FC<RadioTypes> = ({
|
|
|
22
22
|
}) => {
|
|
23
23
|
const [selectedOption, setSelectedOption] = useState(props.defaultValue)
|
|
24
24
|
let activeTabStyle =
|
|
25
|
-
"inline-block py-2 px-4 w-full text-
|
|
25
|
+
"inline-block py-2 px-4 w-full text-primary-foreground bg-primary active dark:bg-primary "
|
|
26
26
|
let inactiveTabStyle =
|
|
27
|
-
"inline-block py-2 px-4 w-full dark:bg-background bg-
|
|
27
|
+
"inline-block py-2 px-4 w-full transition-all hover:bg-primary/10 dark:bg-background bg-primary/5 hover:text-gray-900 dark:hover:bg-primary/10 dark:hover:text-white dark:bg-primary/5"
|
|
28
28
|
let orientationStyle = {
|
|
29
29
|
horizontal: "flex flex-row",
|
|
30
30
|
vertical: "flex flex-col",
|
|
@@ -37,7 +37,7 @@ export const HawaRadio: FC<RadioTypes> = ({
|
|
|
37
37
|
props.options?.length > 2
|
|
38
38
|
? "flex-wrap xs:max-w-full xs:flex-nowrap"
|
|
39
39
|
: "",
|
|
40
|
-
" max-w-fit whitespace-nowrap rounded border text-center text-sm font-medium",
|
|
40
|
+
" max-w-fit whitespace-nowrap rounded border text-center text-sm font-medium select-none",
|
|
41
41
|
orientationStyle[orientation]
|
|
42
42
|
)}
|
|
43
43
|
>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { FC } from "react"
|
|
2
|
-
import clsx from "clsx"
|
|
3
|
-
import { HawaLoading } from "./HawaLoading"
|
|
4
2
|
import { Card, CardContent, CardHeader, CardTitle } from "./Card"
|
|
3
|
+
import { Skeleton } from "./Skeleton"
|
|
5
4
|
|
|
6
5
|
type StatTypes = {
|
|
7
6
|
label?: string
|
|
@@ -28,41 +27,19 @@ export const HawaStats: FC<StatTypes> = ({ variant = "default", ...props }) => {
|
|
|
28
27
|
{props.icon && props.icon}
|
|
29
28
|
</CardHeader>
|
|
30
29
|
<CardContent>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
{props.isLoading ? (
|
|
31
|
+
<Skeleton className="h-8 w-3/4" />
|
|
32
|
+
) : (
|
|
33
|
+
<div className="text-2xl font-bold">{props.number}</div>
|
|
34
|
+
)}
|
|
35
|
+
{props.isLoading ? (
|
|
36
|
+
<Skeleton className="mt-2 h-4 w-1/2" />
|
|
37
|
+
) : (
|
|
38
|
+
props.helperText && (
|
|
39
|
+
<p className="text-xs text-muted-foreground">{props.helperText}</p>
|
|
40
|
+
)
|
|
34
41
|
)}
|
|
35
42
|
</CardContent>
|
|
36
43
|
</Card>
|
|
37
|
-
|
|
38
|
-
// <Card>
|
|
39
|
-
|
|
40
|
-
// <CardContent
|
|
41
|
-
// // headless
|
|
42
|
-
// className={clsx(
|
|
43
|
-
// // defaultStyle,
|
|
44
|
-
// // widthStyles[props.width],
|
|
45
|
-
// statStyles[variant],
|
|
46
|
-
// props.handleClick ? "cursor-pointer" : "cursor-default",
|
|
47
|
-
// props.handleClick && variant === "dropshadow"
|
|
48
|
-
// ? "hover:drop-shadow-lg"
|
|
49
|
-
// : ""
|
|
50
|
-
// )}
|
|
51
|
-
// onClick={props.handleClick}
|
|
52
|
-
// >
|
|
53
|
-
// {props.icon && <div className="mb-2">{props.icon} </div>}
|
|
54
|
-
// {/* <div>{props.label}</div> */}
|
|
55
|
-
// {props.isLoading ? (
|
|
56
|
-
// <HawaLoading />
|
|
57
|
-
// ) : (
|
|
58
|
-
// <div className="text-2xl font-bold">{props.number}</div>
|
|
59
|
-
// )}
|
|
60
|
-
// {props.helperText ? (
|
|
61
|
-
// <div className="text-xs text-muted-foreground">
|
|
62
|
-
// {props.helperText}
|
|
63
|
-
// </div>
|
|
64
|
-
// ) : null}
|
|
65
|
-
// </CardContent>
|
|
66
|
-
// </Card>
|
|
67
44
|
)
|
|
68
45
|
}
|
|
@@ -53,7 +53,7 @@ export const HawaTextField: FC<TextFieldTypes> = ({
|
|
|
53
53
|
|
|
54
54
|
let defaultStyle = "flex max-h-fit flex-col justify-center gap-2"
|
|
55
55
|
let defaultInputStyle =
|
|
56
|
-
"block w-full rounded border bg-background p-2 text-sm text-
|
|
56
|
+
"block w-full rounded border bg-background p-2 text-sm text-black dark:text-white focus:border-blue-500 focus:ring-blue-500"
|
|
57
57
|
let previewInputStyle =
|
|
58
58
|
"block w-full rounded bg-gray-50 p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
59
59
|
// "mb-0 block w-full rounded border border-gray-300 bg-gray-50 p-2 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500",
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import React, { FC } from "react"
|
|
1
|
+
import React, { FC, useState } from "react"
|
|
2
2
|
import { HawaRadio } from "./HawaRadio"
|
|
3
3
|
|
|
4
4
|
type TypographyTypes = {
|
|
5
|
-
handleLanguage: () => void
|
|
5
|
+
handleLanguage: (e) => void
|
|
6
6
|
currentLanguage: any
|
|
7
|
-
handleColorMode: () => void
|
|
7
|
+
handleColorMode: (e) => void
|
|
8
8
|
currentColorMode: any
|
|
9
9
|
}
|
|
10
10
|
export const InterfaceSettings: FC<TypographyTypes> = (props) => {
|
|
11
|
+
const [color, setColor] = useState(props.currentColorMode)
|
|
12
|
+
const [language, setLanguage] = useState(props.currentLanguage)
|
|
11
13
|
return (
|
|
12
14
|
<div className="mt-6 flex flex-row justify-between">
|
|
13
15
|
<HawaRadio
|
|
14
|
-
defaultValue={
|
|
15
|
-
onChangeTab={
|
|
16
|
+
defaultValue={language}
|
|
17
|
+
onChangeTab={(e) => {
|
|
18
|
+
props.handleLanguage(e)
|
|
19
|
+
setLanguage(e)
|
|
20
|
+
}}
|
|
16
21
|
design="tabs"
|
|
17
22
|
options={[
|
|
18
23
|
{ value: "ar", label: "عربي" },
|
|
@@ -20,8 +25,11 @@ export const InterfaceSettings: FC<TypographyTypes> = (props) => {
|
|
|
20
25
|
]}
|
|
21
26
|
/>
|
|
22
27
|
<HawaRadio
|
|
23
|
-
defaultValue={
|
|
24
|
-
onChangeTab={
|
|
28
|
+
defaultValue={color}
|
|
29
|
+
onChangeTab={(e) => {
|
|
30
|
+
props.handleLanguage(e)
|
|
31
|
+
setColor(e)
|
|
32
|
+
}}
|
|
25
33
|
design="tabs"
|
|
26
34
|
options={[
|
|
27
35
|
{
|
package/src/elements/index.ts
CHANGED
package/src/styles.css
CHANGED
|
@@ -1171,6 +1171,9 @@ video {
|
|
|
1171
1171
|
.w-3 {
|
|
1172
1172
|
width: 0.75rem;
|
|
1173
1173
|
}
|
|
1174
|
+
.w-3\/4 {
|
|
1175
|
+
width: 75%;
|
|
1176
|
+
}
|
|
1174
1177
|
.w-32 {
|
|
1175
1178
|
width: 8rem;
|
|
1176
1179
|
}
|
|
@@ -1942,6 +1945,9 @@ video {
|
|
|
1942
1945
|
.bg-primary\/20 {
|
|
1943
1946
|
background-color: hsl(var(--primary) / 0.2);
|
|
1944
1947
|
}
|
|
1948
|
+
.bg-primary\/5 {
|
|
1949
|
+
background-color: hsl(var(--primary) / 0.05);
|
|
1950
|
+
}
|
|
1945
1951
|
.bg-red-100 {
|
|
1946
1952
|
--tw-bg-opacity: 1;
|
|
1947
1953
|
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
|
|
@@ -2649,6 +2655,53 @@ video {
|
|
|
2649
2655
|
scrollbar-width: none; /* Firefox */
|
|
2650
2656
|
}
|
|
2651
2657
|
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;700&display=swap");
|
|
2658
|
+
/*
|
|
2659
|
+
@layer base {
|
|
2660
|
+
:root {
|
|
2661
|
+
--background: 0 0% 100%;
|
|
2662
|
+
--foreground: 240 10% 3.9%;
|
|
2663
|
+
--card: 0 0% 100%;
|
|
2664
|
+
--card-foreground: 240 10% 3.9%;
|
|
2665
|
+
--popover: 0 0% 100%;
|
|
2666
|
+
--popover-foreground: 240 10% 3.9%;
|
|
2667
|
+
--primary: 346.8 77.2% 49.8%;
|
|
2668
|
+
--primary-foreground: 355.7 100% 97.3%;
|
|
2669
|
+
--secondary: 240 4.8% 95.9%;
|
|
2670
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
2671
|
+
--muted: 240 4.8% 95.9%;
|
|
2672
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
2673
|
+
--accent: 240 4.8% 95.9%;
|
|
2674
|
+
--accent-foreground: 240 5.9% 10%;
|
|
2675
|
+
--destructive: 0 84.2% 60.2%;
|
|
2676
|
+
--destructive-foreground: 0 0% 98%;
|
|
2677
|
+
--border: 240 5.9% 90%;
|
|
2678
|
+
--input: 240 5.9% 90%;
|
|
2679
|
+
--ring: 346.8 77.2% 49.8%;
|
|
2680
|
+
--radius: 1rem;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
.dark {
|
|
2684
|
+
--background: 20 14.3% 4.1%;
|
|
2685
|
+
--foreground: 0 0% 95%;
|
|
2686
|
+
--card: 24 9.8% 10%;
|
|
2687
|
+
--card-foreground: 0 0% 95%;
|
|
2688
|
+
--popover: 0 0% 9%;
|
|
2689
|
+
--popover-foreground: 0 0% 95%;
|
|
2690
|
+
--primary: 346.8 77.2% 49.8%;
|
|
2691
|
+
--primary-foreground: 355.7 100% 97.3%;
|
|
2692
|
+
--secondary: 240 3.7% 15.9%;
|
|
2693
|
+
--secondary-foreground: 0 0% 98%;
|
|
2694
|
+
--muted: 0 0% 15%;
|
|
2695
|
+
--muted-foreground: 240 5% 64.9%;
|
|
2696
|
+
--accent: 12 6.5% 15.1%;
|
|
2697
|
+
--accent-foreground: 0 0% 98%;
|
|
2698
|
+
--destructive: 0 62.8% 30.6%;
|
|
2699
|
+
--destructive-foreground: 0 85.7% 97.3%;
|
|
2700
|
+
--border: 240 3.7% 15.9%;
|
|
2701
|
+
--input: 240 3.7% 15.9%;
|
|
2702
|
+
--ring: 346.8 77.2% 49.8%;
|
|
2703
|
+
}
|
|
2704
|
+
} */
|
|
2652
2705
|
body {
|
|
2653
2706
|
font-family: "IBM Plex Sans Arabic", sans-serif;
|
|
2654
2707
|
}
|
|
@@ -2851,6 +2904,9 @@ body {
|
|
|
2851
2904
|
.hover\:bg-primary-foreground:hover {
|
|
2852
2905
|
background-color: hsl(var(--primary-foreground));
|
|
2853
2906
|
}
|
|
2907
|
+
.hover\:bg-primary\/10:hover {
|
|
2908
|
+
background-color: hsl(var(--primary) / 0.1);
|
|
2909
|
+
}
|
|
2854
2910
|
.hover\:bg-primary\/90:hover {
|
|
2855
2911
|
background-color: hsl(var(--primary) / 0.9);
|
|
2856
2912
|
}
|
|
@@ -3280,6 +3336,9 @@ body {
|
|
|
3280
3336
|
:is(.dark .dark\:bg-primary) {
|
|
3281
3337
|
background-color: hsl(var(--primary));
|
|
3282
3338
|
}
|
|
3339
|
+
:is(.dark .dark\:bg-primary\/5) {
|
|
3340
|
+
background-color: hsl(var(--primary) / 0.05);
|
|
3341
|
+
}
|
|
3283
3342
|
:is(.dark .dark\:bg-red-200) {
|
|
3284
3343
|
--tw-bg-opacity: 1;
|
|
3285
3344
|
background-color: rgb(254 202 202 / var(--tw-bg-opacity));
|
|
@@ -3388,6 +3447,9 @@ body {
|
|
|
3388
3447
|
:is(.dark .dark\:hover\:bg-layoutPrimary-700:hover) {
|
|
3389
3448
|
background-color: var(--layout-primary-700);
|
|
3390
3449
|
}
|
|
3450
|
+
:is(.dark .dark\:hover\:bg-primary\/10:hover) {
|
|
3451
|
+
background-color: hsl(var(--primary) / 0.1);
|
|
3452
|
+
}
|
|
3391
3453
|
:is(.dark .dark\:hover\:text-blue-500:hover) {
|
|
3392
3454
|
--tw-text-opacity: 1;
|
|
3393
3455
|
color: rgb(59 130 246 / var(--tw-text-opacity));
|
package/src/tailwind.css
CHANGED
|
@@ -2,6 +2,53 @@
|
|
|
2
2
|
@import "tailwindcss/components";
|
|
3
3
|
@import "tailwindcss/utilities";
|
|
4
4
|
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;700&display=swap");
|
|
5
|
+
/*
|
|
6
|
+
@layer base {
|
|
7
|
+
:root {
|
|
8
|
+
--background: 0 0% 100%;
|
|
9
|
+
--foreground: 240 10% 3.9%;
|
|
10
|
+
--card: 0 0% 100%;
|
|
11
|
+
--card-foreground: 240 10% 3.9%;
|
|
12
|
+
--popover: 0 0% 100%;
|
|
13
|
+
--popover-foreground: 240 10% 3.9%;
|
|
14
|
+
--primary: 346.8 77.2% 49.8%;
|
|
15
|
+
--primary-foreground: 355.7 100% 97.3%;
|
|
16
|
+
--secondary: 240 4.8% 95.9%;
|
|
17
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
18
|
+
--muted: 240 4.8% 95.9%;
|
|
19
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
20
|
+
--accent: 240 4.8% 95.9%;
|
|
21
|
+
--accent-foreground: 240 5.9% 10%;
|
|
22
|
+
--destructive: 0 84.2% 60.2%;
|
|
23
|
+
--destructive-foreground: 0 0% 98%;
|
|
24
|
+
--border: 240 5.9% 90%;
|
|
25
|
+
--input: 240 5.9% 90%;
|
|
26
|
+
--ring: 346.8 77.2% 49.8%;
|
|
27
|
+
--radius: 1rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dark {
|
|
31
|
+
--background: 20 14.3% 4.1%;
|
|
32
|
+
--foreground: 0 0% 95%;
|
|
33
|
+
--card: 24 9.8% 10%;
|
|
34
|
+
--card-foreground: 0 0% 95%;
|
|
35
|
+
--popover: 0 0% 9%;
|
|
36
|
+
--popover-foreground: 0 0% 95%;
|
|
37
|
+
--primary: 346.8 77.2% 49.8%;
|
|
38
|
+
--primary-foreground: 355.7 100% 97.3%;
|
|
39
|
+
--secondary: 240 3.7% 15.9%;
|
|
40
|
+
--secondary-foreground: 0 0% 98%;
|
|
41
|
+
--muted: 0 0% 15%;
|
|
42
|
+
--muted-foreground: 240 5% 64.9%;
|
|
43
|
+
--accent: 12 6.5% 15.1%;
|
|
44
|
+
--accent-foreground: 0 0% 98%;
|
|
45
|
+
--destructive: 0 62.8% 30.6%;
|
|
46
|
+
--destructive-foreground: 0 85.7% 97.3%;
|
|
47
|
+
--border: 240 3.7% 15.9%;
|
|
48
|
+
--input: 240 3.7% 15.9%;
|
|
49
|
+
--ring: 346.8 77.2% 49.8%;
|
|
50
|
+
}
|
|
51
|
+
} */
|
|
5
52
|
|
|
6
53
|
@layer base {
|
|
7
54
|
:root {
|
|
@@ -165,7 +212,7 @@
|
|
|
165
212
|
|
|
166
213
|
@layer components {
|
|
167
214
|
.clickable-link {
|
|
168
|
-
@apply cursor-pointer text-primary/80 underline underline-offset-4 hover:text-primary
|
|
215
|
+
@apply cursor-pointer text-primary/80 underline underline-offset-4 transition-all hover:text-primary;
|
|
169
216
|
}
|
|
170
217
|
}
|
|
171
218
|
@layer utilities {
|