@loja-integrada/admin-components 0.9.1 → 0.9.5
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/Forms/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Icons/icons-path/Image.d.ts +2 -0
- package/dist/Icons/icons-path/Move.d.ts +2 -0
- package/dist/Icons/icons-path/index.d.ts +2 -0
- package/dist/admin-components.cjs.development.js +41 -11
- package/dist/admin-components.cjs.development.js.map +1 -1
- package/dist/admin-components.cjs.production.min.js +1 -1
- package/dist/admin-components.cjs.production.min.js.map +1 -1
- package/dist/admin-components.esm.js +41 -11
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Components/LoadingPlaceholder/LoadingPlaceholder.tsx +1 -1
- package/src/Components/Table/Table.tsx +9 -5
- package/src/Components/Tabs/TabsItem.tsx +2 -1
- package/src/Forms/Checkbox/Checkbox.tsx +15 -8
- package/src/Icons/icons-path/Image.tsx +9 -0
- package/src/Icons/icons-path/Move.tsx +9 -0
- package/src/Icons/icons-path/index.ts +4 -0
- package/src/Layout/ActionBar/ActionBar.stories.tsx +8 -7
- package/src/Layout/ActionBar/ActionBar.tsx +19 -16
- package/src/Navigation/Pagination/PaginationInfo.tsx +1 -0
- package/src/Navigation/Pagination/PaginationNav.tsx +6 -2
|
@@ -28,6 +28,8 @@ export declare const icons: {
|
|
|
28
28
|
exclamationTriangle: () => JSX.Element;
|
|
29
29
|
externalLink: () => JSX.Element;
|
|
30
30
|
home: () => JSX.Element;
|
|
31
|
+
image: () => JSX.Element;
|
|
32
|
+
move: () => JSX.Element;
|
|
31
33
|
order: () => JSX.Element;
|
|
32
34
|
pagali: () => JSX.Element;
|
|
33
35
|
paperList: () => JSX.Element;
|
|
@@ -274,6 +274,22 @@ var Home = function Home() {
|
|
|
274
274
|
});
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
+
var Image = function Image() {
|
|
278
|
+
return React__default.createElement("path", {
|
|
279
|
+
fillRule: "evenodd",
|
|
280
|
+
d: "M10.5 5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm5.5 7.5H2a.5.5 0 0 1-.5-.5v-.937L5.176 8.39a2.247 2.247 0 0 1 2.647 0l2.188 1.59a3.759 3.759 0 0 0 4.027.246L16.5 8.857V12a.5.5 0 0 1-.5.5ZM2 1.5h14a.5.5 0 0 1 .5.5v5.261a.704.704 0 0 0-.364.084l-2.827 1.57a2.258 2.258 0 0 1-2.416-.147L8.706 7.177a3.743 3.743 0 0 0-4.412 0L1.5 9.209V2a.5.5 0 0 1 .5-.5ZM16 0H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Z",
|
|
281
|
+
clipRule: "evenodd"
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var Move = function Move() {
|
|
286
|
+
return React__default.createElement("path", {
|
|
287
|
+
fillRule: "evenodd",
|
|
288
|
+
d: "M9.5 14c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm-6 0c0-.828-.671-1.5-1.5-1.5S.5 13.172.5 14s.671 1.5 1.5 1.5 1.5-.672 1.5-1.5zm6-12C9.5 1.172 8.828.5 8 .5S6.5 1.172 6.5 2 7.172 3.5 8 3.5 9.5 2.828 9.5 2zm-6 0C3.5 1.172 2.829.5 2 .5S.5 1.172.5 2 1.171 3.5 2 3.5 3.5 2.828 3.5 2zm6 6c0-.828-.672-1.5-1.5-1.5S6.5 7.172 6.5 8 7.172 9.5 8 9.5 9.5 8.828 9.5 8zM2 9.5C1.171 9.5.5 8.828.5 8S1.171 6.5 2 6.5s1.5.672 1.5 1.5S2.829 9.5 2 9.5z",
|
|
289
|
+
clipRule: "evenodd"
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
|
|
277
293
|
var Order = function Order() {
|
|
278
294
|
return React__default.createElement("path", {
|
|
279
295
|
fillRule: "evenodd",
|
|
@@ -502,6 +518,8 @@ var icons = {
|
|
|
502
518
|
exclamationTriangle: ExclamationTriangle,
|
|
503
519
|
externalLink: ExternalLink,
|
|
504
520
|
home: Home,
|
|
521
|
+
image: Image,
|
|
522
|
+
move: Move,
|
|
505
523
|
order: Order,
|
|
506
524
|
pagali: Pagali,
|
|
507
525
|
paperList: PaperList,
|
|
@@ -669,7 +687,7 @@ var LoadingPlaceholderComponent = function LoadingPlaceholderComponent(_ref) {
|
|
|
669
687
|
return React__default.createElement("div", {
|
|
670
688
|
className: "animate-pulse flex " + className
|
|
671
689
|
}, React__default.createElement("div", {
|
|
672
|
-
className: "h-4 bg-inverted-2 bg-opacity-20 rounded w-
|
|
690
|
+
className: "h-4 bg-inverted-2 bg-opacity-20 rounded w-full max-w-full"
|
|
673
691
|
}));
|
|
674
692
|
};
|
|
675
693
|
|
|
@@ -1578,7 +1596,9 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1578
1596
|
checked = _ref.checked,
|
|
1579
1597
|
disabled = _ref.disabled,
|
|
1580
1598
|
indeterminate = _ref.indeterminate,
|
|
1581
|
-
|
|
1599
|
+
_ref$boxAlign = _ref.boxAlign,
|
|
1600
|
+
boxAlign = _ref$boxAlign === void 0 ? 'center' : _ref$boxAlign,
|
|
1601
|
+
props = _objectWithoutPropertiesLoose(_ref, ["label", "id", "name", "onChange", "checked", "disabled", "indeterminate", "boxAlign"]);
|
|
1582
1602
|
|
|
1583
1603
|
var inputRef = React__default.useRef(null);
|
|
1584
1604
|
var inputId = id || name;
|
|
@@ -1591,6 +1611,7 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1591
1611
|
isIndeterminate = _React$useState2[0],
|
|
1592
1612
|
setIsIndeterminate = _React$useState2[1];
|
|
1593
1613
|
|
|
1614
|
+
var isCenterBoxAlign = boxAlign === 'center';
|
|
1594
1615
|
React__default.useEffect(function () {
|
|
1595
1616
|
setIsChecked(!!checked);
|
|
1596
1617
|
if (checked) setIsIndeterminate(false);
|
|
@@ -1609,11 +1630,11 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1609
1630
|
};
|
|
1610
1631
|
|
|
1611
1632
|
var checkboxIconClasses = "transition duration-200 ease-in-out " + (isChecked || isIndeterminate ? 'scale-100' : 'scale-0');
|
|
1612
|
-
var checkboxIconContainerClasses = "border border-card-stroke transition duration-200 ease-in-out
|
|
1633
|
+
var checkboxIconContainerClasses = "border border-card-stroke transition duration-200 ease-in-out\n " + (disabled ? 'bg-base-4' : isChecked || isIndeterminate ? 'bg-primary border-primary' : 'bg-base-1') + "\n " + (isCenterBoxAlign ? 'items-center' : '') + "\n rounded w-4 h-4 flex justify-center m-px\n ";
|
|
1613
1634
|
var checkboxLabelClasses = "ml-1 input-label text-f6 tracking-4 leading-6 " + (disabled ? 'text-inverted-2' : '');
|
|
1614
1635
|
return React__default.createElement("label", {
|
|
1615
1636
|
htmlFor: inputId,
|
|
1616
|
-
className: "inline-flex items-
|
|
1637
|
+
className: "inline-flex items-" + boxAlign + " cursor-pointer"
|
|
1617
1638
|
}, React__default.createElement("span", {
|
|
1618
1639
|
className: "rounded z-50 flex items-center justify-center focus-within:ring-2 ring-focus"
|
|
1619
1640
|
}, React__default.createElement("input", Object.assign({
|
|
@@ -1828,10 +1849,12 @@ var TableComponent = function TableComponent(_ref2) {
|
|
|
1828
1849
|
}));
|
|
1829
1850
|
})), React__default.createElement("tbody", Object.assign({}, getTableBodyProps(), {
|
|
1830
1851
|
className: "text-sm text-on-base"
|
|
1831
|
-
}), isLoading ? React__default.createElement("tr", null,
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1852
|
+
}), isLoading ? React__default.createElement("tr", null, Array(columnsLength).fill(0).map(function (key) {
|
|
1853
|
+
return React__default.createElement("td", {
|
|
1854
|
+
key: key,
|
|
1855
|
+
className: "" + TdClasses
|
|
1856
|
+
}, React__default.createElement(TdWrapper, null, React__default.createElement(LoadingPlaceholder, null)));
|
|
1857
|
+
})) : !rows || !rows.length ? React__default.createElement("tr", null, React__default.createElement("td", {
|
|
1835
1858
|
colSpan: columnsLength || 1,
|
|
1836
1859
|
className: "" + TdClasses
|
|
1837
1860
|
}, React__default.createElement(TdWrapper, null, React__default.createElement("div", {
|
|
@@ -1890,12 +1913,13 @@ var TabsItem = function TabsItem(_ref) {
|
|
|
1890
1913
|
active = _ref$active === void 0 ? false : _ref$active,
|
|
1891
1914
|
onChange = _ref.onChange;
|
|
1892
1915
|
return React__default.createElement("button", {
|
|
1916
|
+
id: "btnTab" + id,
|
|
1893
1917
|
className: "tabs-item " + (active ? 'tabs-item-active' : '') + " group min-w-0 flex-shrink-0 overflow-x-hidden px-2 last:-mr-2 first:-ml-2",
|
|
1894
1918
|
onClick: function onClick() {
|
|
1895
1919
|
return onChange(id);
|
|
1896
1920
|
}
|
|
1897
1921
|
}, React__default.createElement("span", {
|
|
1898
|
-
className: "block text-f6 text-sm py-4 border-b-4 break-words group-hover:font-semibold " + activeStyles(active) + " " + boldFixStyle,
|
|
1922
|
+
className: "block text-f6 tracking-4 text-sm py-4 border-b-4 break-words group-hover:font-semibold " + activeStyles(active) + " " + boldFixStyle,
|
|
1899
1923
|
"data-title": title
|
|
1900
1924
|
}, title));
|
|
1901
1925
|
};
|
|
@@ -2685,6 +2709,7 @@ var ActionBarComponent = function ActionBarComponent(_ref) {
|
|
|
2685
2709
|
className: "lg:hidden"
|
|
2686
2710
|
}, React__default.Children.map(children, function (_ref3) {
|
|
2687
2711
|
var props = _ref3.props;
|
|
2712
|
+
if (!props.children) return;
|
|
2688
2713
|
return React__default.createElement("button", {
|
|
2689
2714
|
className: 'px-4 py-1 text-base-1' + (props != null && props.loading ? ' pointer-events-none' : ''),
|
|
2690
2715
|
onClick: props == null ? void 0 : props.onClick
|
|
@@ -2803,6 +2828,7 @@ var PaginationInfoComponent = function PaginationInfoComponent(_ref) {
|
|
|
2803
2828
|
}, React__default.createElement("div", {
|
|
2804
2829
|
className: "flex items-center mr-5 text-inverted-2 tracking-4 text-f6"
|
|
2805
2830
|
}, itemsLengthOptions ? React__default.createElement(Select, {
|
|
2831
|
+
id: "selectItemsPerPage",
|
|
2806
2832
|
options: itemsLengthOptions,
|
|
2807
2833
|
withoutStyle: true,
|
|
2808
2834
|
"aria-label": "Itens por p\xE1gina",
|
|
@@ -2872,6 +2898,7 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
2872
2898
|
}, React__default.createElement("div", {
|
|
2873
2899
|
className: "text-inverted-2 text-f6 tracking-4"
|
|
2874
2900
|
}, React__default.createElement("span", {
|
|
2901
|
+
id: "btnPaginationActualPage",
|
|
2875
2902
|
className: "pagination-nav-current text-primary font-semibold",
|
|
2876
2903
|
ref: inputEl,
|
|
2877
2904
|
contentEditable: true,
|
|
@@ -2881,6 +2908,7 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
2881
2908
|
onCut: onPreventDefault,
|
|
2882
2909
|
onPaste: onPreventDefault
|
|
2883
2910
|
}, currentPage), ' ', "/", ' ', React__default.createElement("button", {
|
|
2911
|
+
id: "btnPaginationLastPage",
|
|
2884
2912
|
className: "pagination-nav-total focus:outline-none",
|
|
2885
2913
|
onClick: function onClick() {
|
|
2886
2914
|
if (currentPage !== maxTotalPages) handleChange(maxTotalPages);
|
|
@@ -2888,7 +2916,8 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
2888
2916
|
}, maxTotalPages)), React__default.createElement("div", {
|
|
2889
2917
|
className: "text-inverted-2 ml-5 flex items-center"
|
|
2890
2918
|
}, React__default.createElement("button", {
|
|
2891
|
-
|
|
2919
|
+
id: "btnPaginationPrev",
|
|
2920
|
+
className: "pagination-nav-previous mr-3 duration-200 outline-none " + (hasPrev ? 'hover:text-inverted-1' : ''),
|
|
2892
2921
|
"aria-label": "Ir para p\xE1gina anterior",
|
|
2893
2922
|
onClick: function onClick() {
|
|
2894
2923
|
if (hasPrev) handleChange(currentPage - 1);
|
|
@@ -2898,7 +2927,8 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
2898
2927
|
block: true,
|
|
2899
2928
|
size: 4
|
|
2900
2929
|
})), React__default.createElement("button", {
|
|
2901
|
-
|
|
2930
|
+
id: "btnPaginationNext",
|
|
2931
|
+
className: "pagination-nav-next duration-200 outline-none " + (hasNext ? 'hover:text-inverted-1' : ''),
|
|
2902
2932
|
"aria-label": "Ir para pr\xF3xima p\xE1gina",
|
|
2903
2933
|
onClick: function onClick() {
|
|
2904
2934
|
if (hasNext) handleChange(currentPage + 1);
|