@loja-integrada/admin-components 0.12.8 → 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/index.d.ts +2 -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 +58 -16
- 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 +58 -16
- 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/index.ts +4 -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/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,6 +30,7 @@ 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;
|
|
34
36
|
moneyBill: () => JSX.Element;
|
|
@@ -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",
|
|
@@ -531,6 +547,7 @@ var icons = {
|
|
|
531
547
|
arrowLeft: ArrowLeft,
|
|
532
548
|
arrowRight: ArrowRight,
|
|
533
549
|
sortDown: SortDown,
|
|
550
|
+
back: Back,
|
|
534
551
|
ban: Ban,
|
|
535
552
|
barcodeRead: BarcodeRead,
|
|
536
553
|
bell: Bell,
|
|
@@ -551,6 +568,7 @@ var icons = {
|
|
|
551
568
|
exclamationCircle: ExclamationCircle,
|
|
552
569
|
exclamationTriangle: ExclamationTriangle,
|
|
553
570
|
externalLink: ExternalLink,
|
|
571
|
+
halfBack: HalfBack,
|
|
554
572
|
home: Home,
|
|
555
573
|
image: Image,
|
|
556
574
|
moneyBill: MoneyBill,
|
|
@@ -698,7 +716,9 @@ var ButtonComponent = function ButtonComponent(_ref2, ref) {
|
|
|
698
716
|
onClick = _ref2.onClick,
|
|
699
717
|
_ref2$size = _ref2.size,
|
|
700
718
|
size = _ref2$size === void 0 ? 'default' : _ref2$size,
|
|
701
|
-
|
|
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"]);
|
|
702
722
|
|
|
703
723
|
var handleClick = function handleClick(event) {
|
|
704
724
|
(!disabled || !loading) && onClick && onClick(event);
|
|
@@ -723,9 +743,13 @@ var ButtonComponent = function ButtonComponent(_ref2, ref) {
|
|
|
723
743
|
className: classes,
|
|
724
744
|
disabled: disabled,
|
|
725
745
|
onClick: handleClick
|
|
726
|
-
}, props),
|
|
746
|
+
}, props), currentIcon && iconPosition === 'left' && React__default.createElement(Icon, {
|
|
727
747
|
icon: currentIcon,
|
|
728
|
-
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,
|
|
729
753
|
className: "ml-3 inline-block"
|
|
730
754
|
}));
|
|
731
755
|
};
|
|
@@ -2897,14 +2921,20 @@ var Breadcrumb = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
2897
2921
|
currentTitle = _ref.currentTitle,
|
|
2898
2922
|
previousTitle = _ref.previousTitle,
|
|
2899
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,
|
|
2900
2928
|
_ref$className = _ref.className,
|
|
2901
2929
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
2902
2930
|
var renderPrevTitle = React__default.createElement("span", {
|
|
2903
|
-
className: "hidden lg:inline"
|
|
2931
|
+
className: "hidden lg:inline truncate"
|
|
2904
2932
|
}, previousTitle);
|
|
2905
2933
|
var renderPrevIcon = React__default.createElement(Icon, {
|
|
2906
2934
|
icon: "arrowLeft",
|
|
2907
|
-
|
|
2935
|
+
size: 4,
|
|
2936
|
+
className: "inline-flex mr-3 -mt-1",
|
|
2937
|
+
block: true
|
|
2908
2938
|
});
|
|
2909
2939
|
|
|
2910
2940
|
var renderPrevLink = function renderPrevLink() {
|
|
@@ -2931,24 +2961,36 @@ var Breadcrumb = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
2931
2961
|
|
|
2932
2962
|
return React__default.createElement("div", {
|
|
2933
2963
|
"aria-label": "breadcrumbs",
|
|
2934
|
-
className: "header-navigation flex
|
|
2964
|
+
className: "header-navigation flex items-center justify-between mb-4 lg:mb-7 " + className
|
|
2935
2965
|
}, React__default.createElement("div", {
|
|
2936
|
-
className: "header-navigation-breadcrumb max-w-full truncate"
|
|
2966
|
+
className: "header-navigation-breadcrumb max-w-full truncate w-full"
|
|
2937
2967
|
}, React__default.createElement("div", {
|
|
2938
|
-
className: "inline-flex self-center items-center font-semibold tracking-5 text-f5 sm:text-f4 lg:text-f3"
|
|
2939
|
-
}, previousTitle && React__default.createElement("span", {
|
|
2940
|
-
className: "header-navigation-previous inline-flex items-center text-on-base-2 text-xl -mr-px"
|
|
2941
|
-
}, 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", {
|
|
2942
2972
|
className: "hidden lg:inline px-2 -ml-px"
|
|
2943
2973
|
}, " / ")), React__default.createElement("span", {
|
|
2944
|
-
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' : '')
|
|
2945
2975
|
}, currentTitle))), React__default.createElement("div", {
|
|
2946
|
-
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"
|
|
2947
2977
|
}, React__default.createElement("div", {
|
|
2948
2978
|
className: "header-navigation-help help flex items-center"
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
|
|
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)));
|
|
2952
2994
|
});
|
|
2953
2995
|
|
|
2954
2996
|
var PaginationInfoComponent = function PaginationInfoComponent(_ref) {
|