@loja-integrada/admin-components 0.12.6 → 0.13.0
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/Components/Button/Button.d.ts +5 -0
- package/dist/Components/Button/Button.stories.d.ts +1 -0
- package/dist/Icons/icons-path/Back.d.ts +2 -0
- package/dist/Icons/icons-path/HalfBack.d.ts +2 -0
- package/dist/Icons/icons-path/MoneyBill.d.ts +2 -0
- package/dist/Icons/icons-path/index.d.ts +3 -0
- package/dist/Layout/Box/Box.d.ts +4 -0
- package/dist/Navigation/Breadcrumb/Breadcrumb.stories.d.ts +4 -0
- package/dist/Navigation/Breadcrumb/index.d.ts +17 -0
- package/dist/admin-components.cjs.development.js +74 -18
- 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 +74 -18
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Components/Button/Button.spec.tsx +4 -0
- package/src/Components/Button/Button.stories.tsx +6 -0
- package/src/Components/Button/Button.tsx +19 -2
- package/src/Icons/Icon.stories.tsx +6 -4
- package/src/Icons/icons-path/Back.tsx +5 -0
- package/src/Icons/icons-path/HalfBack.tsx +12 -0
- package/src/Icons/icons-path/MoneyBill.tsx +9 -0
- package/src/Icons/icons-path/index.ts +6 -0
- package/src/Layout/Box/Box.tsx +7 -0
- package/src/Layout/Sidebar/Sidebar.tsx +2 -2
- package/src/Navigation/Breadcrumb/Breadcrumb.spec.tsx +23 -1
- package/src/Navigation/Breadcrumb/Breadcrumb.stories.tsx +39 -0
- package/src/Navigation/Breadcrumb/index.tsx +81 -15
- package/src/Navigation/Pagination/PaginationNav.tsx +3 -0
- package/src/Components/Button/Button.test.tsx +0 -31
|
@@ -28,6 +28,11 @@ export interface ButtonProps extends ButtonAnchorProps {
|
|
|
28
28
|
* Icon of the button
|
|
29
29
|
*/
|
|
30
30
|
icon?: IconProps['icon'];
|
|
31
|
+
/**
|
|
32
|
+
* Icon of the button
|
|
33
|
+
* @default 'right'
|
|
34
|
+
*/
|
|
35
|
+
iconPosition?: 'left' | 'right';
|
|
31
36
|
/**
|
|
32
37
|
* React children
|
|
33
38
|
* Also support render prop
|
|
@@ -8,3 +8,4 @@ export declare const Action: import("@storybook/csf").AnnotatedStoryFn<import("@
|
|
|
8
8
|
export declare const Disabled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
9
9
|
export declare const Loading: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
10
10
|
export declare const WithLink: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
11
|
+
export declare const WithIcon: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps>;
|
|
@@ -9,6 +9,7 @@ export declare const icons: {
|
|
|
9
9
|
arrowLeft: () => JSX.Element;
|
|
10
10
|
arrowRight: () => JSX.Element;
|
|
11
11
|
sortDown: () => JSX.Element;
|
|
12
|
+
back: () => JSX.Element;
|
|
12
13
|
ban: () => JSX.Element;
|
|
13
14
|
barcodeRead: () => JSX.Element;
|
|
14
15
|
bell: () => JSX.Element;
|
|
@@ -29,8 +30,10 @@ export declare const icons: {
|
|
|
29
30
|
exclamationCircle: () => JSX.Element;
|
|
30
31
|
exclamationTriangle: () => JSX.Element;
|
|
31
32
|
externalLink: () => JSX.Element;
|
|
33
|
+
halfBack: () => JSX.Element;
|
|
32
34
|
home: () => JSX.Element;
|
|
33
35
|
image: () => JSX.Element;
|
|
36
|
+
moneyBill: () => JSX.Element;
|
|
34
37
|
move: () => JSX.Element;
|
|
35
38
|
order: () => JSX.Element;
|
|
36
39
|
pagali: () => JSX.Element;
|
package/dist/Layout/Box/Box.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("
|
|
|
5
5
|
export declare const NoPrevious: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
6
6
|
export declare const WithPrevious: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
7
7
|
export declare const WithPreviousCustom: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
8
|
+
export declare const WithoutPreviousTitle: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
9
|
+
export declare const WithMobileCenter: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
10
|
+
export declare const WithHelp: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
11
|
+
export declare const WithActions: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, BreadcrumbProps>;
|
|
@@ -22,4 +22,21 @@ export interface BreadcrumbProps {
|
|
|
22
22
|
* Example: `const Link = (props: any) => { return <a href="https://www.google.com" target="_blank" className={`underline ` + props.className}>{props.children}</a> }`
|
|
23
23
|
* */
|
|
24
24
|
Link?: React.ElementType;
|
|
25
|
+
/**
|
|
26
|
+
* Aligment of `currentTitle` at mobile
|
|
27
|
+
* @default 'left'
|
|
28
|
+
* */
|
|
29
|
+
mobileAlign?: 'left' | 'center';
|
|
30
|
+
/**
|
|
31
|
+
* Help link (external page)
|
|
32
|
+
* */
|
|
33
|
+
help?: {
|
|
34
|
+
title?: string;
|
|
35
|
+
href: string;
|
|
36
|
+
mobileText?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Custom actions and buttons
|
|
40
|
+
* */
|
|
41
|
+
actions?: React.ReactNode;
|
|
25
42
|
}
|
|
@@ -122,6 +122,12 @@ var ArrowRight = function ArrowRight() {
|
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
+
var Back = function Back() {
|
|
126
|
+
return React__default.createElement("path", {
|
|
127
|
+
d: "M5.5495 4.26c.282-.303.265-.777-.039-1.06-.304-.281-.778-.264-1.061.039l-3.25 3.5c-.266.289-.266.734 0 1.021l3.25 3.5c.149.159.349.24.55.24.183 0 .366-.066.511-.2.304-.282.321-.757.039-1.061L3.4695 8H13V6.5H3.4695l2.08-2.24ZM13 6.5V8c.5926-.00007 1.1679.22038 1.6206.60807.4916.42109.8001 1.01704.8599 1.66163.0599.6445-.1335 1.2871-.5393 1.7915-.4057.5044-.9918.8311-1.6342.9108l.1858 1.4976c1.0316-.1281 1.9728-.6526 2.6243-1.4626.6515-.81.9621-1.8418.866-2.8769-.0962-1.03499-.5914-1.99196-1.3809-2.66814C14.8753 6.83943 13.9516 6.49992 13 6.5Z"
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
125
131
|
var Ban = function Ban() {
|
|
126
132
|
return React__default.createElement("path", {
|
|
127
133
|
fillRule: "evenodd",
|
|
@@ -282,6 +288,16 @@ var ExternalLink = function ExternalLink() {
|
|
|
282
288
|
});
|
|
283
289
|
};
|
|
284
290
|
|
|
291
|
+
var HalfBack = function HalfBack() {
|
|
292
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("path", {
|
|
293
|
+
fillRule: "evenodd",
|
|
294
|
+
clipRule: "evenodd",
|
|
295
|
+
d: "m15.8384 13.3186-.0174-.0196-.9881-1.1119c.0374-.0406.0735-.0826.1083-.1259.4058-.5044.5992-1.1469.5393-1.7915-.0598-.64458-.3683-1.24053-.8599-1.66162-.4527-.38769-1.028-.60814-1.6206-.60807h-1.8884l-1.33319-1.5H13c.9516-.00008 1.8753.33943 2.6022.96196.7895.67618 1.2847 1.63314 1.3809 2.66823.0961 1.035-.2145 2.0668-.866 2.8768-.0878.1091-.1808.2131-.2787.3116Zm-1.2441.85c-.3479.1512-.7185.2534-1.1015.301l-.1858-1.4976c.0657-.0081.1308-.0188.1951-.0321l1.0922 1.2287ZM9.11111 8.00001l-1.33333-1.5H3.4695l2.08-2.24c.04231-.04545.07788-.09476.10677-.14669l-.9404-1.05796c-.0981.03985-.18931.10115-.26637.18365l-3.25 3.5c-.266.289-.266.734 0 1.021l3.25 3.49999c.149.159.349.24.55.24.183 0 .366-.066.511-.2.304-.282.321-.757.039-1.061l-2.08-2.23899h5.64161Z"
|
|
296
|
+
}), React__default.createElement("path", {
|
|
297
|
+
d: "m14.366 13.912-.545-.613-2.476-2.786-5.289-5.951-2.028-2.281L2 0H0l2.02756 2.281L16 18h2l-3.634-4.088Z"
|
|
298
|
+
}));
|
|
299
|
+
};
|
|
300
|
+
|
|
285
301
|
var Home = function Home() {
|
|
286
302
|
return React__default.createElement("path", {
|
|
287
303
|
fillRule: "evenodd",
|
|
@@ -298,6 +314,14 @@ var Image = function Image() {
|
|
|
298
314
|
});
|
|
299
315
|
};
|
|
300
316
|
|
|
317
|
+
var MoneyBill = function MoneyBill() {
|
|
318
|
+
return React__default.createElement("path", {
|
|
319
|
+
fillRule: "evenodd",
|
|
320
|
+
d: "M3.245 12.2h11.51a1.995 1.995 0 0 1 1.945-1.945v-6.51A1.995 1.995 0 0 1 14.755 1.8H3.245A1.995 1.995 0 0 1 1.3 3.745v6.51A1.995 1.995 0 0 1 3.245 12.2ZM18 2v10a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 0 12V2A1.5 1.5 0 0 1 1.5.5h15A1.5 1.5 0 0 1 18 2Zm-6.5 5c0 2-1 3-2.5 3S6.5 9 6.5 7s1-3 2.5-3 2.5 1 2.5 3Z",
|
|
321
|
+
clipRule: "evenodd"
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
|
|
301
325
|
var Move = function Move() {
|
|
302
326
|
return React__default.createElement("path", {
|
|
303
327
|
fillRule: "evenodd",
|
|
@@ -523,6 +547,7 @@ var icons = {
|
|
|
523
547
|
arrowLeft: ArrowLeft,
|
|
524
548
|
arrowRight: ArrowRight,
|
|
525
549
|
sortDown: SortDown,
|
|
550
|
+
back: Back,
|
|
526
551
|
ban: Ban,
|
|
527
552
|
barcodeRead: BarcodeRead,
|
|
528
553
|
bell: Bell,
|
|
@@ -543,8 +568,10 @@ var icons = {
|
|
|
543
568
|
exclamationCircle: ExclamationCircle,
|
|
544
569
|
exclamationTriangle: ExclamationTriangle,
|
|
545
570
|
externalLink: ExternalLink,
|
|
571
|
+
halfBack: HalfBack,
|
|
546
572
|
home: Home,
|
|
547
573
|
image: Image,
|
|
574
|
+
moneyBill: MoneyBill,
|
|
548
575
|
move: Move,
|
|
549
576
|
order: Order,
|
|
550
577
|
pagali: Pagali,
|
|
@@ -689,7 +716,9 @@ var ButtonComponent = function ButtonComponent(_ref2, ref) {
|
|
|
689
716
|
onClick = _ref2.onClick,
|
|
690
717
|
_ref2$size = _ref2.size,
|
|
691
718
|
size = _ref2$size === void 0 ? 'default' : _ref2$size,
|
|
692
|
-
|
|
719
|
+
_ref2$iconPosition = _ref2.iconPosition,
|
|
720
|
+
iconPosition = _ref2$iconPosition === void 0 ? 'right' : _ref2$iconPosition,
|
|
721
|
+
props = _objectWithoutPropertiesLoose(_ref2, ["children", "loading", "variant", "fullWidth", "icon", "disabled", "className", "onClick", "size", "iconPosition"]);
|
|
693
722
|
|
|
694
723
|
var handleClick = function handleClick(event) {
|
|
695
724
|
(!disabled || !loading) && onClick && onClick(event);
|
|
@@ -714,9 +743,13 @@ var ButtonComponent = function ButtonComponent(_ref2, ref) {
|
|
|
714
743
|
className: classes,
|
|
715
744
|
disabled: disabled,
|
|
716
745
|
onClick: handleClick
|
|
717
|
-
}, props),
|
|
746
|
+
}, props), currentIcon && iconPosition === 'left' && React__default.createElement(Icon, {
|
|
718
747
|
icon: currentIcon,
|
|
719
|
-
size: 4,
|
|
748
|
+
size: size === 'small' ? 3 : 4,
|
|
749
|
+
className: "mr-2 inline-block"
|
|
750
|
+
}), children, currentIcon && iconPosition === 'right' && React__default.createElement(Icon, {
|
|
751
|
+
icon: currentIcon,
|
|
752
|
+
size: size === 'small' ? 3 : 4,
|
|
720
753
|
className: "ml-3 inline-block"
|
|
721
754
|
}));
|
|
722
755
|
};
|
|
@@ -2637,7 +2670,8 @@ var Box = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2637
2670
|
_this$props$variant = _this$props.variant,
|
|
2638
2671
|
variant = _this$props$variant === void 0 ? 'default' : _this$props$variant,
|
|
2639
2672
|
_this$props$isToggle = _this$props.isToggle,
|
|
2640
|
-
isToggle = _this$props$isToggle === void 0 ? false : _this$props$isToggle
|
|
2673
|
+
isToggle = _this$props$isToggle === void 0 ? false : _this$props$isToggle,
|
|
2674
|
+
id = _this$props.id;
|
|
2641
2675
|
|
|
2642
2676
|
var toggleContent = function toggleContent(value) {
|
|
2643
2677
|
return _this2.setState({
|
|
@@ -2659,7 +2693,8 @@ var Box = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2659
2693
|
didUpdate: toggleContent
|
|
2660
2694
|
}), React__default.createElement("div", {
|
|
2661
2695
|
className: "box w-full flex flex-col bg-base-1 border border-card-stroke rounded " + className,
|
|
2662
|
-
"data-opened": isOpen
|
|
2696
|
+
"data-opened": isOpen,
|
|
2697
|
+
id: id
|
|
2663
2698
|
}, children));
|
|
2664
2699
|
};
|
|
2665
2700
|
|
|
@@ -2886,14 +2921,20 @@ var Breadcrumb = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
2886
2921
|
currentTitle = _ref.currentTitle,
|
|
2887
2922
|
previousTitle = _ref.previousTitle,
|
|
2888
2923
|
previousHref = _ref.previousHref,
|
|
2924
|
+
_ref$mobileAlign = _ref.mobileAlign,
|
|
2925
|
+
mobileAlign = _ref$mobileAlign === void 0 ? 'left' : _ref$mobileAlign,
|
|
2926
|
+
help = _ref.help,
|
|
2927
|
+
actions = _ref.actions,
|
|
2889
2928
|
_ref$className = _ref.className,
|
|
2890
2929
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
2891
2930
|
var renderPrevTitle = React__default.createElement("span", {
|
|
2892
|
-
className: "hidden lg:inline"
|
|
2931
|
+
className: "hidden lg:inline truncate"
|
|
2893
2932
|
}, previousTitle);
|
|
2894
2933
|
var renderPrevIcon = React__default.createElement(Icon, {
|
|
2895
2934
|
icon: "arrowLeft",
|
|
2896
|
-
|
|
2935
|
+
size: 4,
|
|
2936
|
+
className: "inline-flex mr-3 -mt-1",
|
|
2937
|
+
block: true
|
|
2897
2938
|
});
|
|
2898
2939
|
|
|
2899
2940
|
var renderPrevLink = function renderPrevLink() {
|
|
@@ -2920,24 +2961,36 @@ var Breadcrumb = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
2920
2961
|
|
|
2921
2962
|
return React__default.createElement("div", {
|
|
2922
2963
|
"aria-label": "breadcrumbs",
|
|
2923
|
-
className: "header-navigation flex
|
|
2964
|
+
className: "header-navigation flex items-center justify-between mb-4 lg:mb-7 " + className
|
|
2924
2965
|
}, React__default.createElement("div", {
|
|
2925
|
-
className: "header-navigation-breadcrumb max-w-full truncate"
|
|
2966
|
+
className: "header-navigation-breadcrumb max-w-full truncate w-full"
|
|
2926
2967
|
}, React__default.createElement("div", {
|
|
2927
|
-
className: "inline-flex self-center items-center font-semibold tracking-5 text-f5 sm:text-f4 lg:text-f3"
|
|
2928
|
-
}, previousTitle && React__default.createElement("span", {
|
|
2929
|
-
className: "header-navigation-previous inline-flex items-center text-on-base-2 text-xl -mr-px"
|
|
2930
|
-
}, renderPrevLink(), React__default.createElement("span", {
|
|
2968
|
+
className: "w-full inline-flex self-center items-center font-semibold tracking-5 text-f5 sm:text-f4 lg:text-f3"
|
|
2969
|
+
}, (previousTitle || previousHref) && React__default.createElement("span", {
|
|
2970
|
+
className: "header-navigation-previous inline-flex items-center text-on-base-2 text-xl -mr-px truncate"
|
|
2971
|
+
}, renderPrevLink(), previousTitle && React__default.createElement("span", {
|
|
2931
2972
|
className: "hidden lg:inline px-2 -ml-px"
|
|
2932
2973
|
}, " / ")), React__default.createElement("span", {
|
|
2933
|
-
className: "header-navigation-current text-on-base"
|
|
2974
|
+
className: "header-navigation-current text-on-base truncate " + (mobileAlign === 'center' ? 'w-full lg:w-auto text-center lg:text-left' : '')
|
|
2934
2975
|
}, currentTitle))), React__default.createElement("div", {
|
|
2935
|
-
className: "header-navigation-content flex items-center flex-grow justify-end"
|
|
2976
|
+
className: "header-navigation-content flex shrink-0 max-w-1/2 items-center flex-grow justify-end gap-5 ml-2 whitespace-nowrap"
|
|
2936
2977
|
}, React__default.createElement("div", {
|
|
2937
2978
|
className: "header-navigation-help help flex items-center"
|
|
2938
|
-
}
|
|
2939
|
-
|
|
2940
|
-
|
|
2979
|
+
}, help && React__default.createElement("a", {
|
|
2980
|
+
href: help.href,
|
|
2981
|
+
target: "_blank",
|
|
2982
|
+
rel: "noreferrer",
|
|
2983
|
+
className: "flex p-1 pr-0 text-on-base-2 hover:text-on-base duration-200 transition-colors items-center"
|
|
2984
|
+
}, React__default.createElement(Icon, {
|
|
2985
|
+
icon: "questionCircle",
|
|
2986
|
+
size: 4,
|
|
2987
|
+
className: "shrink-0",
|
|
2988
|
+
block: true
|
|
2989
|
+
}), help.title && React__default.createElement("span", {
|
|
2990
|
+
className: "text-f6 font-semibold tracking-4 leading-6 ml-2 " + (!help.mobileText ? 'hidden md:inline' : '')
|
|
2991
|
+
}, help.title))), actions && React__default.createElement("div", {
|
|
2992
|
+
className: "header-navigation-actions flex items-center gap-5"
|
|
2993
|
+
}, actions)));
|
|
2941
2994
|
});
|
|
2942
2995
|
|
|
2943
2996
|
var PaginationInfoComponent = function PaginationInfoComponent(_ref) {
|
|
@@ -3039,6 +3092,7 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
3039
3092
|
onCut: onPreventDefault,
|
|
3040
3093
|
onPaste: onPreventDefault
|
|
3041
3094
|
}, currentPage), ' ', "/", ' ', React__default.createElement("button", {
|
|
3095
|
+
type: "button",
|
|
3042
3096
|
id: "btnPaginationLastPage",
|
|
3043
3097
|
className: "pagination-nav-total focus:outline-none",
|
|
3044
3098
|
onClick: function onClick() {
|
|
@@ -3047,6 +3101,7 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
3047
3101
|
}, maxTotalPages)), React__default.createElement("div", {
|
|
3048
3102
|
className: "text-inverted-2 ml-5 flex items-center"
|
|
3049
3103
|
}, React__default.createElement("button", {
|
|
3104
|
+
type: "button",
|
|
3050
3105
|
id: "btnPaginationPrev",
|
|
3051
3106
|
className: "pagination-nav-previous mr-3 duration-200 outline-none " + (hasPrev ? 'hover:text-inverted-1' : ''),
|
|
3052
3107
|
"aria-label": "Ir para p\xE1gina anterior",
|
|
@@ -3058,6 +3113,7 @@ var PaginationNavComponent = function PaginationNavComponent(_ref) {
|
|
|
3058
3113
|
block: true,
|
|
3059
3114
|
size: 4
|
|
3060
3115
|
})), React__default.createElement("button", {
|
|
3116
|
+
type: "button",
|
|
3061
3117
|
id: "btnPaginationNext",
|
|
3062
3118
|
className: "pagination-nav-next duration-200 outline-none " + (hasNext ? 'hover:text-inverted-1' : ''),
|
|
3063
3119
|
"aria-label": "Ir para pr\xF3xima p\xE1gina",
|