@sikka/hawa 0.15.9-next → 0.15.11-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/index.css +19 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +24 -12
- package/dist/index.mjs +32 -22
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1181,6 +1181,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1181
1181
|
.hawa-max-h-\[300px\] {
|
|
1182
1182
|
max-height: 300px;
|
|
1183
1183
|
}
|
|
1184
|
+
.hawa-max-h-\[400px\] {
|
|
1185
|
+
max-height: 400px;
|
|
1186
|
+
}
|
|
1184
1187
|
.hawa-max-h-fit {
|
|
1185
1188
|
max-height: -moz-fit-content;
|
|
1186
1189
|
max-height: fit-content;
|
|
@@ -1905,6 +1908,10 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1905
1908
|
--tw-bg-opacity: 1;
|
|
1906
1909
|
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
|
|
1907
1910
|
}
|
|
1911
|
+
.hawa-bg-blue-400 {
|
|
1912
|
+
--tw-bg-opacity: 1;
|
|
1913
|
+
background-color: rgb(96 165 250 / var(--tw-bg-opacity));
|
|
1914
|
+
}
|
|
1908
1915
|
.hawa-bg-blue-50 {
|
|
1909
1916
|
--tw-bg-opacity: 1;
|
|
1910
1917
|
background-color: rgb(239 246 255 / var(--tw-bg-opacity));
|
|
@@ -1977,6 +1984,10 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1977
1984
|
--tw-bg-opacity: 1;
|
|
1978
1985
|
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
|
|
1979
1986
|
}
|
|
1987
|
+
.hawa-bg-green-200 {
|
|
1988
|
+
--tw-bg-opacity: 1;
|
|
1989
|
+
background-color: rgb(187 247 208 / var(--tw-bg-opacity));
|
|
1990
|
+
}
|
|
1980
1991
|
.hawa-bg-green-400 {
|
|
1981
1992
|
--tw-bg-opacity: 1;
|
|
1982
1993
|
background-color: rgb(74 222 128 / var(--tw-bg-opacity));
|
|
@@ -2043,6 +2054,14 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
2043
2054
|
--tw-bg-opacity: 1;
|
|
2044
2055
|
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
|
|
2045
2056
|
}
|
|
2057
|
+
.hawa-bg-red-200 {
|
|
2058
|
+
--tw-bg-opacity: 1;
|
|
2059
|
+
background-color: rgb(254 202 202 / var(--tw-bg-opacity));
|
|
2060
|
+
}
|
|
2061
|
+
.hawa-bg-red-300 {
|
|
2062
|
+
--tw-bg-opacity: 1;
|
|
2063
|
+
background-color: rgb(252 165 165 / var(--tw-bg-opacity));
|
|
2064
|
+
}
|
|
2046
2065
|
.hawa-bg-red-500 {
|
|
2047
2066
|
--tw-bg-opacity: 1;
|
|
2048
2067
|
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
package/dist/index.d.mts
CHANGED
|
@@ -635,7 +635,8 @@ type DataTableProps<DataProps = {}> = {
|
|
|
635
635
|
};
|
|
636
636
|
declare module "@tanstack/table-core" {
|
|
637
637
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
638
|
-
|
|
638
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
639
|
+
sortable?: boolean;
|
|
639
640
|
}
|
|
640
641
|
}
|
|
641
642
|
declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, enableHideColumns, enableSearch, enableGoTo, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
|
|
@@ -660,7 +661,7 @@ type SimpleTableProps = {
|
|
|
660
661
|
};
|
|
661
662
|
declare module "@tanstack/table-core" {
|
|
662
663
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
663
|
-
|
|
664
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
664
665
|
}
|
|
665
666
|
}
|
|
666
667
|
declare const SimpleTable: React$1.FC<SimpleTableProps>;
|
|
@@ -677,6 +678,8 @@ declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttribu
|
|
|
677
678
|
declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
678
679
|
interface TableCellProps extends React$1.TdHTMLAttributes<HTMLTableCellElement> {
|
|
679
680
|
condensed?: boolean;
|
|
681
|
+
enablePadding?: boolean;
|
|
682
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
680
683
|
}
|
|
681
684
|
declare const TableCell: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
682
685
|
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -635,7 +635,8 @@ type DataTableProps<DataProps = {}> = {
|
|
|
635
635
|
};
|
|
636
636
|
declare module "@tanstack/table-core" {
|
|
637
637
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
638
|
-
|
|
638
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
639
|
+
sortable?: boolean;
|
|
639
640
|
}
|
|
640
641
|
}
|
|
641
642
|
declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, enableHideColumns, enableSearch, enableGoTo, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
|
|
@@ -660,7 +661,7 @@ type SimpleTableProps = {
|
|
|
660
661
|
};
|
|
661
662
|
declare module "@tanstack/table-core" {
|
|
662
663
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
663
|
-
|
|
664
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
664
665
|
}
|
|
665
666
|
}
|
|
666
667
|
declare const SimpleTable: React$1.FC<SimpleTableProps>;
|
|
@@ -677,6 +678,8 @@ declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttribu
|
|
|
677
678
|
declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
678
679
|
interface TableCellProps extends React$1.TdHTMLAttributes<HTMLTableCellElement> {
|
|
679
680
|
condensed?: boolean;
|
|
681
|
+
enablePadding?: boolean;
|
|
682
|
+
padding?: "condensed" | "default" | "noPadding";
|
|
680
683
|
}
|
|
681
684
|
declare const TableCell: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
682
685
|
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
package/dist/index.js
CHANGED
|
@@ -5484,7 +5484,7 @@ var Table = React42.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
|
5484
5484
|
"className"
|
|
5485
5485
|
]);
|
|
5486
5486
|
return React42.createElement("div", {
|
|
5487
|
-
className: "hawa-relative hawa-w-full
|
|
5487
|
+
className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border"
|
|
5488
5488
|
}, /* @__PURE__ */ React42.createElement("table", _object_spread({
|
|
5489
5489
|
ref: ref,
|
|
5490
5490
|
className: cn("hawa-w-full hawa-caption-bottom hawa-text-sm", className)
|
|
@@ -5543,14 +5543,24 @@ var TableRow = React42.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
|
5543
5543
|
}, props));
|
|
5544
5544
|
});
|
|
5545
5545
|
TableRow.displayName = "TableRow";
|
|
5546
|
-
var TableCell = React42.forwardRef(function(_param, ref)
|
|
5547
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
5548
|
-
"className"
|
|
5546
|
+
var TableCell = React42.forwardRef(function(_param, ref) {
|
|
5547
|
+
var className = _param.className, _param_enablePadding = _param.enablePadding, enablePadding = _param_enablePadding === void 0 ? true : _param_enablePadding, _param_padding = _param.padding, padding = _param_padding === void 0 ? "default" : _param_padding, props = _object_without_properties(_param, [
|
|
5548
|
+
"className",
|
|
5549
|
+
"enablePadding",
|
|
5550
|
+
"padding"
|
|
5549
5551
|
]);
|
|
5550
|
-
|
|
5552
|
+
var paddingStyles = {
|
|
5553
|
+
condensed: "hawa-p-0 hawa-px-4",
|
|
5554
|
+
default: "hawa-p-4",
|
|
5555
|
+
noPadding: "hawa-p-0"
|
|
5556
|
+
};
|
|
5557
|
+
return /* @__PURE__ */ React42.createElement("td", _object_spread({
|
|
5551
5558
|
ref: ref,
|
|
5552
|
-
className: cn(// "border-x",
|
|
5553
|
-
|
|
5559
|
+
className: cn(paddingStyles[padding], // "border-x",
|
|
5560
|
+
// enablePadding ? "hawa-p-4" : "hawa-p-0",
|
|
5561
|
+
// props.disablePadding ? "hawa-p-0" : "hawa-p-4",
|
|
5562
|
+
// props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4",
|
|
5563
|
+
"hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ", "[&:not(:last-child)&:not(:first-child)]:hawa-border-x", // "[&:not(:last-child)]:hawa-border-r",
|
|
5554
5564
|
props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r", className)
|
|
5555
5565
|
}, props));
|
|
5556
5566
|
});
|
|
@@ -5686,9 +5696,10 @@ var DataTable = function(_param) {
|
|
|
5686
5696
|
key: row.id,
|
|
5687
5697
|
"data-state": row.getIsSelected() && "selected"
|
|
5688
5698
|
}, row.getVisibleCells().map(function(cell) {
|
|
5699
|
+
var _cell_column_columnDef_meta;
|
|
5689
5700
|
return /* @__PURE__ */ React43.createElement(TableCell, {
|
|
5690
5701
|
dir: props.direction,
|
|
5691
|
-
|
|
5702
|
+
padding: props.condensed ? "condensed" : (_cell_column_columnDef_meta = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta === void 0 ? void 0 : _cell_column_columnDef_meta.padding,
|
|
5692
5703
|
key: cell.id
|
|
5693
5704
|
}, (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()));
|
|
5694
5705
|
}));
|
|
@@ -5702,7 +5713,7 @@ var DataTable = function(_param) {
|
|
|
5702
5713
|
}), props.showCount && /* @__PURE__ */ React43.createElement("div", {
|
|
5703
5714
|
className: "text-sm text-muted-foreground",
|
|
5704
5715
|
dir: props.direction
|
|
5705
|
-
}, /* @__PURE__ */ React43.createElement("span", null, (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.total), " ", /* @__PURE__ */ React43.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())), table.getPageCount()
|
|
5716
|
+
}, /* @__PURE__ */ React43.createElement("span", null, (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.total), " ", /* @__PURE__ */ React43.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())), table.getPageCount() > 1 && /* @__PURE__ */ React43.createElement("div", {
|
|
5706
5717
|
className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 "
|
|
5707
5718
|
}, enableGoTo && /* @__PURE__ */ React43.createElement("div", {
|
|
5708
5719
|
className: "hawa-flex hawa-flex-row hawa-justify-center hawa-items-center hawa-gap-2"
|
|
@@ -5827,7 +5838,7 @@ var SimpleTable = function(_param) {
|
|
|
5827
5838
|
className: cn("hawa-flex hawa-w-full hawa-flex-col hawa-gap-4", classNames)
|
|
5828
5839
|
}, props.isLoading ? /* @__PURE__ */ React44.createElement(Skeleton, {
|
|
5829
5840
|
className: "h-[130px] w-full"
|
|
5830
|
-
}) : /* @__PURE__ */ React44.createElement(
|
|
5841
|
+
}) : /* @__PURE__ */ React44.createElement("div", {
|
|
5831
5842
|
className: "hawa-rounded"
|
|
5832
5843
|
}, /* @__PURE__ */ React44.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React44.createElement(TableHeader, null, table.getHeaderGroups().map(function(headerGroup) {
|
|
5833
5844
|
return /* @__PURE__ */ React44.createElement(TableRow, {
|
|
@@ -5844,16 +5855,17 @@ var SimpleTable = function(_param) {
|
|
|
5844
5855
|
key: row.id,
|
|
5845
5856
|
"data-state": row.getIsSelected() && "selected"
|
|
5846
5857
|
}, row.getVisibleCells().map(function(cell) {
|
|
5858
|
+
var _cell_column_columnDef_meta;
|
|
5847
5859
|
return /* @__PURE__ */ React44.createElement(TableCell, {
|
|
5848
5860
|
dir: props.direction,
|
|
5849
|
-
|
|
5861
|
+
padding: props.condensed ? "condensed" : (_cell_column_columnDef_meta = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta === void 0 ? void 0 : _cell_column_columnDef_meta.padding,
|
|
5850
5862
|
key: cell.id
|
|
5851
5863
|
}, (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()));
|
|
5852
5864
|
}));
|
|
5853
5865
|
}) : /* @__PURE__ */ React44.createElement(TableRow, null, /* @__PURE__ */ React44.createElement(TableCell, {
|
|
5854
5866
|
colSpan: columns.length,
|
|
5855
5867
|
className: "hawa-h-24 hawa-text-center"
|
|
5856
|
-
}, (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.noData))))))
|
|
5868
|
+
}, (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.noData))))));
|
|
5857
5869
|
};
|
|
5858
5870
|
// components/elements/Accordion.tsx
|
|
5859
5871
|
var React45 = __toESM(require("react"));
|
package/dist/index.mjs
CHANGED
|
@@ -5158,7 +5158,7 @@ import {
|
|
|
5158
5158
|
|
|
5159
5159
|
// components/elements/Table.tsx
|
|
5160
5160
|
import * as React42 from "react";
|
|
5161
|
-
var Table = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React42.createElement("div", { className: "hawa-relative hawa-w-full
|
|
5161
|
+
var Table = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React42.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React42.createElement(
|
|
5162
5162
|
"table",
|
|
5163
5163
|
{
|
|
5164
5164
|
ref,
|
|
@@ -5225,22 +5225,32 @@ var TableRow = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5225
5225
|
));
|
|
5226
5226
|
TableRow.displayName = "TableRow";
|
|
5227
5227
|
var TableCell = React42.forwardRef(
|
|
5228
|
-
({ className, ...props }, ref) =>
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5228
|
+
({ className, enablePadding = true, padding = "default", ...props }, ref) => {
|
|
5229
|
+
let paddingStyles = {
|
|
5230
|
+
condensed: "hawa-p-0 hawa-px-4",
|
|
5231
|
+
default: "hawa-p-4",
|
|
5232
|
+
noPadding: "hawa-p-0"
|
|
5233
|
+
};
|
|
5234
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5235
|
+
"td",
|
|
5236
|
+
{
|
|
5237
|
+
ref,
|
|
5238
|
+
className: cn(
|
|
5239
|
+
paddingStyles[padding],
|
|
5240
|
+
// "border-x",
|
|
5241
|
+
// enablePadding ? "hawa-p-4" : "hawa-p-0",
|
|
5242
|
+
// props.disablePadding ? "hawa-p-0" : "hawa-p-4",
|
|
5243
|
+
// props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4",
|
|
5244
|
+
"hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ",
|
|
5245
|
+
"[&:not(:last-child)&:not(:first-child)]:hawa-border-x",
|
|
5246
|
+
// "[&:not(:last-child)]:hawa-border-r",
|
|
5247
|
+
props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
|
|
5248
|
+
className
|
|
5249
|
+
),
|
|
5250
|
+
...props
|
|
5251
|
+
}
|
|
5252
|
+
);
|
|
5253
|
+
}
|
|
5244
5254
|
);
|
|
5245
5255
|
TableCell.displayName = "TableCell";
|
|
5246
5256
|
var TableCaption = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React42.createElement(
|
|
@@ -5388,7 +5398,7 @@ var DataTable = ({
|
|
|
5388
5398
|
TableCell,
|
|
5389
5399
|
{
|
|
5390
5400
|
dir: props.direction,
|
|
5391
|
-
|
|
5401
|
+
padding: props.condensed ? "condensed" : cell.column.columnDef.meta?.padding,
|
|
5392
5402
|
key: cell.id
|
|
5393
5403
|
},
|
|
5394
5404
|
flexRender(
|
|
@@ -5413,7 +5423,7 @@ var DataTable = ({
|
|
|
5413
5423
|
/* @__PURE__ */ React43.createElement("span", null, props.texts?.total),
|
|
5414
5424
|
" ",
|
|
5415
5425
|
/* @__PURE__ */ React43.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
|
|
5416
|
-
), table.getPageCount()
|
|
5426
|
+
), table.getPageCount() > 1 && /* @__PURE__ */ React43.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React43.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-items-center hawa-gap-2" }, /* @__PURE__ */ React43.createElement("span", { className: "hawa-text-sm" }, props.texts?.goTo), /* @__PURE__ */ React43.createElement(
|
|
5417
5427
|
"input",
|
|
5418
5428
|
{
|
|
5419
5429
|
max: table.getPageCount(),
|
|
@@ -5542,7 +5552,7 @@ var SimpleTable = ({
|
|
|
5542
5552
|
classNames
|
|
5543
5553
|
)
|
|
5544
5554
|
},
|
|
5545
|
-
props.isLoading ? /* @__PURE__ */ React44.createElement(Skeleton, { className: "h-[130px] w-full" }) : /* @__PURE__ */ React44.createElement(
|
|
5555
|
+
props.isLoading ? /* @__PURE__ */ React44.createElement(Skeleton, { className: "h-[130px] w-full" }) : /* @__PURE__ */ React44.createElement("div", { className: "hawa-rounded" }, /* @__PURE__ */ React44.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React44.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React44.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
|
5546
5556
|
return /* @__PURE__ */ React44.createElement(
|
|
5547
5557
|
TableHead,
|
|
5548
5558
|
{
|
|
@@ -5565,7 +5575,7 @@ var SimpleTable = ({
|
|
|
5565
5575
|
TableCell,
|
|
5566
5576
|
{
|
|
5567
5577
|
dir: props.direction,
|
|
5568
|
-
|
|
5578
|
+
padding: props.condensed ? "condensed" : cell.column.columnDef.meta?.padding,
|
|
5569
5579
|
key: cell.id
|
|
5570
5580
|
},
|
|
5571
5581
|
flexRender2(
|
|
@@ -5580,7 +5590,7 @@ var SimpleTable = ({
|
|
|
5580
5590
|
className: "hawa-h-24 hawa-text-center"
|
|
5581
5591
|
},
|
|
5582
5592
|
props.texts?.noData
|
|
5583
|
-
)))))
|
|
5593
|
+
)))))
|
|
5584
5594
|
);
|
|
5585
5595
|
};
|
|
5586
5596
|
|