@sikka/hawa 0.30.30-next → 0.31.0-next

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.
@@ -0,0 +1,4 @@
1
+ type PositionType = "top" | "bottom" | "right" | "left";
2
+ type RadiusType = "full" | "inherit" | "none";
3
+
4
+ export type { PositionType as P, RadiusType as R };
@@ -0,0 +1,4 @@
1
+ type PositionType = "top" | "bottom" | "right" | "left";
2
+ type RadiusType = "full" | "inherit" | "none";
3
+
4
+ export type { PositionType as P, RadiusType as R };
package/dist/index.css CHANGED
@@ -3574,13 +3574,39 @@ body {
3574
3574
  .hawa-group.success .group-\[\.success\]\:hawa-border-muted\/40 {
3575
3575
  border-color: hsl(var(--muted) / 0.4);
3576
3576
  }
3577
+ .hawa-group.toaster .group-\[\.toaster\]\:hawa-border-border {
3578
+ border-color: hsl(var(--border));
3579
+ }
3577
3580
  .hawa-group.warning .group-\[\.warning\]\:hawa-border-muted\/40 {
3578
3581
  border-color: hsl(var(--muted) / 0.4);
3579
3582
  }
3583
+ .hawa-group.toast .group-\[\.toast\]\:hawa-bg-muted {
3584
+ background-color: hsl(var(--muted));
3585
+ }
3586
+ .hawa-group.toast .group-\[\.toast\]\:hawa-bg-primary {
3587
+ background-color: hsl(var(--primary));
3588
+ }
3589
+ .hawa-group.toaster .group-\[\.toaster\]\:hawa-bg-background {
3590
+ background-color: hsl(var(--background));
3591
+ }
3580
3592
  .hawa-group.destructive .group-\[\.destructive\]\:hawa-text-red-300 {
3581
3593
  --tw-text-opacity: 1;
3582
3594
  color: rgb(252 165 165 / var(--tw-text-opacity));
3583
3595
  }
3596
+ .hawa-group.toast .group-\[\.toast\]\:hawa-text-muted-foreground {
3597
+ color: hsl(var(--muted-foreground));
3598
+ }
3599
+ .hawa-group.toast .group-\[\.toast\]\:hawa-text-primary-foreground {
3600
+ color: hsl(var(--primary-foreground));
3601
+ }
3602
+ .hawa-group.toaster .group-\[\.toaster\]\:hawa-text-foreground {
3603
+ color: hsl(var(--foreground));
3604
+ }
3605
+ .hawa-group.toaster .group-\[\.toaster\]\:hawa-shadow-lg {
3606
+ --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
3607
+ --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
3608
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
3609
+ }
3584
3610
  .hawa-group.error .group-\[\.error\]\:hover\:hawa-border-error\/30:hover {
3585
3611
  border-color: hsl(var(--error) / 0.3);
3586
3612
  }
@@ -0,0 +1,11 @@
1
+ import * as React$1 from 'react';
2
+ import { D as DirectionType } from '../commonTypes-2k6FnHw5.mjs';
3
+ import { toast, Toaster } from 'sonner';
4
+
5
+ type SonnerProps = React.ComponentProps<typeof Toaster> & {
6
+ direction?: DirectionType;
7
+ };
8
+ declare const Sonner: ({ ...props }: SonnerProps) => React$1.JSX.Element;
9
+ declare const createSonner: typeof toast;
10
+
11
+ export { Sonner, createSonner };
@@ -0,0 +1,11 @@
1
+ import * as React$1 from 'react';
2
+ import { D as DirectionType } from '../commonTypes-2k6FnHw5.js';
3
+ import { toast, Toaster } from 'sonner';
4
+
5
+ type SonnerProps = React.ComponentProps<typeof Toaster> & {
6
+ direction?: DirectionType;
7
+ };
8
+ declare const Sonner: ({ ...props }: SonnerProps) => React$1.JSX.Element;
9
+ declare const createSonner: typeof toast;
10
+
11
+ export { Sonner, createSonner };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // elements/sonner/index.ts
22
+ var sonner_exports = {};
23
+ __export(sonner_exports, {
24
+ Sonner: () => Sonner,
25
+ createSonner: () => createSonner
26
+ });
27
+ module.exports = __toCommonJS(sonner_exports);
28
+
29
+ // elements/sonner/Sonner.tsx
30
+ var import_sonner = require("sonner");
31
+ var Sonner = ({ ...props }) => {
32
+ return /* @__PURE__ */ React.createElement(
33
+ import_sonner.Toaster,
34
+ {
35
+ dir: props.direction,
36
+ position: props.direction === "rtl" ? "bottom-left" : "bottom-right",
37
+ className: "toaster group",
38
+ toastOptions: {
39
+ classNames: {
40
+ toast: "group toast group-[.toaster]:hawa-bg-background group-[.toaster]:hawa-text-foreground group-[.toaster]:hawa-border-border group-[.toaster]:hawa-shadow-lg",
41
+ description: "group-[.toast]:text-muted-foreground",
42
+ actionButton: "group-[.toast]:hawa-bg-primary group-[.toast]:hawa-text-primary-foreground",
43
+ cancelButton: "group-[.toast]:hawa-bg-muted group-[.toast]:hawa-text-muted-foreground"
44
+ }
45
+ },
46
+ ...props
47
+ }
48
+ );
49
+ };
50
+ var createSonner = import_sonner.toast;
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ Sonner,
54
+ createSonner
55
+ });
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../elements/sonner/index.ts","../../elements/sonner/Sonner.tsx"],"sourcesContent":["export * from \"./Sonner\";\n","import { DirectionType } from \"@_types/commonTypes\";\nimport { Toaster as SonnerToaster, toast, ToastT } from \"sonner\";\n\ntype SonnerProps = React.ComponentProps<typeof SonnerToaster> & {\n direction?: DirectionType;\n};\n\nconst Sonner = ({ ...props }: SonnerProps) => {\n return (\n <SonnerToaster\n // theme={theme as SonnerProps[\"theme\"]}\n\n dir={props.direction}\n position={props.direction === \"rtl\" ? \"bottom-left\" : \"bottom-right\"}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:hawa-bg-background group-[.toaster]:hawa-text-foreground group-[.toaster]:hawa-border-border group-[.toaster]:hawa-shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:hawa-bg-primary group-[.toast]:hawa-text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:hawa-bg-muted group-[.toast]:hawa-text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n};\n\nconst createSonner: typeof toast = toast;\n\nexport { Sonner, createSonner };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,oBAAwD;AAMxD,IAAM,SAAS,CAAC,EAAE,GAAG,MAAM,MAAmB;AAC5C,SACE;AAAA,IAAC,cAAAA;AAAA,IAAA;AAAA,MAGC,KAAK,MAAM;AAAA,MACX,UAAU,MAAM,cAAc,QAAQ,gBAAgB;AAAA,MACtD,WAAU;AAAA,MACV,cAAc;AAAA,QACZ,YAAY;AAAA,UACV,OACE;AAAA,UACF,aAAa;AAAA,UACb,cACE;AAAA,UACF,cACE;AAAA,QACJ;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,eAA6B;","names":["SonnerToaster"]}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+
3
+ // elements/sonner/Sonner.tsx
4
+ import { Toaster as SonnerToaster, toast } from "sonner";
5
+ var Sonner = ({ ...props }) => {
6
+ return /* @__PURE__ */ React.createElement(
7
+ SonnerToaster,
8
+ {
9
+ dir: props.direction,
10
+ position: props.direction === "rtl" ? "bottom-left" : "bottom-right",
11
+ className: "toaster group",
12
+ toastOptions: {
13
+ classNames: {
14
+ toast: "group toast group-[.toaster]:hawa-bg-background group-[.toaster]:hawa-text-foreground group-[.toaster]:hawa-border-border group-[.toaster]:hawa-shadow-lg",
15
+ description: "group-[.toast]:text-muted-foreground",
16
+ actionButton: "group-[.toast]:hawa-bg-primary group-[.toast]:hawa-text-primary-foreground",
17
+ cancelButton: "group-[.toast]:hawa-bg-muted group-[.toast]:hawa-text-muted-foreground"
18
+ }
19
+ },
20
+ ...props
21
+ }
22
+ );
23
+ };
24
+ var createSonner = toast;
25
+ export {
26
+ Sonner,
27
+ createSonner
28
+ };
29
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../elements/sonner/Sonner.tsx"],"sourcesContent":["import { DirectionType } from \"@_types/commonTypes\";\nimport { Toaster as SonnerToaster, toast, ToastT } from \"sonner\";\n\ntype SonnerProps = React.ComponentProps<typeof SonnerToaster> & {\n direction?: DirectionType;\n};\n\nconst Sonner = ({ ...props }: SonnerProps) => {\n return (\n <SonnerToaster\n // theme={theme as SonnerProps[\"theme\"]}\n\n dir={props.direction}\n position={props.direction === \"rtl\" ? \"bottom-left\" : \"bottom-right\"}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:hawa-bg-background group-[.toaster]:hawa-text-foreground group-[.toaster]:hawa-border-border group-[.toaster]:hawa-shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:hawa-bg-primary group-[.toast]:hawa-text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:hawa-bg-muted group-[.toast]:hawa-text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n};\n\nconst createSonner: typeof toast = toast;\n\nexport { Sonner, createSonner };\n"],"mappings":";;;AACA,SAAS,WAAW,eAAe,aAAqB;AAMxD,IAAM,SAAS,CAAC,EAAE,GAAG,MAAM,MAAmB;AAC5C,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,KAAK,MAAM;AAAA,MACX,UAAU,MAAM,cAAc,QAAQ,gBAAgB;AAAA,MACtD,WAAU;AAAA,MACV,cAAc;AAAA,QACZ,YAAY;AAAA,UACV,OACE;AAAA,UACF,aAAa;AAAA,UACb,cACE;AAAA,UACF,cACE;AAAA,QACJ;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,eAA6B;","names":[]}
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SwitchPrimitives from '@radix-ui/react-switch';
3
-
4
- type RadiusType = "full" | "inherit" | "none";
3
+ import { R as RadiusType } from '../commonTypes-2k6FnHw5.mjs';
5
4
 
