@sikka/hawa 0.0.262 → 0.0.263
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 +6 -14
- package/es/elements/HawaCodeBlock.d.ts +1 -0
- package/es/index.es.js +3 -3
- package/lib/elements/HawaCodeBlock.d.ts +1 -0
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/elements/HawaCodeBlock.tsx +20 -3
- package/src/elements/HawaMenu.tsx +5 -5
- package/src/elements/HawaSpinner.tsx +18 -2
- package/src/layout/HawaAppLayoutSimplified.tsx +54 -43
- package/src/styles.css +6 -14
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import clsx from "clsx"
|
|
|
4
4
|
type CodeBlockTypes = {
|
|
5
5
|
color?: "dark" | "light"
|
|
6
6
|
language?: string
|
|
7
|
+
width?: "full" | "md" | "sm"
|
|
7
8
|
tabs?: TabsTypes[]
|
|
8
9
|
code?: string
|
|
9
10
|
}
|
|
@@ -12,11 +13,27 @@ type TabsTypes = {
|
|
|
12
13
|
code: string
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
16
|
+
export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
17
|
+
tabs,
|
|
18
|
+
language,
|
|
19
|
+
code,
|
|
20
|
+
width = "full",
|
|
21
|
+
}) => {
|
|
16
22
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
17
|
-
|
|
23
|
+
let widthStyles = {
|
|
24
|
+
full: "w-full",
|
|
25
|
+
md: "w-full max-w-md",
|
|
26
|
+
sm: "w-full max-w-sm",
|
|
27
|
+
xs: "w-full max-w-xs",
|
|
28
|
+
}
|
|
18
29
|
return (
|
|
19
|
-
<div
|
|
30
|
+
<div
|
|
31
|
+
className={clsx(
|
|
32
|
+
widthStyles[width],
|
|
33
|
+
"w-full flex-col items-center space-x-4 rounded bg-gray-800 text-left text-sm text-white sm:text-base"
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
{" "}
|
|
20
37
|
{tabs && (
|
|
21
38
|
<div className="flex flex-row gap-2 rounded-t bg-gray-700 p-2 pb-0">
|
|
22
39
|
{tabs.map((tab, i) => (
|
|
@@ -195,13 +195,13 @@ export const HawaMenu: FC<TMenuTypes> = ({
|
|
|
195
195
|
}
|
|
196
196
|
}}
|
|
197
197
|
className={clsx(
|
|
198
|
+
"transition-all",
|
|
198
199
|
item.isButton
|
|
199
|
-
? "flex cursor-pointer flex-row items-center rounded bg-buttonPrimary-500 px-4 py-2 text-white
|
|
200
|
-
:
|
|
201
|
-
sizeStyles[size],
|
|
202
|
-
item.disabled
|
|
200
|
+
? "flex cursor-pointer flex-row items-center rounded bg-buttonPrimary-500 px-4 py-2 text-white hover:bg-buttonPrimary-700 rtl:flex-row-reverse"
|
|
201
|
+
: item.disabled
|
|
203
202
|
? "text-gray-300"
|
|
204
|
-
: " cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600
|
|
203
|
+
: " flex cursor-pointer flex-row items-center rounded hover:bg-gray-200 rtl:flex-row-reverse dark:hover:bg-gray-600 dark:hover:text-white ",
|
|
204
|
+
sizeStyles[size]
|
|
205
205
|
)}
|
|
206
206
|
>
|
|
207
207
|
{item.icon && (
|
|
@@ -15,12 +15,28 @@ export const HawaSpinner: FC<SpinnerTypes> = ({ size = "sm", ...props }) => {
|
|
|
15
15
|
}
|
|
16
16
|
return (
|
|
17
17
|
<div className="flex flex-row gap-x-3">
|
|
18
|
-
<div
|
|
18
|
+
{/* <div
|
|
19
19
|
className={clsx(
|
|
20
20
|
sizeStyles[size],
|
|
21
21
|
"animate-spin rounded-full border-4 border-gray-400 border-t-white text-white"
|
|
22
22
|
)}
|
|
23
|
-
></div>
|
|
23
|
+
></div> */}
|
|
24
|
+
|
|
25
|
+
<div aria-label="Loading..." role="status">
|
|
26
|
+
<svg
|
|
27
|
+
className={clsx(sizeStyles[size], "animate-spin")}
|
|
28
|
+
viewBox="3 3 18 18"
|
|
29
|
+
>
|
|
30
|
+
<path
|
|
31
|
+
className="fill-gray-200"
|
|
32
|
+
d="M12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5ZM3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12Z"
|
|
33
|
+
></path>
|
|
34
|
+
<path
|
|
35
|
+
className="fill-buttonPrimary-500"
|
|
36
|
+
d="M16.9497 7.05015C14.2161 4.31648 9.78392 4.31648 7.05025 7.05015C6.65973 7.44067 6.02656 7.44067 5.63604 7.05015C5.24551 6.65962 5.24551 6.02646 5.63604 5.63593C9.15076 2.12121 14.8492 2.12121 18.364 5.63593C18.7545 6.02646 18.7545 6.65962 18.364 7.05015C17.9734 7.44067 17.3403 7.44067 16.9497 7.05015Z"
|
|
37
|
+
></path>
|
|
38
|
+
</svg>
|
|
39
|
+
</div>
|
|
24
40
|
</div>
|
|
25
41
|
)
|
|
26
42
|
}
|
|
@@ -2,7 +2,6 @@ import React, { useEffect, useRef, useState } from "react"
|
|
|
2
2
|
import clsx from "clsx"
|
|
3
3
|
import { HiMenu } from "react-icons/hi"
|
|
4
4
|
import { FaChevronRight } from "react-icons/fa"
|
|
5
|
-
import { FiSettings } from "react-icons/fi"
|
|
6
5
|
import useDiscloser from "../hooks/useDiscloser"
|
|
7
6
|
import useBreakpoint from "../hooks/useBreakpoint"
|
|
8
7
|
import { HawaButton, HawaMenu } from "../elements"
|
|
@@ -83,7 +82,7 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
83
82
|
let drawerSizeCondition =
|
|
84
83
|
size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0
|
|
85
84
|
return (
|
|
86
|
-
<div className="fixed left-0
|
|
85
|
+
<div className="fixed left-0">
|
|
87
86
|
{props.topBar && (
|
|
88
87
|
<div
|
|
89
88
|
className={clsx(
|
|
@@ -126,7 +125,7 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
126
125
|
// Mobile Drawer Menu Button
|
|
127
126
|
<div
|
|
128
127
|
dir={direction}
|
|
129
|
-
className="flex items-center justify-center gap-0.5
|
|
128
|
+
className="flex items-center justify-center gap-0.5"
|
|
130
129
|
>
|
|
131
130
|
<div
|
|
132
131
|
onClick={() => setOpenSideMenu(true)}
|
|
@@ -189,9 +188,9 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
189
188
|
className={clsx(
|
|
190
189
|
"fixed top-0 z-40 flex h-full flex-col justify-between overflow-x-clip transition-all",
|
|
191
190
|
// drawerDefaultStyle,
|
|
192
|
-
"bg-green-400"
|
|
191
|
+
// "bg-green-400",
|
|
193
192
|
// drawerSizeStyle[drawerSize],
|
|
194
|
-
|
|
193
|
+
isRTL ? "right-0" : "left-0"
|
|
195
194
|
)}
|
|
196
195
|
style={{
|
|
197
196
|
width:
|
|
@@ -215,30 +214,21 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
215
214
|
<div
|
|
216
215
|
dir={direction}
|
|
217
216
|
className={clsx(
|
|
218
|
-
"fixed z-50 flex h-14 w-full flex-row items-center bg-
|
|
219
|
-
"
|
|
220
|
-
// openSideMenu ? "w-[56px]" : "w-[160px]"
|
|
221
|
-
// size > 600 || openSideMenu
|
|
222
|
-
// ? "bg-layoutPrimary-500"
|
|
223
|
-
// : "w-0 bg-transparent"
|
|
217
|
+
"fixed z-50 mb-2 flex h-14 w-full flex-row items-center justify-center bg-layoutPrimary-500 transition-all"
|
|
218
|
+
// "bg-blue-400",
|
|
224
219
|
)}
|
|
225
220
|
style={{
|
|
226
221
|
width:
|
|
227
222
|
size > 600
|
|
228
|
-
? `${
|
|
229
|
-
|
|
230
|
-
// drawerSize
|
|
231
|
-
// ] - 16
|
|
232
|
-
openSideMenu ? 160 : 56
|
|
233
|
-
}px`
|
|
234
|
-
: "full",
|
|
223
|
+
? `${openSideMenu ? 160 : 56}px`
|
|
224
|
+
: `${openSideMenu ? 160 : 0}px`,
|
|
235
225
|
}}
|
|
236
226
|
>
|
|
237
227
|
{/* Full Logo */}
|
|
238
228
|
<img
|
|
239
229
|
className={clsx(
|
|
240
|
-
"
|
|
241
|
-
isRTL ? "right-2.5" : "left-2.5",
|
|
230
|
+
"h-9 opacity-0 transition-all",
|
|
231
|
+
// isRTL ? "right-2.5" : "left-2.5",
|
|
242
232
|
!openSideMenu ? "invisible opacity-0" : "visible opacity-100"
|
|
243
233
|
// size > 600 ? "" : "right-4"
|
|
244
234
|
)}
|
|
@@ -265,30 +255,26 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
265
255
|
{/* Drawer Content Container */}
|
|
266
256
|
<div
|
|
267
257
|
className={clsx(
|
|
268
|
-
// "no-scrollbar",
|
|
269
|
-
"fixed bottom-14 top-14 bg-
|
|
270
|
-
//
|
|
258
|
+
// "no-scrollbar", TODO: make this optional to hide scrollbar or not
|
|
259
|
+
"fixed bottom-14 top-14 bg-layoutPrimary-500 py-2 transition-all",
|
|
260
|
+
// bg-yellow-400
|
|
271
261
|
openSideMenu ? "overflow-auto" : "overflow-hidden"
|
|
272
262
|
)}
|
|
273
263
|
style={{
|
|
274
264
|
height: "calc(100% - 112px)",
|
|
275
265
|
width:
|
|
276
266
|
size > 600
|
|
277
|
-
? `${
|
|
278
|
-
|
|
279
|
-
// drawerSize
|
|
280
|
-
// ] - 16
|
|
281
|
-
openSideMenu ? 160 : 56
|
|
282
|
-
}px`
|
|
283
|
-
: "full",
|
|
267
|
+
? `${openSideMenu ? 160 : 56}px`
|
|
268
|
+
: `${openSideMenu ? 160 : 0}px`,
|
|
284
269
|
}}
|
|
285
270
|
>
|
|
286
271
|
{/* Drawer Items */}
|
|
287
|
-
{/* <div className="mb-10 mt-14"> */}
|
|
288
272
|
{props.drawerItems?.map((dSection, dIndex) => (
|
|
289
273
|
<div
|
|
290
274
|
key={dIndex}
|
|
291
|
-
className={clsx(
|
|
275
|
+
className={clsx(
|
|
276
|
+
"flex select-none flex-col items-stretch justify-center transition-all"
|
|
277
|
+
)}
|
|
292
278
|
>
|
|
293
279
|
{dSection?.map((dItem, i) => {
|
|
294
280
|
return (
|
|
@@ -337,7 +323,7 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
337
323
|
: "rotate-90"
|
|
338
324
|
)}
|
|
339
325
|
>
|
|
340
|
-
<FaChevronRight fontSize={11} />
|
|
326
|
+
{/* <FaChevronRight fontSize={11} /> */}
|
|
341
327
|
</div>
|
|
342
328
|
)}
|
|
343
329
|
</div>
|
|
@@ -395,14 +381,12 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
395
381
|
</div>
|
|
396
382
|
{/* Drawer Footer */}
|
|
397
383
|
<div
|
|
398
|
-
className="fixed bottom-0 flex h-14 w-full items-center justify-center bg-
|
|
384
|
+
className="fixed bottom-0 flex h-14 w-full items-center justify-center bg-layoutPrimary-500 transition-all"
|
|
399
385
|
style={{
|
|
400
|
-
width:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
// 16
|
|
405
|
-
}px`,
|
|
386
|
+
width:
|
|
387
|
+
size > 600
|
|
388
|
+
? `${openSideMenu ? 160 : 56}px`
|
|
389
|
+
: `${openSideMenu ? 160 : 0}px`,
|
|
406
390
|
}}
|
|
407
391
|
>
|
|
408
392
|
{onSettingsClick && (
|
|
@@ -410,7 +394,7 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
410
394
|
className=" cursor-pointer rounded p-2 transition-all hover:bg-layoutPrimary-700"
|
|
411
395
|
onClick={() => onSettingsClick()}
|
|
412
396
|
>
|
|
413
|
-
<
|
|
397
|
+
<SettingsIcon />
|
|
414
398
|
</div>
|
|
415
399
|
)}
|
|
416
400
|
{/* Expand Button */}
|
|
@@ -449,7 +433,17 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
449
433
|
"w-fit cursor-pointer rounded bg-gray-300 p-2 transition-all hover:bg-gray-400"
|
|
450
434
|
}
|
|
451
435
|
>
|
|
452
|
-
<ArrowIcon
|
|
436
|
+
<ArrowIcon
|
|
437
|
+
pointing={
|
|
438
|
+
keepOpen
|
|
439
|
+
? isRTL
|
|
440
|
+
? "right"
|
|
441
|
+
: "left"
|
|
442
|
+
: isRTL
|
|
443
|
+
? "left"
|
|
444
|
+
: "right"
|
|
445
|
+
}
|
|
446
|
+
/>
|
|
453
447
|
</div>
|
|
454
448
|
</div>
|
|
455
449
|
</div>
|
|
@@ -460,7 +454,7 @@ export const HawaAppLayoutSimplified: React.FunctionComponent<
|
|
|
460
454
|
|
|
461
455
|
{/* Children Container */}
|
|
462
456
|
<div
|
|
463
|
-
className="fixed overflow-y-auto
|
|
457
|
+
className="fixed overflow-y-auto p-2"
|
|
464
458
|
style={
|
|
465
459
|
isRTL
|
|
466
460
|
? {
|
|
@@ -514,3 +508,20 @@ const ArrowIcon = ({ pointing }) => (
|
|
|
514
508
|
></path>
|
|
515
509
|
</svg>
|
|
516
510
|
)
|
|
511
|
+
|
|
512
|
+
const SettingsIcon = () => (
|
|
513
|
+
<svg
|
|
514
|
+
stroke="currentColor"
|
|
515
|
+
fill="none"
|
|
516
|
+
stroke-width="2"
|
|
517
|
+
viewBox="0 0 24 24"
|
|
518
|
+
stroke-linecap="round"
|
|
519
|
+
stroke-linejoin="round"
|
|
520
|
+
height="1em"
|
|
521
|
+
width="1em"
|
|
522
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
523
|
+
>
|
|
524
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
525
|
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
526
|
+
</svg>
|
|
527
|
+
)
|
package/src/styles.css
CHANGED
|
@@ -1054,18 +1054,12 @@ video {
|
|
|
1054
1054
|
.w-\[12px\] {
|
|
1055
1055
|
width: 12px;
|
|
1056
1056
|
}
|
|
1057
|
-
.w-\[160px\] {
|
|
1058
|
-
width: 160px;
|
|
1059
|
-
}
|
|
1060
1057
|
.w-\[32px\] {
|
|
1061
1058
|
width: 32px;
|
|
1062
1059
|
}
|
|
1063
1060
|
.w-\[400px\] {
|
|
1064
1061
|
width: 400px;
|
|
1065
1062
|
}
|
|
1066
|
-
.w-\[56px\] {
|
|
1067
|
-
width: 56px;
|
|
1068
|
-
}
|
|
1069
1063
|
.w-\[calc\(1\%\)\] {
|
|
1070
1064
|
width: calc(1%);
|
|
1071
1065
|
}
|
|
@@ -1690,10 +1684,6 @@ video {
|
|
|
1690
1684
|
--tw-bg-opacity: 1;
|
|
1691
1685
|
background-color: rgb(71 85 105 / var(--tw-bg-opacity));
|
|
1692
1686
|
}
|
|
1693
|
-
.bg-stone-600 {
|
|
1694
|
-
--tw-bg-opacity: 1;
|
|
1695
|
-
background-color: rgb(87 83 78 / var(--tw-bg-opacity));
|
|
1696
|
-
}
|
|
1697
1687
|
.bg-transparent {
|
|
1698
1688
|
background-color: transparent;
|
|
1699
1689
|
}
|
|
@@ -1713,10 +1703,6 @@ video {
|
|
|
1713
1703
|
--tw-bg-opacity: 1;
|
|
1714
1704
|
background-color: rgb(250 204 21 / var(--tw-bg-opacity));
|
|
1715
1705
|
}
|
|
1716
|
-
.bg-yellow-500 {
|
|
1717
|
-
--tw-bg-opacity: 1;
|
|
1718
|
-
background-color: rgb(234 179 8 / var(--tw-bg-opacity));
|
|
1719
|
-
}
|
|
1720
1706
|
.bg-opacity-75 {
|
|
1721
1707
|
--tw-bg-opacity: 0.75;
|
|
1722
1708
|
}
|
|
@@ -1726,6 +1712,12 @@ video {
|
|
|
1726
1712
|
.bg-none {
|
|
1727
1713
|
background-image: none;
|
|
1728
1714
|
}
|
|
1715
|
+
.fill-buttonPrimary-500 {
|
|
1716
|
+
fill: var(--button-primary-500);
|
|
1717
|
+
}
|
|
1718
|
+
.fill-gray-200 {
|
|
1719
|
+
fill: #e5e7eb;
|
|
1720
|
+
}
|
|
1729
1721
|
.object-cover {
|
|
1730
1722
|
-o-object-fit: cover;
|
|
1731
1723
|
object-fit: cover;
|