@sikka/hawa 0.0.213 → 0.0.214
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 +52 -53
- package/es/blocks/Misc/NotFound.d.ts +3 -3
- package/es/elements/HawaTable.d.ts +1 -0
- package/es/elements/HawaTabs.d.ts +1 -1
- package/es/index.es.js +1 -1
- package/lib/blocks/Misc/NotFound.d.ts +3 -3
- package/lib/elements/HawaTable.d.ts +1 -0
- package/lib/elements/HawaTabs.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/src/blocks/Misc/Newsletter.tsx +3 -3
- package/src/blocks/Misc/NotFound.tsx +7 -7
- package/src/blocks/Payment/CheckoutForm.tsx +1 -0
- package/src/elements/HawaLogoButton.tsx +1 -0
- package/src/elements/HawaTable.tsx +138 -134
- package/src/elements/HawaTabs.tsx +2 -2
- package/src/layout/HawaAppLayout.tsx +2 -1
- package/src/styles.css +52 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.214",
|
|
4
4
|
"description": "SaaS Oriented UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
27
27
|
"start": "start-storybook -p 6006 -s public",
|
|
28
28
|
"storybook": "start-storybook -p 6006 -s public",
|
|
29
|
-
"build-storybook": "build-storybook",
|
|
30
29
|
"generate-css": "postcss src/tailwind.css -o src/styles.css && mkdir -p dist && cp src/styles.css dist/",
|
|
31
30
|
"deploy-storybook": "storybook-to-ghpages",
|
|
31
|
+
"build-storybook": "build-storybook",
|
|
32
32
|
"build-lib": "rollup -c",
|
|
33
33
|
"build:styles": " node tools/build-styles"
|
|
34
34
|
},
|
|
@@ -21,10 +21,10 @@ export const Newsletter: React.FunctionComponent<TNewsletter> = ({
|
|
|
21
21
|
<HawaContainer variant={variant} centered={true}>
|
|
22
22
|
<div className="p-4 pt-0">
|
|
23
23
|
<h1 className="font-bold">
|
|
24
|
-
{texts
|
|
24
|
+
{texts?.wantToStayUpdated ?? "Want to stay updated?"}
|
|
25
25
|
</h1>
|
|
26
26
|
<span>
|
|
27
|
-
{texts
|
|
27
|
+
{texts?.subscribeToNewsletter ?? "Subscribe to our newsletter"}
|
|
28
28
|
</span>
|
|
29
29
|
</div>
|
|
30
30
|
<form
|
|
@@ -42,7 +42,7 @@ export const Newsletter: React.FunctionComponent<TNewsletter> = ({
|
|
|
42
42
|
margin="none"
|
|
43
43
|
/>
|
|
44
44
|
<HawaButton size="full" margins="none">
|
|
45
|
-
{texts
|
|
45
|
+
{texts?.submit ?? "Submit"}
|
|
46
46
|
</HawaButton>
|
|
47
47
|
</form>
|
|
48
48
|
</HawaContainer>
|
|
@@ -5,14 +5,14 @@ import { HawaContainer } from "../../layout"
|
|
|
5
5
|
type NotFoundTypes = {
|
|
6
6
|
variant?: "outlined" | "contained" | "neobrutalism"
|
|
7
7
|
texts?: {
|
|
8
|
-
pageNotFound
|
|
9
|
-
ifLost
|
|
10
|
-
home
|
|
8
|
+
pageNotFound?: string
|
|
9
|
+
ifLost?: string
|
|
10
|
+
home?: string
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const NotFound: React.FunctionComponent<NotFoundTypes> = ({
|
|
15
|
-
variant,
|
|
15
|
+
variant = "contained",
|
|
16
16
|
texts,
|
|
17
17
|
}) => {
|
|
18
18
|
return (
|
|
@@ -20,13 +20,13 @@ export const NotFound: React.FunctionComponent<NotFoundTypes> = ({
|
|
|
20
20
|
<div className="flex flex-col items-center dark:text-white">
|
|
21
21
|
<div className="text-center text-6xl font-bold ">404</div>
|
|
22
22
|
<div className="m-2 text-center text-xl font-bold ">
|
|
23
|
-
{texts
|
|
23
|
+
{texts?.pageNotFound ?? "Page Not Found"}
|
|
24
24
|
</div>
|
|
25
25
|
<div className="text-center ">
|
|
26
|
-
{texts
|
|
26
|
+
{texts?.ifLost ?? "If you're lost please contact us help@sikka.io"}
|
|
27
27
|
</div>
|
|
28
28
|
<HawaButton color="primary" width="full">
|
|
29
|
-
{texts
|
|
29
|
+
{texts?.home ?? "Home"}
|
|
30
30
|
</HawaButton>
|
|
31
31
|
</div>
|
|
32
32
|
</HawaContainer>
|
|
@@ -67,6 +67,7 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
67
67
|
</div>
|
|
68
68
|
<div className="rounded border border-gray-300">
|
|
69
69
|
<HawaTable
|
|
70
|
+
pagination={false}
|
|
70
71
|
direction={isArabic ? "rtl" : "ltr"}
|
|
71
72
|
columns={[
|
|
72
73
|
{ hidden: false, value: "Product" },
|
|
@@ -11,6 +11,7 @@ import { BsChevronRight, BsFilter, BsPlus, BsThreeDots } from "react-icons/bs"
|
|
|
11
11
|
// TODO: pass the onSearch handler to the parent
|
|
12
12
|
|
|
13
13
|
type TableTypes = {
|
|
14
|
+
pagination?: boolean
|
|
14
15
|
columns: any[string]
|
|
15
16
|
actions?: ActionItems[][]
|
|
16
17
|
direction?: "rtl" | "ltr"
|
|
@@ -47,6 +48,7 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
47
48
|
highlightFirst = false,
|
|
48
49
|
direction = "ltr",
|
|
49
50
|
bordersWidth = "1",
|
|
51
|
+
pagination = true,
|
|
50
52
|
...props
|
|
51
53
|
}) => {
|
|
52
54
|
const [perPage, setPerPage] = useState(10)
|
|
@@ -256,71 +258,92 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
256
258
|
</table>
|
|
257
259
|
</div>
|
|
258
260
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
range.
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
261
|
+
{pagination && (
|
|
262
|
+
<div className="flex flex-row items-center justify-between ">
|
|
263
|
+
{/* Pagination Pages */}
|
|
264
|
+
{range.length > 1 ? (
|
|
265
|
+
<div className="flex w-fit flex-row items-stretch justify-center gap-2 overflow-clip rounded ">
|
|
266
|
+
{/* Previous Page Button */}
|
|
267
|
+
<div
|
|
268
|
+
className={clsx(
|
|
269
|
+
"flex h-6 w-6 rotate-180 items-center justify-center rounded bg-gray-100 p-1 text-xs hover:bg-layoutPrimary-700 "
|
|
270
|
+
)}
|
|
271
|
+
onClick={() =>
|
|
272
|
+
page <= 1 ? setPage(range.length) : setPage(page - 1)
|
|
273
|
+
}
|
|
274
|
+
>
|
|
275
|
+
<BsChevronRight />
|
|
276
|
+
</div>
|
|
277
|
+
{/* Numbered Pagination */}
|
|
278
|
+
<div className="flex flex-row items-center overflow-clip rounded transition-all">
|
|
279
|
+
{/* The first page */}
|
|
280
|
+
{range.length > 6 &&
|
|
281
|
+
range.map((el, index) => {
|
|
282
|
+
if (index <= 0) {
|
|
283
|
+
return (
|
|
284
|
+
<button
|
|
285
|
+
key={index}
|
|
286
|
+
className={clsx(
|
|
287
|
+
"w-10 p-1 text-xs hover:bg-gray-200",
|
|
288
|
+
page === el
|
|
289
|
+
? "bg-buttonPrimary-500 text-white hover:bg-buttonPrimary-500"
|
|
290
|
+
: "bg-gray-100"
|
|
291
|
+
)}
|
|
292
|
+
onClick={() => setPage(el)}
|
|
293
|
+
>
|
|
294
|
+
{el}
|
|
295
|
+
</button>
|
|
296
|
+
)
|
|
297
|
+
}
|
|
298
|
+
})}
|
|
299
|
+
{/* The Current Page / Input */}
|
|
300
|
+
{range?.length > 6 && (
|
|
301
|
+
<input
|
|
302
|
+
type={"text"}
|
|
303
|
+
className=" w-10 bg-gray-100 p-1 text-center text-xs"
|
|
304
|
+
defaultValue={
|
|
305
|
+
page !== 0 || page !== range.length - 1 ? page : "..."
|
|
306
|
+
}
|
|
307
|
+
value={
|
|
308
|
+
page == 1 || page == range.length
|
|
309
|
+
? "..."
|
|
310
|
+
: enteredPage
|
|
311
|
+
? enteredPage
|
|
312
|
+
: page
|
|
313
|
+
}
|
|
314
|
+
onChange={(e) => setEnteredPage(parseInt(e.target.value))}
|
|
315
|
+
onKeyDown={(e) => {
|
|
316
|
+
if (e.key === "Enter") {
|
|
317
|
+
setPage(enteredPage)
|
|
318
|
+
setEnteredPage(null)
|
|
319
|
+
}
|
|
320
|
+
}}
|
|
321
|
+
/>
|
|
322
|
+
)}
|
|
323
|
+
{/* The last page */}
|
|
324
|
+
{range?.length > 6 &&
|
|
325
|
+
range.map((el, index) => {
|
|
326
|
+
if (index >= range.length - 1) {
|
|
327
|
+
return (
|
|
328
|
+
<button
|
|
329
|
+
key={index}
|
|
330
|
+
className={clsx(
|
|
331
|
+
"w-10 p-1 text-xs hover:bg-gray-200",
|
|
332
|
+
page === el
|
|
333
|
+
? "bg-buttonPrimary-500 text-white hover:bg-buttonPrimary-500"
|
|
334
|
+
: "bg-gray-100"
|
|
335
|
+
)}
|
|
336
|
+
onClick={() => setPage(el)}
|
|
337
|
+
>
|
|
338
|
+
{el}
|
|
339
|
+
</button>
|
|
340
|
+
)
|
|
316
341
|
}
|
|
317
|
-
}}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
range.map((el, index) => {
|
|
323
|
-
if (index >= range.length - 1) {
|
|
342
|
+
})}
|
|
343
|
+
|
|
344
|
+
{/* All Pages if less than 6 pages */}
|
|
345
|
+
{range?.length <= 6 &&
|
|
346
|
+
range.map((el, index) => {
|
|
324
347
|
return (
|
|
325
348
|
<button
|
|
326
349
|
key={index}
|
|
@@ -335,78 +358,59 @@ export const HawaTable: React.FunctionComponent<TableTypes> = ({
|
|
|
335
358
|
{el}
|
|
336
359
|
</button>
|
|
337
360
|
)
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
: "bg-gray-100"
|
|
352
|
-
)}
|
|
353
|
-
onClick={() => setPage(el)}
|
|
354
|
-
>
|
|
355
|
-
{el}
|
|
356
|
-
</button>
|
|
357
|
-
)
|
|
358
|
-
})}
|
|
359
|
-
</div>
|
|
360
|
-
{/* Next Page Button */}
|
|
361
|
-
<div
|
|
362
|
-
onClick={() =>
|
|
363
|
-
page >= range.length ? setPage(1) : setPage(page + 1)
|
|
364
|
-
}
|
|
365
|
-
className={clsx(
|
|
366
|
-
"flex h-6 w-6 items-center justify-center rounded bg-gray-100 p-1 text-xs hover:bg-layoutPrimary-700 "
|
|
367
|
-
)}
|
|
368
|
-
>
|
|
369
|
-
<BsChevronRight />
|
|
370
|
-
</div>
|
|
371
|
-
</div>
|
|
372
|
-
) : (
|
|
373
|
-
<div></div>
|
|
374
|
-
)}
|
|
375
|
-
{/* Pagination Settings */}
|
|
376
|
-
{props.rows ? (
|
|
377
|
-
<div className="flex w-fit flex-row items-center gap-2 ">
|
|
378
|
-
<div className="text-xs ">
|
|
379
|
-
{props.rows.length} {props.texts?.items ?? "Items"}
|
|
361
|
+
})}
|
|
362
|
+
</div>
|
|
363
|
+
{/* Next Page Button */}
|
|
364
|
+
<div
|
|
365
|
+
onClick={() =>
|
|
366
|
+
page >= range.length ? setPage(1) : setPage(page + 1)
|
|
367
|
+
}
|
|
368
|
+
className={clsx(
|
|
369
|
+
"flex h-6 w-6 items-center justify-center rounded bg-gray-100 p-1 text-xs hover:bg-layoutPrimary-700 "
|
|
370
|
+
)}
|
|
371
|
+
>
|
|
372
|
+
<BsChevronRight />
|
|
373
|
+
</div>
|
|
380
374
|
</div>
|
|
375
|
+
) : (
|
|
376
|
+
<div></div>
|
|
377
|
+
)}
|
|
378
|
+
{/* Pagination Settings */}
|
|
379
|
+
{props.rows ? (
|
|
380
|
+
<div className="flex w-fit flex-row items-center gap-2 ">
|
|
381
|
+
<div className="text-xs ">
|
|
382
|
+
{props.rows.length} {props.texts?.items ?? "Items"}
|
|
383
|
+
</div>
|
|
381
384
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
385
|
+
<select
|
|
386
|
+
value={perPage}
|
|
387
|
+
className="h-6 rounded text-xs"
|
|
388
|
+
onChange={(e) => {
|
|
389
|
+
setPerPage(parseInt(e.target.value))
|
|
390
|
+
}}
|
|
391
|
+
>
|
|
392
|
+
<option value={10} style={{ fontSize: 10 }}>
|
|
393
|
+
10 / {props.texts?.page ?? "Page"}
|
|
394
|
+
</option>
|
|
395
|
+
<option value={20} style={{ fontSize: 10 }}>
|
|
396
|
+
20 / {props.texts?.page ?? "Page"}
|
|
397
|
+
</option>
|
|
398
|
+
<option value={30} style={{ fontSize: 10 }}>
|
|
399
|
+
30 / {props.texts?.page ?? "Page"}
|
|
400
|
+
</option>
|
|
401
|
+
<option value={50} style={{ fontSize: 10 }}>
|
|
402
|
+
50 / {props.texts?.page ?? "Page"}
|
|
403
|
+
</option>
|
|
404
|
+
<option value={100} style={{ fontSize: 10 }}>
|
|
405
|
+
100 / {props.texts?.page ?? "Page"}
|
|
406
|
+
</option>
|
|
407
|
+
</select>
|
|
408
|
+
</div>
|
|
409
|
+
) : (
|
|
410
|
+
<div></div>
|
|
411
|
+
)}
|
|
412
|
+
</div>
|
|
413
|
+
)}
|
|
410
414
|
</div>
|
|
411
415
|
)
|
|
412
416
|
}
|
|
@@ -5,7 +5,7 @@ import React, { useState } from "react"
|
|
|
5
5
|
|
|
6
6
|
type TabsTypes = {
|
|
7
7
|
options?: any
|
|
8
|
-
onChangeTab?:
|
|
8
|
+
onChangeTab?: (option) => void
|
|
9
9
|
defaultValue?: any
|
|
10
10
|
orientation?: "horizontal" | "vertical"
|
|
11
11
|
direction?: "rtl" | "ltr"
|
|
@@ -101,7 +101,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
|
101
101
|
aria-current="page"
|
|
102
102
|
onClick={() => {
|
|
103
103
|
setSelectedOption(opt.value)
|
|
104
|
-
props
|
|
104
|
+
props?.onChangeTab(opt)
|
|
105
105
|
}}
|
|
106
106
|
className={clsx(
|
|
107
107
|
opt.value === selectedOption
|
|
@@ -406,8 +406,9 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = ({
|
|
|
406
406
|
: 0,
|
|
407
407
|
}}
|
|
408
408
|
>
|
|
409
|
-
{dItem.subItems?.map((subIt) => (
|
|
409
|
+
{dItem.subItems?.map((subIt, s) => (
|
|
410
410
|
<div
|
|
411
|
+
key={s}
|
|
411
412
|
className={clsx(
|
|
412
413
|
"flex flex-row gap-2 overflow-x-clip rounded p-2 px-2 text-xs",
|
|
413
414
|
isRTL ? "text-right" : "text-left",
|