@sikka/hawa 0.25.0-next → 0.25.2-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.
- package/dist/blocks/auth/index.js +2 -1
- package/dist/blocks/auth/index.mjs +2 -1
- package/dist/blocks/index.js +2 -1
- package/dist/blocks/index.mjs +2 -2
- package/dist/carousel/index.d.mts +5 -5
- package/dist/carousel/index.d.ts +5 -5
- package/dist/carousel/index.js +11 -10
- package/dist/carousel/index.mjs +11 -10
- package/dist/chunk-KNHT2UBG.mjs +150 -0
- package/dist/{chunk-XE3FLWLT.mjs → chunk-MJMQDUCC.mjs} +1 -0
- package/dist/commonTypes-2IGtJ5cq.d.mts +3 -0
- package/dist/commonTypes-2IGtJ5cq.d.ts +3 -0
- package/dist/commonTypes-2k6FnHw5.d.mts +4 -0
- package/dist/commonTypes-2k6FnHw5.d.ts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.mts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.ts +4 -0
- package/dist/{commonTypes-3J1E3b61.d.mts → commonTypes-f_LVO3Sm.d.mts} +1 -2
- package/dist/{commonTypes-3J1E3b61.d.ts → commonTypes-f_LVO3Sm.d.ts} +1 -2
- package/dist/elements/index.d.mts +5 -5
- package/dist/elements/index.d.ts +5 -5
- package/dist/elements/index.js +12 -10
- package/dist/elements/index.mjs +12 -11
- package/dist/glow/index.d.mts +16 -0
- package/dist/glow/index.d.ts +16 -0
- package/dist/glow/index.js +155 -0
- package/dist/glow/index.mjs +117 -0
- package/dist/index.css +212 -206
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +13 -11
- package/dist/index.mjs +13 -11
- package/dist/input/index.d.mts +9 -2
- package/dist/input/index.d.ts +9 -2
- package/dist/input/index.mjs +1 -1
- package/dist/interfaceSettings/index.mjs +1 -1
- package/dist/label/index.d.mts +2 -1
- package/dist/label/index.d.ts +2 -1
- package/dist/label/index.mjs +98 -2
- package/dist/navigationMenu/index.d.mts +1 -2
- package/dist/navigationMenu/index.d.ts +1 -2
- package/dist/pagination/index.d.mts +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/passwordInput/index.mjs +148 -27
- package/dist/phoneInput/index.d.mts +1 -1
- package/dist/phoneInput/index.d.ts +1 -1
- package/dist/phoneInput/index.mjs +140 -19
- package/dist/pinInput/index.js +1 -0
- package/dist/pinInput/index.mjs +1 -0
- package/dist/popover/index.d.mts +1 -2
- package/dist/popover/index.d.ts +1 -2
- package/dist/radio/index.d.mts +4 -1
- package/dist/radio/index.d.ts +4 -1
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/separator/index.d.mts +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/simpleTable/index.d.mts +1 -2
- package/dist/simpleTable/index.d.ts +1 -2
- package/dist/simpleTable/index.mjs +45 -21
- package/dist/skeleton/index.mjs +29 -3
- package/dist/sortButton/index.mjs +260 -9
- package/dist/splitButton/index.d.mts +3 -4
- package/dist/splitButton/index.d.ts +3 -4
- package/dist/splitButton/index.mjs +259 -10
- package/dist/switch/index.d.mts +1 -2
- package/dist/switch/index.d.ts +1 -2
- package/dist/tabs/index.d.mts +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toast/index.mjs +9 -139
- package/dist/toaster/index.d.mts +2 -2
- package/dist/toaster/index.d.ts +2 -2
- package/dist/toaster/index.mjs +17 -146
- package/dist/tooltip/index.d.mts +2 -2
- package/dist/tooltip/index.d.ts +2 -2
- package/package.json +12 -12
- package/dist/chunk-53XBVEMK.mjs +0 -131
- package/dist/chunk-DGWAHQRX.mjs +0 -259
- package/dist/chunk-ND4BWUKH.mjs +0 -34
- package/dist/commonTypes-LrR8QrYP.d.mts +0 -5
- package/dist/commonTypes-LrR8QrYP.d.ts +0 -5
- package/dist/{chunk-ABS2VEET.mjs → chunk-WRZFWCOQ.mjs} +3 -3
@@ -1,13 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
Label,
|
3
|
-
Skeleton
|
4
|
-
} from "../chunk-53XBVEMK.mjs";
|
5
1
|
import {
|
6
2
|
cn
|
7
3
|
} from "../chunk-TE3BKEXL.mjs";
|
8
4
|
|
9
5
|
// components/elements/phoneInput/PhoneInput.tsx
|
10
|
-
import
|
6
|
+
import React5, { useState, useRef, useEffect } from "react";
|
11
7
|
|
12
8
|
// components/countries.ts
|
13
9
|
var countries = [
|
@@ -1702,11 +1698,136 @@ var countries = [
|
|
1702
1698
|
];
|
1703
1699
|
var countries_default = countries;
|
1704
1700
|
|
1705
|
-
// components/elements/
|
1701
|
+
// components/elements/label/Label.tsx
|
1702
|
+
import * as React2 from "react";
|
1703
|
+
|
1704
|
+
// components/elements/tooltip/Tooltip.tsx
|
1706
1705
|
import React from "react";
|
1706
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
1707
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
1708
|
+
TooltipPrimitive.Content,
|
1709
|
+
{
|
1710
|
+
ref,
|
1711
|
+
sideOffset,
|
1712
|
+
className: cn(
|
1713
|
+
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
1714
|
+
className
|
1715
|
+
),
|
1716
|
+
...props
|
1717
|
+
}
|
1718
|
+
));
|
1719
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
1720
|
+
var TooltipArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
1721
|
+
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
1722
|
+
var Tooltip = ({
|
1723
|
+
side,
|
1724
|
+
open,
|
1725
|
+
content,
|
1726
|
+
children,
|
1727
|
+
defaultOpen,
|
1728
|
+
onOpenChange,
|
1729
|
+
triggerProps,
|
1730
|
+
contentProps,
|
1731
|
+
providerProps,
|
1732
|
+
delayDuration = 300,
|
1733
|
+
...props
|
1734
|
+
}) => {
|
1735
|
+
return /* @__PURE__ */ React.createElement(
|
1736
|
+
TooltipPrimitive.TooltipProvider,
|
1737
|
+
{
|
1738
|
+
delayDuration,
|
1739
|
+
...providerProps
|
1740
|
+
},
|
1741
|
+
/* @__PURE__ */ React.createElement(
|
1742
|
+
TooltipPrimitive.Root,
|
1743
|
+
{
|
1744
|
+
open,
|
1745
|
+
defaultOpen,
|
1746
|
+
onOpenChange,
|
1747
|
+
...props
|
1748
|
+
},
|
1749
|
+
/* @__PURE__ */ React.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
1750
|
+
/* @__PURE__ */ React.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
|
1751
|
+
)
|
1752
|
+
);
|
1753
|
+
};
|
1754
|
+
|
1755
|
+
// components/elements/label/Label.tsx
|
1756
|
+
var Label = React2.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React2.createElement(
|
1757
|
+
"label",
|
1758
|
+
{
|
1759
|
+
ref,
|
1760
|
+
className: cn(
|
1761
|
+
"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
|
1762
|
+
className
|
1763
|
+
),
|
1764
|
+
...props
|
1765
|
+
},
|
1766
|
+
children,
|
1767
|
+
required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
1768
|
+
), hint && /* @__PURE__ */ React2.createElement(
|
1769
|
+
Tooltip,
|
1770
|
+
{
|
1771
|
+
content: hint,
|
1772
|
+
side: hintSide,
|
1773
|
+
triggerProps: {
|
1774
|
+
tabIndex: -1,
|
1775
|
+
onClick: (event) => event.preventDefault()
|
1776
|
+
}
|
1777
|
+
},
|
1778
|
+
/* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
|
1779
|
+
"svg",
|
1780
|
+
{
|
1781
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1782
|
+
className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
|
1783
|
+
viewBox: "0 0 24 24",
|
1784
|
+
fill: "none",
|
1785
|
+
stroke: "currentColor",
|
1786
|
+
strokeWidth: "2",
|
1787
|
+
strokeLinecap: "round",
|
1788
|
+
strokeLinejoin: "round"
|
1789
|
+
},
|
1790
|
+
/* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
1791
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
1792
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
|
1793
|
+
))
|
1794
|
+
)));
|
1795
|
+
Label.displayName = "Label";
|
1796
|
+
|
1797
|
+
// components/elements/select/Select.tsx
|
1798
|
+
import React4 from "react";
|
1707
1799
|
import ReactSelect from "react-select";
|
1708
1800
|
import CreatableSelect from "react-select/creatable";
|
1709
1801
|
import clsx from "clsx";
|
1802
|
+
|
1803
|
+
// components/elements/skeleton/Skeleton.tsx
|
1804
|
+
import React3 from "react";
|
1805
|
+
function Skeleton({
|
1806
|
+
className,
|
1807
|
+
content,
|
1808
|
+
animation = "pulse",
|
1809
|
+
...props
|
1810
|
+
}) {
|
1811
|
+
const animationStyles = {
|
1812
|
+
none: "hawa-rounded hawa-bg-muted",
|
1813
|
+
pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
|
1814
|
+
shimmer: "hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10"
|
1815
|
+
};
|
1816
|
+
return /* @__PURE__ */ React3.createElement(
|
1817
|
+
"div",
|
1818
|
+
{
|
1819
|
+
className: cn(
|
1820
|
+
animationStyles[animation],
|
1821
|
+
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
1822
|
+
className
|
1823
|
+
),
|
1824
|
+
...props
|
1825
|
+
},
|
1826
|
+
content && content
|
1827
|
+
);
|
1828
|
+
}
|
1829
|
+
|
1830
|
+
// components/elements/select/Select.tsx
|
1710
1831
|
var Select = ({
|
1711
1832
|
labelProps,
|
1712
1833
|
labelKey = "label",
|
@@ -1714,10 +1835,10 @@ var Select = ({
|
|
1714
1835
|
}) => {
|
1715
1836
|
const NoOption = () => {
|
1716
1837
|
var _a, _b;
|
1717
|
-
return /* @__PURE__ */
|
1838
|
+
return /* @__PURE__ */ React4.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
1718
1839
|
};
|
1719
1840
|
const Control = ({ children, innerProps, innerRef }) => {
|
1720
|
-
return /* @__PURE__ */
|
1841
|
+
return /* @__PURE__ */ React4.createElement(
|
1721
1842
|
"div",
|
1722
1843
|
{
|
1723
1844
|
ref: innerRef,
|
@@ -1730,7 +1851,7 @@ var Select = ({
|
|
1730
1851
|
);
|
1731
1852
|
};
|
1732
1853
|
const Option = ({ children, innerProps, innerRef }) => {
|
1733
|
-
return /* @__PURE__ */
|
1854
|
+
return /* @__PURE__ */ React4.createElement(
|
1734
1855
|
"div",
|
1735
1856
|
{
|
1736
1857
|
ref: innerRef,
|
@@ -1751,7 +1872,7 @@ var Select = ({
|
|
1751
1872
|
...menuProps
|
1752
1873
|
}) => {
|
1753
1874
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
1754
|
-
return /* @__PURE__ */
|
1875
|
+
return /* @__PURE__ */ React4.createElement(
|
1755
1876
|
"div",
|
1756
1877
|
{
|
1757
1878
|
className: cn(
|
@@ -1765,7 +1886,7 @@ var Select = ({
|
|
1765
1886
|
children
|
1766
1887
|
);
|
1767
1888
|
};
|
1768
|
-
return /* @__PURE__ */
|
1889
|
+
return /* @__PURE__ */ React4.createElement(
|
1769
1890
|
"div",
|
1770
1891
|
{
|
1771
1892
|
className: cn(
|
@@ -1773,10 +1894,10 @@ var Select = ({
|
|
1773
1894
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
1774
1895
|
)
|
1775
1896
|
},
|
1776
|
-
props.label && /* @__PURE__ */
|
1777
|
-
props.isLoading ? /* @__PURE__ */
|
1897
|
+
props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label),
|
1898
|
+
props.isLoading ? /* @__PURE__ */ React4.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
1778
1899
|
// TODO: enable keyboard to go to the next item in the list
|
1779
|
-
/* @__PURE__ */
|
1900
|
+
/* @__PURE__ */ React4.createElement(
|
1780
1901
|
ReactSelect,
|
1781
1902
|
{
|
1782
1903
|
noOptionsMessage: NoOption,
|
@@ -1813,7 +1934,7 @@ var Select = ({
|
|
1813
1934
|
isSearchable: props.isSearchable
|
1814
1935
|
}
|
1815
1936
|
)
|
1816
|
-
) : /* @__PURE__ */
|
1937
|
+
) : /* @__PURE__ */ React4.createElement(
|
1817
1938
|
CreatableSelect,
|
1818
1939
|
{
|
1819
1940
|
formatCreateLabel: (inputValue) => {
|
@@ -1843,7 +1964,7 @@ var Select = ({
|
|
1843
1964
|
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
1844
1965
|
}
|
1845
1966
|
),
|
1846
|
-
!props.hideHelperText && /* @__PURE__ */
|
1967
|
+
!props.hideHelperText && /* @__PURE__ */ React4.createElement(
|
1847
1968
|
"p",
|
1848
1969
|
{
|
1849
1970
|
className: cn(
|
@@ -1879,7 +2000,7 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
1879
2000
|
console.log("handleChange prop was not provided in <PhoneInput/>");
|
1880
2001
|
}
|
1881
2002
|
};
|
1882
|
-
return /* @__PURE__ */
|
2003
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React5.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React5.createElement(
|
1883
2004
|
Select,
|
1884
2005
|
{
|
1885
2006
|
width: "fit",
|
@@ -1895,7 +2016,7 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
1895
2016
|
value: countryCode == null ? void 0 : countryCode.label,
|
1896
2017
|
onChange: setCountryCode
|
1897
2018
|
}
|
1898
|
-
), /* @__PURE__ */
|
2019
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React5.createElement(
|
1899
2020
|
"input",
|
1900
2021
|
{
|
1901
2022
|
ref: inputRef,
|
@@ -1908,7 +2029,7 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
1908
2029
|
type: "tel",
|
1909
2030
|
placeholder: "531045453"
|
1910
2031
|
}
|
1911
|
-
))), /* @__PURE__ */
|
2032
|
+
))), /* @__PURE__ */ React5.createElement(
|
1912
2033
|
"p",
|
1913
2034
|
{
|
1914
2035
|
className: cn(
|
package/dist/pinInput/index.js
CHANGED
package/dist/pinInput/index.mjs
CHANGED
package/dist/popover/index.d.mts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
3
|
-
|
4
|
-
type PositionType = "top" | "bottom" | "right" | "left";
|
3
|
+
import { P as PositionType } from '../commonTypes-2IGtJ5cq.mjs';
|
5
4
|
|
6
5
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
7
6
|
interface PopoverProps {
|
package/dist/popover/index.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
3
|
-
|
4
|
-
type PositionType = "top" | "bottom" | "right" | "left";
|
3
|
+
import { P as PositionType } from '../commonTypes-2IGtJ5cq.js';
|
5
4
|
|
6
5
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
7
6
|
interface PopoverProps {
|
package/dist/radio/index.d.mts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { FC } from 'react';
|
3
|
-
|
3
|
+
|
4
|
+
type DirectionType = "rtl" | "ltr";
|
5
|
+
type PositionType = "top" | "bottom" | "right" | "left";
|
6
|
+
type OrientationType = "vertical" | "horizontal";
|
4
7
|
|
5
8
|
type LabelProps = {
|
6
9
|
hint?: React.ReactNode;
|
package/dist/radio/index.d.ts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { FC } from 'react';
|
3
|
-
|
3
|
+
|
4
|
+
type DirectionType = "rtl" | "ltr";
|
5
|
+
type PositionType = "top" | "bottom" | "right" | "left";
|
6
|
+
type OrientationType = "vertical" | "horizontal";
|
4
7
|
|
5
8
|
type LabelProps = {
|
6
9
|
hint?: React.ReactNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
3
|
-
import { O as OrientationType } from '../commonTypes-
|
3
|
+
import { O as OrientationType } from '../commonTypes-GhKAraJw.mjs';
|
4
4
|
|
5
5
|
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
6
6
|
orientation?: OrientationType | undefined;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
3
|
-
import { O as OrientationType } from '../commonTypes-
|
3
|
+
import { O as OrientationType } from '../commonTypes-GhKAraJw.js';
|
4
4
|
|
5
5
|
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
6
6
|
orientation?: OrientationType | undefined;
|
@@ -1,21 +1,45 @@
|
|
1
|
-
import {
|
2
|
-
Skeleton
|
3
|
-
} from "../chunk-ND4BWUKH.mjs";
|
4
1
|
import {
|
5
2
|
cn
|
6
3
|
} from "../chunk-TE3BKEXL.mjs";
|
7
4
|
|
8
5
|
// components/elements/simpleTable/SimpleTable.tsx
|
9
|
-
import * as
|
6
|
+
import * as React3 from "react";
|
10
7
|
import {
|
11
8
|
flexRender,
|
12
9
|
getCoreRowModel,
|
13
10
|
useReactTable
|
14
11
|
} from "@tanstack/react-table";
|
15
12
|
|
13
|
+
// components/elements/skeleton/Skeleton.tsx
|
14
|
+
import React from "react";
|
15
|
+
function Skeleton({
|
16
|
+
className,
|
17
|
+
content,
|
18
|
+
animation = "pulse",
|
19
|
+
...props
|
20
|
+
}) {
|
21
|
+
const animationStyles = {
|
22
|
+
none: "hawa-rounded hawa-bg-muted",
|
23
|
+
pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
|
24
|
+
shimmer: "hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10"
|
25
|
+
};
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
27
|
+
"div",
|
28
|
+
{
|
29
|
+
className: cn(
|
30
|
+
animationStyles[animation],
|
31
|
+
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
32
|
+
className
|
33
|
+
),
|
34
|
+
...props
|
35
|
+
},
|
36
|
+
content && content
|
37
|
+
);
|
38
|
+
}
|
39
|
+
|
16
40
|
// components/elements/table/Table.tsx
|
17
|
-
import * as
|
18
|
-
var Table =
|
41
|
+
import * as React2 from "react";
|
42
|
+
var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React2.createElement(
|
19
43
|
"table",
|
20
44
|
{
|
21
45
|
ref,
|
@@ -24,7 +48,7 @@ var Table = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
24
48
|
}
|
25
49
|
)));
|
26
50
|
Table.displayName = "Table";
|
27
|
-
var TableHeader =
|
51
|
+
var TableHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
28
52
|
"thead",
|
29
53
|
{
|
30
54
|
ref,
|
@@ -33,8 +57,8 @@ var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
33
57
|
}
|
34
58
|
));
|
35
59
|
TableHeader.displayName = "TableHeader";
|
36
|
-
var TableHead =
|
37
|
-
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */
|
60
|
+
var TableHead = React2.forwardRef(
|
61
|
+
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
38
62
|
"th",
|
39
63
|
{
|
40
64
|
ref,
|
@@ -53,9 +77,9 @@ var TableHead = React.forwardRef(
|
|
53
77
|
)
|
54
78
|
);
|
55
79
|
TableHead.displayName = "TableHead";
|
56
|
-
var TableBody =
|
80
|
+
var TableBody = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement("tbody", { ref, className: cn("hawa-border-none", className), ...props }));
|
57
81
|
TableBody.displayName = "TableBody";
|
58
|
-
var TableFooter =
|
82
|
+
var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
59
83
|
"tfoot",
|
60
84
|
{
|
61
85
|
ref,
|
@@ -67,7 +91,7 @@ var TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
67
91
|
}
|
68
92
|
));
|
69
93
|
TableFooter.displayName = "TableFooter";
|
70
|
-
var TableRow =
|
94
|
+
var TableRow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
71
95
|
"tr",
|
72
96
|
{
|
73
97
|
ref,
|
@@ -81,14 +105,14 @@ var TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
81
105
|
}
|
82
106
|
));
|
83
107
|
TableRow.displayName = "TableRow";
|
84
|
-
var TableCell =
|
108
|
+
var TableCell = React2.forwardRef(
|
85
109
|
({ className, enablePadding = true, padding = "default", ...props }, ref) => {
|
86
110
|
let paddingStyles = {
|
87
111
|
condensed: "hawa-p-0 hawa-px-4",
|
88
112
|
default: "hawa-p-4",
|
89
113
|
noPadding: "hawa-p-0"
|
90
114
|
};
|
91
|
-
return /* @__PURE__ */
|
115
|
+
return /* @__PURE__ */ React2.createElement(
|
92
116
|
"td",
|
93
117
|
{
|
94
118
|
ref,
|
@@ -110,7 +134,7 @@ var TableCell = React.forwardRef(
|
|
110
134
|
}
|
111
135
|
);
|
112
136
|
TableCell.displayName = "TableCell";
|
113
|
-
var TableCaption =
|
137
|
+
var TableCaption = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
114
138
|
"caption",
|
115
139
|
{
|
116
140
|
ref,
|
@@ -136,7 +160,7 @@ var SimpleTable = ({
|
|
136
160
|
columns,
|
137
161
|
getCoreRowModel: getCoreRowModel()
|
138
162
|
});
|
139
|
-
return /* @__PURE__ */
|
163
|
+
return /* @__PURE__ */ React3.createElement(
|
140
164
|
"div",
|
141
165
|
{
|
142
166
|
className: cn(
|
@@ -144,8 +168,8 @@ var SimpleTable = ({
|
|
144
168
|
classNames
|
145
169
|
)
|
146
170
|
},
|
147
|
-
props.isLoading ? /* @__PURE__ */
|
148
|
-
return /* @__PURE__ */
|
171
|
+
props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "h-[130px] w-full" }) : /* @__PURE__ */ React3.createElement("div", { className: "hawa-rounded" }, /* @__PURE__ */ React3.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React3.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React3.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
172
|
+
return /* @__PURE__ */ React3.createElement(
|
149
173
|
TableHead,
|
150
174
|
{
|
151
175
|
condensed: props.condensed,
|
@@ -157,7 +181,7 @@ var SimpleTable = ({
|
|
157
181
|
header.getContext()
|
158
182
|
)
|
159
183
|
);
|
160
|
-
})))), /* @__PURE__ */
|
184
|
+
})))), /* @__PURE__ */ React3.createElement(TableBody, null, ((_a = table.getRowModel().rows) == null ? void 0 : _a.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React3.createElement(
|
161
185
|
TableRow,
|
162
186
|
{
|
163
187
|
key: row.id,
|
@@ -165,7 +189,7 @@ var SimpleTable = ({
|
|
165
189
|
},
|
166
190
|
row.getVisibleCells().map((cell) => {
|
167
191
|
var _a2;
|
168
|
-
return /* @__PURE__ */
|
192
|
+
return /* @__PURE__ */ React3.createElement(
|
169
193
|
TableCell,
|
170
194
|
{
|
171
195
|
dir: props.direction,
|
@@ -178,7 +202,7 @@ var SimpleTable = ({
|
|
178
202
|
)
|
179
203
|
);
|
180
204
|
})
|
181
|
-
)) : /* @__PURE__ */
|
205
|
+
)) : /* @__PURE__ */ React3.createElement(TableRow, null, /* @__PURE__ */ React3.createElement(
|
182
206
|
TableCell,
|
183
207
|
{
|
184
208
|
colSpan: columns.length,
|
package/dist/skeleton/index.mjs
CHANGED
@@ -1,7 +1,33 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "../chunk-
|
4
|
-
|
2
|
+
cn
|
3
|
+
} from "../chunk-TE3BKEXL.mjs";
|
4
|
+
|
5
|
+
// components/elements/skeleton/Skeleton.tsx
|
6
|
+
import React from "react";
|
7
|
+
function Skeleton({
|
8
|
+
className,
|
9
|
+
content,
|
10
|
+
animation = "pulse",
|
11
|
+
...props
|
12
|
+
}) {
|
13
|
+
const animationStyles = {
|
14
|
+
none: "hawa-rounded hawa-bg-muted",
|
15
|
+
pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
|
16
|
+
shimmer: "hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10"
|
17
|
+
};
|
18
|
+
return /* @__PURE__ */ React.createElement(
|
19
|
+
"div",
|
20
|
+
{
|
21
|
+
className: cn(
|
22
|
+
animationStyles[animation],
|
23
|
+
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
24
|
+
className
|
25
|
+
),
|
26
|
+
...props
|
27
|
+
},
|
28
|
+
content && content
|
29
|
+
);
|
30
|
+
}
|
5
31
|
export {
|
6
32
|
Skeleton
|
7
33
|
};
|