6
5
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
7
6
  size?: "default" | "sm" | "lg";
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SwitchPrimitives from '@radix-ui/react-switch';
3
-
4
- type RadiusType = "full" | "inherit" | "none";
3
+ import { R as RadiusType } from '../commonTypes-2k6FnHw5.js';
5
4
 
6
5
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
7
6
  size?: "default" | "sm" | "lg";
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import * as TabsPrimitive from '@radix-ui/react-tabs';
4
- import { R as RadiusType } from '../commonTypes-MeUyaBib.mjs';
4
+ import { R as RadiusType } from '../commonTypes-eIwARo5g.mjs';
5
5
 
6
6
  type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
7
7
  type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import * as TabsPrimitive from '@radix-ui/react-tabs';
4
- import { R as RadiusType } from '../commonTypes-MeUyaBib.js';
4
+ import { R as RadiusType } from '../commonTypes-eIwARo5g.js';
5
5
 
6
6
  type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
7
7
  type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PositionType } from '../commonTypes-MeUyaBib.mjs';
2
+ import { P as PositionType } from '../commonTypes-eIwARo5g.mjs';
3
3
 
4
4
  type LabelProps = {
5
5
  hint?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PositionType } from '../commonTypes-MeUyaBib.js';
2
+ import { P as PositionType } from '../commonTypes-eIwARo5g.js';
3
3
 
