@sikka/hawa 0.1.88 → 0.1.90

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.1.88",
3
+ "version": "0.1.90",
4
4
  "description": "Modern UI Kit made with Tailwind & Radix Primitives",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -15,7 +15,7 @@ type ResetPasswordType = {
15
15
  handleResetPassword: () => void
16
16
  handleRouteToSignUp: () => void
17
17
  sent: any
18
- texts: {
18
+ texts?: {
19
19
  emailLabel: string
20
20
  emailPlaceholder: string
21
21
  emailRequiredText: string
@@ -54,42 +54,42 @@ export const ResetPasswordForm: FC<ResetPasswordType> = (props) => {
54
54
  <HawaTextField
55
55
  width="full"
56
56
  type="text"
57
- label={props.texts.emailLabel}
57
+ label={props.texts?.emailLabel}
58
58
  helpertext={errors.email?.message}
59
- placeholder={props.texts.emailPlaceholder}
59
+ placeholder={props.texts?.emailPlaceholder}
60
60
  {...field}
61
61
  value={field.value ?? ""}
62
62
  />
63
63
  )}
64
64
  rules={{
65
- required: props.texts.emailRequiredText,
65
+ required: props.texts?.emailRequiredText,
66
66
  pattern: {
67
67
  value:
68
68
  /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
69
- message: props.texts.emailInvalidText,
69
+ message: props.texts?.emailInvalidText,
70
70
  },
71
71
  }}
72
72
  />
73
73
  <div className=" pb-2 text-left text-sm dark:text-gray-300">
74
- {props.texts.dontHaveAccount ?? "Don't have an account? "}
74
+ {props.texts?.dontHaveAccount ?? "Don't have an account? "}
75
75
  <span
76
76
  onClick={props.handleRouteToSignUp}
77
77
  className="clickable-link"
78
78
  >
79
- {props.texts.signUpText ?? "Sign Up"}
79
+ {props.texts?.signUpText ?? "Sign Up"}
80
80
  </span>
81
81
  </div>
82
82
  </CardContent>
83
83
  <CardFooter>
84
84
  <Button type="submit" className="w-full">
85
- {props.texts.resetPassword}
85
+ {props.texts?.resetPassword}
86
86
  </Button>
87
87
  </CardFooter>
88
88
  </form>
89
89
  </>
90
90
  ) : (
91
91
  <CardContent headless>
92
- <div className="text-center">{props.texts.emailSentText}</div>
92
+ <div className="text-center">{props.texts?.emailSentText}</div>
93
93
  </CardContent>
94
94
  )}
95
95
  </Card>
@@ -265,6 +265,7 @@ interface DropdownMenuProps {
265
265
  align?: ExtendedDropdownMenuContentProps["align"]
266
266
  alignOffset?: ExtendedDropdownMenuContentProps["alignOffset"]
267
267
  width?: "default" | "sm" | "lg" | "parent"
268
+ selectCallback?: any
268
269
  }
269
270
  export const DropdownMenu: React.FC<DropdownMenuProps> = ({
270
271
  trigger,
@@ -277,6 +278,7 @@ export const DropdownMenu: React.FC<DropdownMenuProps> = ({
277
278
  triggerClassname,
278
279
  align,
279
280
  alignOffset,
281
+ selectCallback,
280
282
  width = "default",
281
283
  }) => {
282
284
  const widthStyles = {
@@ -311,7 +313,10 @@ export const DropdownMenu: React.FC<DropdownMenuProps> = ({
311
313
  <DropdownMenuItem
312
314
  disabled={subitem.disabled}
313
315
  className="flex flex-row gap-2"
314
- onSelect={() => subitem.action()}
316
+ onSelect={() => {
317
+ subitem.action()
318
+ selectCallback(subitem.value)
319
+ }}
315
320
  key={subIndex}
316
321
  >
317
322
  {subitem.icon && subitem.icon}
@@ -330,7 +335,12 @@ export const DropdownMenu: React.FC<DropdownMenuProps> = ({
330
335
  if (item.presist) {
331
336
  e.preventDefault()
332
337
  }
333
- item.action()
338
+ if (item.action) {
339
+ item.action()
340
+ selectCallback(item.value)
341
+ } else {
342
+ selectCallback(item.value)
343
+ }
334
344
  }}
335
345
  end={item.end}
336
346
  >
@@ -40,7 +40,6 @@ type TableTypes = {
40
40
  filter?: string
41
41
  }
42
42
  bordersWidth?: string
43
- onActionClicked?: any
44
43
  headerTools?: boolean
45
44
  borders?: "all" | "cols" | "rows" | "outer" | "inner"
46
45
  }
@@ -109,6 +108,7 @@ export const HawaTable: FC<TableTypes> = ({
109
108
  useEffect(() => {
110
109
  changePage()
111
110
  }, [slice, page])
111
+
112
112
  return (
113
113
  <div className="relative flex flex-col gap-2 ">
114
114
  <div className={`overflow-x-auto rounded bg-${headerColor}`}>
@@ -316,6 +316,9 @@ export const HawaTable: FC<TableTypes> = ({
316
316
  direction={direction}
317
317
  side="right"
318
318
  items={props.actions}
319
+ selectCallback={(e) =>
320
+ props.handleActionClick(e, singleRow)
321
+ }
319
322
  trigger={
320
323
  <div className="flex w-fit cursor-pointer items-center justify-center rounded p-2 hover:bg-gray-200 dark:hover:bg-gray-600">
321
324
  <svg
package/tsup.config.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ splitting: true,
3
+ sourcemap: true,
4
+ clean: true,
5
+ dts: true,
6
+ external: ["react", "react-dom", "react-icons"]
7
+ };