@sikka/hawa 0.0.270 → 0.0.273
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 +199 -17
- package/es/blocks/Pricing/HorizontalPricing.d.ts +47 -0
- package/es/blocks/Pricing/index.d.ts +1 -0
- package/es/elements/HawaLandingCard.d.ts +1 -0
- package/es/elements/HawaLoading.d.ts +8 -0
- package/es/elements/HawaRadio.d.ts +7 -10
- package/es/elements/HawaSnackbar.d.ts +1 -0
- package/es/elements/HawaStats.d.ts +2 -1
- package/es/elements/index.d.ts +1 -1
- package/es/index.es.js +3 -3
- package/es/layout/HawaGrid.d.ts +6 -0
- package/es/layout/index.d.ts +1 -0
- package/lib/blocks/Pricing/HorizontalPricing.d.ts +47 -0
- package/lib/blocks/Pricing/index.d.ts +1 -0
- package/lib/elements/HawaLandingCard.d.ts +1 -0
- package/lib/elements/HawaLoading.d.ts +8 -0
- package/lib/elements/HawaRadio.d.ts +7 -10
- package/lib/elements/HawaSnackbar.d.ts +1 -0
- package/lib/elements/HawaStats.d.ts +2 -1
- package/lib/elements/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/layout/HawaGrid.d.ts +6 -0
- package/lib/layout/index.d.ts +1 -0
- package/package.json +2 -1
- package/src/blocks/Misc/EmptyState.tsx +0 -1
- package/src/blocks/Misc/NoPermission.tsx +0 -1
- package/src/blocks/Pricing/ComparingPlans.tsx +0 -3
- package/src/blocks/Pricing/HorizontalPricing.tsx +140 -0
- package/src/blocks/Pricing/index.ts +1 -0
- package/src/blocks/Referral/ReferralAccount.tsx +0 -2
- package/src/blocks/Referral/ReferralSettlement.tsx +0 -1
- package/src/elements/ArrowCarousel.tsx +0 -1
- package/src/elements/BackToTop.tsx +0 -1
- package/src/elements/DragDropImages.tsx +0 -2
- package/src/elements/DraggableCard.tsx +0 -1
- package/src/elements/HawaAccordion.tsx +0 -1
- package/src/elements/HawaAlert.tsx +0 -1
- package/src/elements/HawaButton.tsx +9 -5
- package/src/elements/HawaCodeBlock.tsx +4 -14
- package/src/elements/HawaDropdownMenu.tsx +112 -58
- package/src/elements/HawaItemCard.tsx +0 -1
- package/src/elements/HawaLandingCard.tsx +12 -10
- package/src/elements/HawaLoading.tsx +83 -0
- package/src/elements/HawaLogoButton.tsx +0 -3
- package/src/elements/HawaModal.tsx +0 -1
- package/src/elements/HawaPhoneInput.tsx +5 -1
- package/src/elements/HawaPricingCard.tsx +0 -1
- package/src/elements/HawaRadio.tsx +9 -12
- package/src/elements/HawaSnackbar.tsx +6 -3
- package/src/elements/HawaStats.tsx +18 -8
- package/src/elements/HawaStepper.tsx +0 -1
- package/src/elements/HawaTable.tsx +0 -6
- package/src/elements/InvoiceAccordion.tsx +0 -2
- package/src/elements/UsageCard.tsx +0 -1
- package/src/elements/UserFeedback.tsx +0 -1
- package/src/elements/index.ts +1 -1
- package/src/layout/Banner.tsx +0 -1
- package/src/layout/HawaAppLayout.tsx +0 -3
- package/src/layout/HawaAppLayoutSimplified.tsx +0 -4
- package/src/layout/HawaGrid.tsx +15 -0
- package/src/layout/HawaSiteLayout.tsx +0 -1
- package/src/layout/index.ts +1 -0
- package/src/styles.css +199 -17
- package/src/tailwind.css +7 -0
- package/tailwind.config.js +29 -8
- package/es/elements/HawaSpinner.d.ts +0 -6
- package/lib/elements/HawaSpinner.d.ts +0 -6
- package/src/elements/HawaSpinner.tsx +0 -42
package/lib/layout/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.273",
|
|
4
4
|
"description": "SaaS Oriented UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"rollup-plugin-swc": "^0.2.1",
|
|
79
79
|
"rollup-plugin-typescript2": "^0.34.1",
|
|
80
80
|
"tailwindcss": "^3.3.3",
|
|
81
|
+
"tailwindcss-animate": "^1.0.6",
|
|
81
82
|
"tinycolor2": "^1.4.2",
|
|
82
83
|
"tslib": "^2.4.1",
|
|
83
84
|
"typescript": "^4.8.4",
|
|
@@ -27,7 +27,6 @@ export const EmptyState: FC<TEmptyState> = ({
|
|
|
27
27
|
viewBox="0 0 512 512"
|
|
28
28
|
height="0.35em"
|
|
29
29
|
width="0.35em"
|
|
30
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
31
30
|
>
|
|
32
31
|
<path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path>
|
|
33
32
|
</svg>{" "}
|
|
@@ -24,7 +24,6 @@ export const NoPermission: FC<TNoPermission> = ({
|
|
|
24
24
|
viewBox="0 0 448 512"
|
|
25
25
|
height="0.35em"
|
|
26
26
|
width="0.35em"
|
|
27
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
28
27
|
>
|
|
29
28
|
<path d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"></path>
|
|
30
29
|
</svg> </div>
|
|
@@ -7,7 +7,6 @@ const CheckMark = () => (
|
|
|
7
7
|
aria-hidden="true"
|
|
8
8
|
fill="currentColor"
|
|
9
9
|
viewBox="0 0 20 20"
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
10
|
>
|
|
12
11
|
<path
|
|
13
12
|
fillRule="evenodd"
|
|
@@ -23,7 +22,6 @@ const UncheckMark = () => (
|
|
|
23
22
|
aria-hidden="true"
|
|
24
23
|
fill="currentColor"
|
|
25
24
|
viewBox="0 0 20 20"
|
|
26
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
27
25
|
>
|
|
28
26
|
<path
|
|
29
27
|
fillRule="evenodd"
|
|
@@ -137,7 +135,6 @@ export const ComparingPlans: FC<ComparingPlansTypes> = (props) => {
|
|
|
137
135
|
viewBox="0 0 16 16"
|
|
138
136
|
height="1em"
|
|
139
137
|
width="1em"
|
|
140
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
141
138
|
>
|
|
142
139
|
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path>
|
|
143
140
|
</svg>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React, { FC, useState } from "react"
|
|
2
|
+
import { HawaRadio } from "../../elements"
|
|
3
|
+
import clsx from "clsx"
|
|
4
|
+
|
|
5
|
+
type HorizontalPricingTypes = {
|
|
6
|
+
plans: [
|
|
7
|
+
{
|
|
8
|
+
direction: "rtl" | "ltr"
|
|
9
|
+
features: [{ included: boolean; text: string }]
|
|
10
|
+
price: number
|
|
11
|
+
texts: {
|
|
12
|
+
title: string
|
|
13
|
+
subtitle: string
|
|
14
|
+
buttonText: string
|
|
15
|
+
cycleText: string
|
|
16
|
+
currencyText: string
|
|
17
|
+
}
|
|
18
|
+
size: "small" | "medium" | "large"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
currencies: [
|
|
22
|
+
{
|
|
23
|
+
label: string
|
|
24
|
+
value: string
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
billingCycles: [
|
|
28
|
+
{
|
|
29
|
+
label: string
|
|
30
|
+
value: string
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
onPlanClicked?: (e) => void
|
|
34
|
+
currentCycle: {
|
|
35
|
+
label: string
|
|
36
|
+
value: string
|
|
37
|
+
}
|
|
38
|
+
currentCurrency: {
|
|
39
|
+
label: string
|
|
40
|
+
value: string
|
|
41
|
+
}
|
|
42
|
+
onCycleChange?: (e) => void
|
|
43
|
+
onCurrencyChange?: (e) => void
|
|
44
|
+
direction?: "rtl" | "ltr"
|
|
45
|
+
}
|
|
46
|
+
export const HorizontalPricing: FC<HorizontalPricingTypes> = (props) => {
|
|
47
|
+
const [selectedCard, setSelectedCard] = useState(null)
|
|
48
|
+
let data = [
|
|
49
|
+
{ title: "basic", price: "$49", cycle: "/mo" },
|
|
50
|
+
{ title: "business", price: "$99", cycle: "/mo" },
|
|
51
|
+
{ title: "enterprise", price: "$149", cycle: "/mo" },
|
|
52
|
+
]
|
|
53
|
+
return (
|
|
54
|
+
<div className="z-10 w-full max-w-screen-sm">
|
|
55
|
+
<div className="max-w-2xl ">
|
|
56
|
+
<div className="flex flex-row justify-between">
|
|
57
|
+
<HawaRadio
|
|
58
|
+
design="tabs"
|
|
59
|
+
options={props.currencies}
|
|
60
|
+
defaultValue={props.currentCurrency}
|
|
61
|
+
/>
|
|
62
|
+
<HawaRadio
|
|
63
|
+
design="tabs"
|
|
64
|
+
options={props.billingCycles}
|
|
65
|
+
defaultValue={props.currentCycle}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
{data.map((d) => (
|
|
69
|
+
<label htmlFor={d.title} onClick={() => setSelectedCard(d.title)}>
|
|
70
|
+
<input
|
|
71
|
+
type="radio"
|
|
72
|
+
name="radio"
|
|
73
|
+
id={d.title}
|
|
74
|
+
className="peer appearance-none"
|
|
75
|
+
/>
|
|
76
|
+
<div
|
|
77
|
+
className={clsx(
|
|
78
|
+
selectedCard === d.title ? "peer-checked:border-blue-500" : "",
|
|
79
|
+
"peer flex cursor-pointer items-center justify-between rounded-xl border-2 border-transparent bg-white px-5 py-4 shadow peer-checked:[&_.active]:block peer-checked:[&_.default]:hidden"
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
<div className="peer flex items-center gap-4">
|
|
83
|
+
<CheckIcons />
|
|
84
|
+
<CardText
|
|
85
|
+
title="Enterprise"
|
|
86
|
+
subtitle="For startups and new businesses"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<CardPrice amount={d.price} cycle={d.cycle} />
|
|
91
|
+
</div>
|
|
92
|
+
</label>
|
|
93
|
+
))}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const CheckIcons = () => (
|
|
100
|
+
<>
|
|
101
|
+
<svg
|
|
102
|
+
fill="none"
|
|
103
|
+
viewBox="0 0 24 24"
|
|
104
|
+
stroke-width="1.5"
|
|
105
|
+
stroke="currentColor"
|
|
106
|
+
className="default h-8 w-8 text-neutral-500"
|
|
107
|
+
>
|
|
108
|
+
<path
|
|
109
|
+
stroke-linecap="round"
|
|
110
|
+
stroke-linejoin="round"
|
|
111
|
+
d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
112
|
+
/>
|
|
113
|
+
</svg>
|
|
114
|
+
<svg
|
|
115
|
+
viewBox="0 0 24 24"
|
|
116
|
+
fill="currentColor"
|
|
117
|
+
className="active hidden h-8 w-8 text-blue-500"
|
|
118
|
+
>
|
|
119
|
+
<path
|
|
120
|
+
fill-rule="evenodd"
|
|
121
|
+
clip-rule="evenodd"
|
|
122
|
+
d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z"
|
|
123
|
+
/>
|
|
124
|
+
</svg>
|
|
125
|
+
</>
|
|
126
|
+
)
|
|
127
|
+
const CardText = (props) => (
|
|
128
|
+
<div className="peer flex flex-col items-start">
|
|
129
|
+
<h2 className="font-medium text-neutral-700 sm:text-xl">{props.title}</h2>
|
|
130
|
+
<p className="text-sm text-neutral-500">{props.subtitle} </p>
|
|
131
|
+
</div>
|
|
132
|
+
)
|
|
133
|
+
const CardPrice = (props) => (
|
|
134
|
+
<h2 className="peer text-xl font-semibold text-neutral-900 sm:text-2xl">
|
|
135
|
+
{props.amount}
|
|
136
|
+
<span className="text-base font-medium text-neutral-400">
|
|
137
|
+
{props.cycle}
|
|
138
|
+
</span>
|
|
139
|
+
</h2>
|
|
140
|
+
)
|
|
@@ -30,7 +30,6 @@ export const ReferralAccount: FC<ReferralAccount> = ({
|
|
|
30
30
|
viewBox="0 0 512 512"
|
|
31
31
|
height="1em"
|
|
32
32
|
width="1em"
|
|
33
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
34
33
|
>
|
|
35
34
|
<path d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"></path>
|
|
36
35
|
</svg>{" "}
|
|
@@ -54,7 +53,6 @@ export const ReferralAccount: FC<ReferralAccount> = ({
|
|
|
54
53
|
viewBox="0 0 512 512"
|
|
55
54
|
height="1em"
|
|
56
55
|
width="1em"
|
|
57
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
58
56
|
>
|
|
59
57
|
<path d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"></path>
|
|
60
58
|
</svg>{" "}
|
|
@@ -159,7 +159,6 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
159
159
|
className="h-5 w-5"
|
|
160
160
|
fill="currentColor"
|
|
161
161
|
viewBox="0 0 20 20"
|
|
162
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
163
162
|
>
|
|
164
163
|
<path
|
|
165
164
|
fillRule="evenodd"
|
|
@@ -214,7 +213,6 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
214
213
|
stroke-linejoin="round"
|
|
215
214
|
height="1.5em"
|
|
216
215
|
width="1.5em"
|
|
217
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
218
216
|
>
|
|
219
217
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
220
218
|
<path d="M19 11v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path>
|
|
@@ -16,7 +16,6 @@ export const DraggableCard: FC<DraggableCardTypes> = (props) => {
|
|
|
16
16
|
aria-hidden="true"
|
|
17
17
|
fill="currentColor"
|
|
18
18
|
viewBox="0 0 20 20"
|
|
19
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
20
19
|
>
|
|
21
20
|
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path>
|
|
22
21
|
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, ButtonHTMLAttributes, useState } from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
|
-
import {
|
|
3
|
+
import { HawaLoading } from "./HawaLoading"
|
|
4
4
|
import { HawaTooltip } from "./HawaTooltip"
|
|
5
5
|
|
|
6
6
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -165,7 +165,7 @@ export const HawaButton: FC<ButtonProps> = ({
|
|
|
165
165
|
onClick={props.onClick}
|
|
166
166
|
// onClick={handleClick}
|
|
167
167
|
>
|
|
168
|
-
{!isLoading ? children : <
|
|
168
|
+
{!isLoading ? children : <HawaLoading size="button" />}
|
|
169
169
|
</button>
|
|
170
170
|
</HawaTooltip>
|
|
171
171
|
) : (
|
|
@@ -210,14 +210,18 @@ export const HawaButton: FC<ButtonProps> = ({
|
|
|
210
210
|
{isClicked && feedback ? (
|
|
211
211
|
<div className="w-full text-center">{buttonText}</div>
|
|
212
212
|
) : null}
|
|
213
|
-
<div className="flex w-full flex-row items-center justify-center gap-2 whitespace-nowrap">
|
|
213
|
+
<div className="flex w-full select-none flex-row items-center justify-center gap-2 whitespace-nowrap">
|
|
214
214
|
{props.startIcon && props.startIcon}
|
|
215
215
|
{children}
|
|
216
216
|
{props.endIcon && props.endIcon}
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
) : (
|
|
220
|
-
<
|
|
220
|
+
<HawaLoading
|
|
221
|
+
design="dots-pulse"
|
|
222
|
+
color={"bg-white"}
|
|
223
|
+
size="button"
|
|
224
|
+
/>
|
|
221
225
|
)}
|
|
222
226
|
</button>
|
|
223
227
|
)}
|
|
@@ -229,7 +233,7 @@ export const HawaButton: FC<ButtonProps> = ({
|
|
|
229
233
|
: typeof badge === "string"
|
|
230
234
|
? "h-5 w-7"
|
|
231
235
|
: "h-6 w-6",
|
|
232
|
-
"absolute -right-2
|
|
236
|
+
"absolute -right-2 -top-2 inline-flex select-none items-center justify-center rounded-full border-2 border-white bg-red-500 text-[9px] font-bold text-white dark:border-gray-900"
|
|
233
237
|
)}
|
|
234
238
|
>
|
|
235
239
|
{typeof badge === "number" && badge > 100 ? "+99" : badge}
|
|
@@ -75,19 +75,11 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
75
75
|
{fileName && (
|
|
76
76
|
<div className="flex flex-row gap-2 rounded-t bg-gray-700 p-2 pb-0">
|
|
77
77
|
<div
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// : "bg-transparent"
|
|
82
|
-
// )}
|
|
78
|
+
className={clsx(
|
|
79
|
+
"mb-1 w-full max-w-[52px] rounded-inner p-2 py-1 text-center text-[0.75rem]"
|
|
80
|
+
)}
|
|
83
81
|
>
|
|
84
|
-
|
|
85
|
-
className={clsx(
|
|
86
|
-
"mb-1 w-full max-w-[52px] rounded-inner p-2 py-1 text-center text-[0.75rem] "
|
|
87
|
-
)}
|
|
88
|
-
>
|
|
89
|
-
{fileName}
|
|
90
|
-
</div>
|
|
82
|
+
{fileName}
|
|
91
83
|
</div>
|
|
92
84
|
</div>
|
|
93
85
|
)}
|
|
@@ -130,7 +122,6 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
130
122
|
stroke-linejoin="round"
|
|
131
123
|
height="1em"
|
|
132
124
|
width="1em"
|
|
133
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
134
125
|
>
|
|
135
126
|
<rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
|
|
136
127
|
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
|
|
@@ -154,7 +145,6 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
154
145
|
stroke-linejoin="round"
|
|
155
146
|
height="1em"
|
|
156
147
|
width="1em"
|
|
157
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
158
148
|
>
|
|
159
149
|
<rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
|
|
160
150
|
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
|
|
@@ -17,40 +17,85 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
17
17
|
const [urlsChecked, setUrlsChecked] = React.useState(false)
|
|
18
18
|
const [person, setPerson] = React.useState("pedro")
|
|
19
19
|
|
|
20
|
+
let dropdownData = {
|
|
21
|
+
items: [
|
|
22
|
+
{
|
|
23
|
+
label: "New Tab",
|
|
24
|
+
shortcut: "ctrl + T",
|
|
25
|
+
disabled: false,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "New Windows",
|
|
29
|
+
shortcut: "ctrl + N",
|
|
30
|
+
disabled: false,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "New Private Window",
|
|
34
|
+
shortcut: "⇧+ctrl+N",
|
|
35
|
+
disabled: true,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
checkboxes: [
|
|
39
|
+
{
|
|
40
|
+
label: "Show Bookmarks",
|
|
41
|
+
shortcut: "ctrl + B",
|
|
42
|
+
disabled: false,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "Show Something",
|
|
46
|
+
shortcut: "ctrl + C",
|
|
47
|
+
disabled: false,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "Show that",
|
|
51
|
+
shortcut: "ctrl + T",
|
|
52
|
+
disabled: false,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}
|
|
20
56
|
return (
|
|
21
57
|
<DropdownMenu.Root dir={direction}>
|
|
22
58
|
<DropdownMenu.Trigger asChild>{children}</DropdownMenu.Trigger>
|
|
23
59
|
|
|
24
60
|
<DropdownMenu.Portal>
|
|
25
61
|
<DropdownMenu.Content
|
|
26
|
-
className="min-w-[220px] rounded
|
|
62
|
+
className="min-w-[220px] rounded bg-white p-[5px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] will-change-[opacity,transform] data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade"
|
|
27
63
|
sideOffset={5}
|
|
28
64
|
>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</div>
|
|
49
|
-
</DropdownMenu.Item>
|
|
65
|
+
{dropdownData.items.map((it, i) => (
|
|
66
|
+
<DropdownMenu.Item
|
|
67
|
+
key={i}
|
|
68
|
+
className="group relative flex h-[25px] select-none items-center justify-between
|
|
69
|
+
rounded-inner px-[5px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8
|
|
70
|
+
data-[highlighted]:text-violet-1 "
|
|
71
|
+
// ltr:pr-[25px] rtl:pl-[25px]
|
|
72
|
+
disabled={it.disabled}
|
|
73
|
+
>
|
|
74
|
+
{/* New Tab{" "} */}
|
|
75
|
+
{it.label}
|
|
76
|
+
<div className=" text-mauve-11 group-data-[disabled]:text-mauve-8 group-data-[highlighted]:text-white">
|
|
77
|
+
{/* ml-auto pl-[20px] */}
|
|
78
|
+
{/* ⌘+T */}
|
|
79
|
+
{it.shortcut}
|
|
80
|
+
</div>
|
|
81
|
+
</DropdownMenu.Item>
|
|
82
|
+
))}
|
|
83
|
+
|
|
50
84
|
<DropdownMenu.Sub>
|
|
51
|
-
<DropdownMenu.SubTrigger
|
|
85
|
+
<DropdownMenu.SubTrigger
|
|
86
|
+
className=" group relative flex h-[25px] select-none
|
|
87
|
+
items-center rounded-inner justify-between flex-row
|
|
88
|
+
px-[5px] text-[13px] leading-none text-violet-11
|
|
89
|
+
outline-none data-[disabled]:pointer-events-none
|
|
90
|
+
data-[highlighted]:bg-violet-9 data-[highlighted]:data-[state=open]:bg-violet-9
|
|
91
|
+
data-[state=open]:bg-violet-4 data-[disabled]:text-mauve-8 data-[highlighted]:data-[state=open]:text-violet-1
|
|
92
|
+
data-[highlighted]:text-violet-1 data-[state=open]:text-violet-11 ltr:pl-[25px] rtl:pl-[0px] "
|
|
93
|
+
>
|
|
52
94
|
More Tools
|
|
53
|
-
<div
|
|
95
|
+
<div
|
|
96
|
+
className="ltr:ml-auto rtl:pr-[5px] ltr:pl-[0px] text-mauve-11 group-data-[disabled]:text-mauve-8 group-data-[highlighted]:text-white
|
|
97
|
+
rtl:mr-auto rtl:rotate-180 rtl:pl-[0px]"
|
|
98
|
+
>
|
|
54
99
|
{/* <ChevronRightIcon /> */}
|
|
55
100
|
<svg
|
|
56
101
|
aria-label="Chevron Right Icon"
|
|
@@ -70,24 +115,24 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
70
115
|
</DropdownMenu.SubTrigger>
|
|
71
116
|
<DropdownMenu.Portal>
|
|
72
117
|
<DropdownMenu.SubContent
|
|
73
|
-
className="min-w-[220px] rounded-
|
|
118
|
+
className="min-w-[220px] rounded-inner bg-white p-[5px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] will-change-[opacity,transform] data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade"
|
|
74
119
|
sideOffset={2}
|
|
75
120
|
alignOffset={-5}
|
|
76
121
|
>
|
|
77
|
-
<DropdownMenu.Item className="group relative flex h-[25px] select-none items-center rounded-
|
|
122
|
+
<DropdownMenu.Item className="group relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1">
|
|
78
123
|
Save Page As…{" "}
|
|
79
124
|
<div className="ml-auto pl-[20px] text-mauve-11 group-data-[disabled]:text-mauve-8 group-data-[highlighted]:text-white">
|
|
80
125
|
⌘+S
|
|
81
126
|
</div>
|
|
82
127
|
</DropdownMenu.Item>
|
|
83
|
-
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-
|
|
128
|
+
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1">
|
|
84
129
|
Create Shortcut…
|
|
85
130
|
</DropdownMenu.Item>
|
|
86
|
-
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-
|
|
131
|
+
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1">
|
|
87
132
|
Name Window…
|
|
88
133
|
</DropdownMenu.Item>
|
|
89
134
|
<DropdownMenu.Separator className="m-[5px] h-[1px] bg-violet-6" />
|
|
90
|
-
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-
|
|
135
|
+
<DropdownMenu.Item className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1">
|
|
91
136
|
Developer Tools
|
|
92
137
|
</DropdownMenu.Item>
|
|
93
138
|
</DropdownMenu.SubContent>
|
|
@@ -96,32 +141,42 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
96
141
|
|
|
97
142
|
<DropdownMenu.Separator className="m-[5px] h-[1px] bg-violet-6" />
|
|
98
143
|
|
|
144
|
+
{dropdownData.checkboxes.map((ch, i) => (
|
|
145
|
+
<DropdownMenu.CheckboxItem
|
|
146
|
+
key={i}
|
|
147
|
+
className="group relative flex h-[25px] select-none items-center
|
|
148
|
+
justify-between rounded-inner px-[5px] text-[13px] leading-none text-violet-11
|
|
149
|
+
outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8
|
|
150
|
+
data-[highlighted]:text-violet-1"
|
|
151
|
+
// ltr:pl-[25px] rtl:pr-[25px]
|
|
152
|
+
checked={bookmarksChecked}
|
|
153
|
+
onCheckedChange={setBookmarksChecked}
|
|
154
|
+
>
|
|
155
|
+
<DropdownMenu.ItemIndicator className="absolute inline-flex w-[25px] items-center justify-center ltr:left-0 rtl:right-0">
|
|
156
|
+
<svg
|
|
157
|
+
aria-label="Check Mark"
|
|
158
|
+
stroke="currentColor"
|
|
159
|
+
fill="currentColor"
|
|
160
|
+
stroke-width="0"
|
|
161
|
+
viewBox="0 0 512 512"
|
|
162
|
+
height="0.60em"
|
|
163
|
+
width="0.60em"
|
|
164
|
+
>
|
|
165
|
+
<path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path>
|
|
166
|
+
</svg>{" "}
|
|
167
|
+
</DropdownMenu.ItemIndicator>
|
|
168
|
+
{/* Show Bookmarks{" "} */}
|
|
169
|
+
{ch.label}
|
|
170
|
+
<div className=" text-mauve-11 group-data-[disabled]:text-mauve-8 group-data-[highlighted]:text-white">
|
|
171
|
+
{/* ml-auto pl-[20px] */}
|
|
172
|
+
{/* ⌘+B */}
|
|
173
|
+
{ch.shortcut}
|
|
174
|
+
</div>
|
|
175
|
+
</DropdownMenu.CheckboxItem>
|
|
176
|
+
))}
|
|
177
|
+
{/*
|
|
99
178
|
<DropdownMenu.CheckboxItem
|
|
100
|
-
className="
|
|
101
|
-
checked={bookmarksChecked}
|
|
102
|
-
onCheckedChange={setBookmarksChecked}
|
|
103
|
-
>
|
|
104
|
-
<DropdownMenu.ItemIndicator className="absolute left-0 inline-flex w-[25px] items-center justify-center">
|
|
105
|
-
<svg
|
|
106
|
-
aria-label="Check Mark"
|
|
107
|
-
stroke="currentColor"
|
|
108
|
-
fill="currentColor"
|
|
109
|
-
stroke-width="0"
|
|
110
|
-
viewBox="0 0 512 512"
|
|
111
|
-
height="0.60em"
|
|
112
|
-
width="0.60em"
|
|
113
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
114
|
-
>
|
|
115
|
-
<path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path>
|
|
116
|
-
</svg>{" "}
|
|
117
|
-
</DropdownMenu.ItemIndicator>
|
|
118
|
-
Show Bookmarks{" "}
|
|
119
|
-
<div className="ml-auto pl-[20px] text-mauve-11 group-data-[disabled]:text-mauve-8 group-data-[highlighted]:text-white">
|
|
120
|
-
⌘+B
|
|
121
|
-
</div>
|
|
122
|
-
</DropdownMenu.CheckboxItem>
|
|
123
|
-
<DropdownMenu.CheckboxItem
|
|
124
|
-
className="relative flex h-[25px] select-none items-center rounded-[3px] px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1"
|
|
179
|
+
className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1"
|
|
125
180
|
checked={urlsChecked}
|
|
126
181
|
onCheckedChange={setUrlsChecked}
|
|
127
182
|
>
|
|
@@ -134,13 +189,12 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
134
189
|
viewBox="0 0 512 512"
|
|
135
190
|
height="0.60em"
|
|
136
191
|
width="0.60em"
|
|
137
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
138
192
|
>
|
|
139
193
|
<path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path>
|
|
140
194
|
</svg>{" "}
|
|
141
195
|
</DropdownMenu.ItemIndicator>
|
|
142
196
|
Show Full URLs
|
|
143
|
-
</DropdownMenu.CheckboxItem>
|
|
197
|
+
</DropdownMenu.CheckboxItem> */}
|
|
144
198
|
|
|
145
199
|
<DropdownMenu.Separator className="m-[5px] h-[1px] bg-violet-6" />
|
|
146
200
|
|
|
@@ -149,7 +203,7 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
149
203
|
</DropdownMenu.Label>
|
|
150
204
|
<DropdownMenu.RadioGroup value={person} onValueChange={setPerson}>
|
|
151
205
|
<DropdownMenu.RadioItem
|
|
152
|
-
className="relative flex h-[25px] select-none items-center rounded-
|
|
206
|
+
className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1"
|
|
153
207
|
value="pedro"
|
|
154
208
|
>
|
|
155
209
|
<DropdownMenu.ItemIndicator className="absolute left-0 inline-flex w-[25px] items-center justify-center">
|
|
@@ -169,7 +223,7 @@ export const HawaDropdownMenu: FC<TMenuTypes> = ({ children, direction }) => {
|
|
|
169
223
|
Pedro Duarte
|
|
170
224
|
</DropdownMenu.RadioItem>
|
|
171
225
|
<DropdownMenu.RadioItem
|
|
172
|
-
className="relative flex h-[25px] select-none items-center rounded-
|
|
226
|
+
className="relative flex h-[25px] select-none items-center rounded-inner px-[5px] pl-[25px] text-[13px] leading-none text-violet-11 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-violet-9 data-[disabled]:text-mauve-8 data-[highlighted]:text-violet-1"
|
|
173
227
|
value="colm"
|
|
174
228
|
>
|
|
175
229
|
<DropdownMenu.ItemIndicator className="absolute left-0 inline-flex w-[25px] items-center justify-center">
|