4
4
  type LabelProps = {
5
5
  hint?: React.ReactNode;
@@ -2,7 +2,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import * as React from 'react';
3
3
  import * as ToastPrimitives from '@radix-ui/react-toast';
4
4
  import { VariantProps } from 'class-variance-authority';
5
- import { D as DirectionType } from '../commonTypes-MeUyaBib.mjs';
5
+ import { D as DirectionType } from '../commonTypes-_11epZYh.mjs';
6
6
 
7
7
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
8
8
  declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
@@ -2,7 +2,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import * as React from 'react';
3
3
  import * as ToastPrimitives from '@radix-ui/react-toast';
4
4
  import { VariantProps } from 'class-variance-authority';
5
- import { D as DirectionType } from '../commonTypes-MeUyaBib.js';
5
+ import { D as DirectionType } from '../commonTypes-_11epZYh.js';
6
6
 
7
7
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
8
8
  declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
@@ -1,27 +1,9 @@
1
- import * as React from 'react';
2
1
  import React__default from 'react';
3
2
  import { D as DirectionType } from '../commonTypes-_11epZYh.mjs';
4
- import * as class_variance_authority_types from 'class-variance-authority/types';
5
- import * as ToastPrimitives from '@radix-ui/react-toast';
6
- import { VariantProps } from 'class-variance-authority';
7
-
8
- declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
9
- variant?: "default" | "destructive" | null | undefined;
10
- severity?: "info" | "warning" | "error" | "success" | "none" | null | undefined;
11
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
12
- direction?: DirectionType | undefined;
13
- } & React.RefAttributes<HTMLLIElement>>;
14
- declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
15
- type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
16
- type ToastActionElement = React.ReactElement<typeof ToastAction>;
17
- type ToasterToastProps = ToastProps & {
18
- id: string;
19
- title?: React.ReactNode;
20
- description?: React.ReactNode;
21
- severity?: "info" | "warning" | "error" | "success" | "none";
22
- action?: ToastActionElement;
23
- size?: "default" | "sm";
24
- };
3
+ import { ToasterToastProps } from '../toast/index.mjs';
4
+ import 'class-variance-authority/types';
5
+ import '@radix-ui/react-toast';
6
+ import 'class-variance-authority';
25
7
 
26
8
  type ToasterProps = {
27
9
  direction?: DirectionType;
@@ -1,27 +1,9 @@
1
- import * as React from 'react';
2
1
  import React__default from 'react';
3
2
  import { D as DirectionType } from '../commonTypes-_11epZYh.js';
4
- import * as class_variance_authority_types from 'class-variance-authority/types';
5
- import * as ToastPrimitives from '@radix-ui/react-toast';
6
- import { VariantProps } from 'class-variance-authority';
7
-
8
- declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
9
- variant?: "default" | "destructive" | null | undefined;
10
- severity?: "info" | "warning" | "error" | "success" | "none" | null | undefined;
11
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
12
- direction?: DirectionType | undefined;
13
- } & React.RefAttributes<HTMLLIElement>>;
14
- declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
15
- type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
16
- type ToastActionElement = React.ReactElement<typeof ToastAction>;
17
- type ToasterToastProps = ToastProps & {
18
- id: string;
19
- title?: React.ReactNode;
20
- description?: React.ReactNode;
21
- severity?: "info" | "warning" | "error" | "success" | "none";
22
- action?: ToastActionElement;
23
- size?: "default" | "sm";
24
- };
3
+ import { ToasterToastProps } from '../toast/index.js';
4
+ import 'class-variance-authority/types';
5
+ import '@radix-ui/react-toast';
6
+ import 'class-variance-authority';
25
7
 
26
8
  type ToasterProps = {
27
9
  direction?: DirectionType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.30.30-next",
3
+ "version": "0.31.0-next",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",
@@ -80,6 +80,7 @@
80
80
  "react-hook-form": "^7.51.2",
81
81
  "react-select": "^5.8.0",
82
82
  "signature_pad": "^4.2.0",
83
+ "sonner": "^1.2.3",
83
84
  "tailwind-merge": "^2.2.2",
84
85
  "tailwind-variants": "^0.2.1",
85
86
  "trim-canvas": "^0.1.2",
@@ -89,7 +90,7 @@
89
90
  "@babel/preset-react": "^7.24.1",
90
91
  "@sikka/alam": "^0.0.4",
91
92
  "@testing-library/jest-dom": "^6.4.2",
92
- "@testing-library/react": "^14.2.2",
93
+ "@testing-library/react": "^14.3.0",
93
94
  "@types/jest": "^29.5.12",
94
95
  "@types/react": "^18.2.74",
95
96
  "@types/react-dom": "^18.2.24",
@@ -1,5 +0,0 @@
1
- type DirectionType = "rtl" | "ltr";
2
- type PositionType = "top" | "bottom" | "right" | "left";
3
- type RadiusType = "full" | "inherit" | "none";
4
-
5
- export type { DirectionType as D, PositionType as P, RadiusType as R };
@@ -1,5 +0,0 @@
1
- type DirectionType = "rtl" | "ltr";
2
- type PositionType = "top" | "bottom" | "right" | "left";
3
- type RadiusType = "full" | "inherit" | "none";
4
-
5
- export type { DirectionType as D, PositionType as P, RadiusType as R };