norma-library 0.6.86 → 0.6.87

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.
Files changed (59) hide show
  1. package/.storybook/main.ts +7 -0
  2. package/dist/esm/components/Box/interfaces.d.ts +1 -0
  3. package/dist/esm/components/Breadcrumb/index.d.ts +2 -2
  4. package/dist/esm/components/Breadcrumb/index.js +13 -9
  5. package/dist/esm/components/Breadcrumb/index.js.map +1 -1
  6. package/dist/esm/components/Breadcrumb/interface.d.ts +11 -6
  7. package/dist/esm/components/Breadcrumb/styles.d.ts +3 -3
  8. package/dist/esm/components/Breadcrumb/styles.js +3 -3
  9. package/dist/esm/components/Breadcrumb/styles.js.map +1 -1
  10. package/dist/esm/components/Typography/Text/interfaces.d.ts +1 -0
  11. package/dist/esm/components/Typography/Title/interfaces.d.ts +1 -0
  12. package/dist/esm/hooks/useClickOutside.d.ts +1 -1
  13. package/dist/esm/hooks/useClickOutside.js.map +1 -1
  14. package/package.json +24 -24
  15. package/src/components/Box/interfaces.ts +2 -0
  16. package/src/components/Breadcrumb/index.tsx +16 -11
  17. package/src/components/Breadcrumb/interface.ts +12 -6
  18. package/src/components/Breadcrumb/styles.tsx +10 -11
  19. package/src/components/Typography/Text/interfaces.ts +3 -1
  20. package/src/components/Typography/Title/interfaces.ts +2 -0
  21. package/src/hooks/useClickOutside.tsx +1 -1
  22. package/src/stories/Accordion.stories.tsx +19 -19
  23. package/src/stories/Avatar.stories.tsx +32 -28
  24. package/src/stories/Badge.stories.tsx +17 -15
  25. package/src/stories/Box.stories.tsx +16 -12
  26. package/src/stories/Breadcrumb.stories.tsx +62 -18
  27. package/src/stories/Button.stories.tsx +24 -16
  28. package/src/stories/Card.stories.tsx +21 -13
  29. package/src/stories/ChatMessage.stories.tsx +10 -9
  30. package/src/stories/ChatMessageBalloon.stories.tsx +83 -66
  31. package/src/stories/CheckBox.stories.tsx +23 -23
  32. package/src/stories/DateInput.stories.tsx +15 -16
  33. package/src/stories/DatePicker.stories.tsx +17 -12
  34. package/src/stories/DropDown.stories.tsx +16 -16
  35. package/src/stories/IconButton.stories.tsx +45 -21
  36. package/src/stories/Modal.stories.tsx +49 -49
  37. package/src/stories/ModalStatus.stories.tsx +34 -18
  38. package/src/stories/MultiSelectInput.stories.tsx +30 -28
  39. package/src/stories/NormaChatMessageBalloon.stories.tsx +119 -82
  40. package/src/stories/Paper.stories.tsx +14 -14
  41. package/src/stories/ProductCard.stories.tsx +76 -52
  42. package/src/stories/ProgressBar.stories.tsx +27 -19
  43. package/src/stories/RadioGroup.stories.tsx +28 -21
  44. package/src/stories/RangerSlider.stories.tsx +43 -35
  45. package/src/stories/Select.stories.tsx +61 -33
  46. package/src/stories/SelectInput.stories.tsx +27 -25
  47. package/src/stories/ServiceCard.stories.tsx +36 -27
  48. package/src/stories/Table.stories.tsx +211 -276
  49. package/src/stories/Tabs.stories.tsx +17 -17
  50. package/src/stories/Tag.stories.tsx +22 -14
  51. package/src/stories/Text.stories.tsx +9 -9
  52. package/src/stories/TextField.stories.tsx +116 -35
  53. package/src/stories/TextInput.stories.tsx +14 -15
  54. package/src/stories/TimeLine.stories.tsx +22 -20
  55. package/src/stories/TimePicker.stories.tsx +54 -30
  56. package/src/stories/Title.stories.tsx +9 -9
  57. package/src/stories/UncontrolledTable.stories.tsx +196 -66
  58. package/src/stories/UncontrolledTabs.stories.tsx +28 -23
  59. /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
@@ -2,6 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
2
2
 
3
3
  const config: StorybookConfig = {
4
4
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
+
5
6
  addons: [
6
7
  '@storybook/addon-links',
7
8
  '@storybook/addon-essentials',
@@ -9,12 +10,18 @@ const config: StorybookConfig = {
9
10
  '@storybook/addon-interactions',
10
11
  '@storybook/addon-mdx-gfm'
11
12
  ],
13
+
12
14
  framework: {
13
15
  name: '@storybook/react-vite',
14
16
  options: {},
15
17
  },
18
+
16
19
  docs: {
17
20
  autodocs: 'tag',
21
+ },
22
+
23
+ typescript: {
24
+ reactDocgen: 'react-docgen-typescript'
18
25
  }
19
26
  };
20
27
  export default config;
@@ -1,3 +1,4 @@
1
+ import { JSX } from "react";
1
2
  export interface BoxProps {
2
3
  children: JSX.Element[] | JSX.Element;
3
4
  size: string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { BreadcrumbProps } from './interface';
3
- declare const Breadcrumb: React.FC<BreadcrumbProps>;
2
+ import { BreadCrumbProps } from './interface';
3
+ declare const Breadcrumb: React.FC<BreadCrumbProps>;
4
4
  export default Breadcrumb;
@@ -1,18 +1,22 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import * as S from "./styles";
3
+ import { Icons } from '../Icons';
4
+ import { Home } from '@mui/icons-material';
3
5
  var Breadcrumb = function (_a) {
4
- var links = _a.links, onChange = _a.onChange;
5
- var listLinks = useMemo(function () {
6
- return links.map(function (link, index, self) {
6
+ var items = _a.items, onHomeClick = _a.onHomeClick, onPathClick = _a.onPathClick;
7
+ var listItems = useMemo(function () {
8
+ return items.map(function (item, index, self) {
7
9
  var showIcon = self.length > index + 1;
8
- return (React.createElement("div", { className: 'content', key: index },
9
- React.createElement(S.Link, { onClick: function () { return onChange(link); } }, link.name),
10
- showIcon ? React.createElement(S.Arrow, null,
11
- React.createElement("i", { className: "icon" })) : null));
10
+ var isFixedIcon = items[0] === item;
11
+ return (React.createElement("div", { className: 'content', key: index, onClick: function (event) { return items[0] === item ? onHomeClick(event) : onPathClick(item, event); } },
12
+ isFixedIcon && React.createElement(Icons, { icon: Home }),
13
+ !isFixedIcon && item.icon && React.createElement(Icons, { icon: item.icon, color: 'inherit' }),
14
+ React.createElement(S.Item, null, item.label),
15
+ showIcon && React.createElement(S.Divisor, null, "/")));
12
16
  });
13
- }, [links]);
17
+ }, [items]);
14
18
  return (React.createElement(S.Container, null,
15
- React.createElement(S.ListLinks, null, listLinks)));
19
+ React.createElement(S.ListItems, null, listItems)));
16
20
  };
17
21
  export default Breadcrumb;
18
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAG7B,IAAM,UAAU,GAA6B,UAAC,EAAmB;QAAjB,KAAK,WAAA,EAAE,QAAQ,cAAA;IAC7D,IAAM,SAAS,GAAG,OAAO,CAAC;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,UAAC,IAAU,EAAE,KAAa,EAAE,IAAY;YACvD,IAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,CAAA;YACxC,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS,EAAC,GAAG,EAAE,KAAK;gBACjC,oBAAC,CAAC,CAAC,IAAI,IAAC,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,IAAI,CAAC,EAAd,CAAc,IAAG,IAAI,CAAC,IAAI,CAAU;gBACzD,QAAQ,CAAC,CAAC,CAAC,oBAAC,CAAC,CAAC,KAAK;oBAAC,2BAAG,SAAS,EAAC,MAAM,GAAK,CAAU,CAAC,CAAC,CAAC,IAAI,CAC3D,CACP,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,CACL,oBAAC,CAAC,CAAC,SAAS;QACV,oBAAC,CAAC,CAAC,SAAS,QACR,SAAS,CACC,CACF,CACf,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,IAAM,UAAU,GAA8B,UAAC,EAAmC;QAAjC,KAAK,WAAA,EAAE,WAAW,iBAAA,EAAE,WAAW,iBAAA;IAC9E,IAAM,SAAS,GAAG,OAAO,CAAC;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,UAAC,IAAU,EAAE,KAAa,EAAE,IAAY;YACvD,IAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,CAAA;YACxC,IAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;YACrC,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,EAAjE,CAAiE;gBACvH,WAAW,IAAI,oBAAC,KAAK,IAAC,IAAI,EAAE,IAAI,GAAI;gBACpC,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,oBAAC,KAAK,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAC,SAAS,GAAG;gBACxE,oBAAC,CAAC,CAAC,IAAI,QAAE,IAAI,CAAC,KAAK,CAAU;gBAC5B,QAAQ,IAAI,oBAAC,CAAC,CAAC,OAAO,YAAc,CACjC,CACP,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,CACL,oBAAC,CAAC,CAAC,SAAS;QACV,oBAAC,CAAC,CAAC,SAAS,QACT,SAAS,CACE,CACF,CACf,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -1,8 +1,13 @@
1
- export interface Link {
2
- name: string;
3
- route: string;
1
+ import { IconType } from "../../types";
2
+ import { SvgIconComponent } from "@mui/icons-material";
3
+ export interface Item {
4
+ id: string;
5
+ label: string;
6
+ href: string;
7
+ icon?: SvgIconComponent | IconType;
4
8
  }
5
- export interface BreadcrumbProps {
6
- links: Link[];
7
- onChange: Function;
9
+ export interface BreadCrumbProps {
10
+ onPathClick: Function;
11
+ onHomeClick: Function;
12
+ items: Item[];
8
13
  }
@@ -1,4 +1,4 @@
1
1
  export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const ListLinks: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const Link: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
4
- export declare const Arrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const ListItems: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const Item: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
4
+ export declare const Divisor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,8 +1,8 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import styled from "styled-components";
3
3
  export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 0 0 16px 0;\n"], ["\n margin: 0 0 16px 0;\n"])));
4
- export var ListLinks = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: 8px;\n .content {\n display: flex;\n gap: 8px;\n }\n"], ["\n display: flex;\n gap: 8px;\n .content {\n display: flex;\n gap: 8px;\n }\n"])));
5
- export var Link = styled.p(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #666;\n font-size: 14px;\n cursor: pointer;\n"], ["\n color: #666;\n font-size: 14px;\n cursor: pointer;\n"])));
6
- export var Arrow = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n .icon {\n border: solid #999;\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 2px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n }\n"], ["\n display: flex;\n align-items: center;\n .icon {\n border: solid #999;\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 2px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n }\n"])));
4
+ export var ListItems = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n gap: 8px;\n .content {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n"], ["\n display: flex;\n gap: 8px;\n .content {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n"])));
5
+ export var Item = styled.p(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #666;\n font-size: 14px;\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n"], ["\n color: #666;\n font-size: 14px;\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n"])));
6
+ export var Divisor = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n content: '/';\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n content: '/';\n"])));
7
7
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
8
8
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,8FAAA,2BAElC,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,4JAAA,yFAOlC,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,IAAI,GAAG,MAAM,CAAC,CAAC,+HAAA,4DAI3B,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,iTAAA,8OAW9B,IAAA,CAAA"}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/components/Breadcrumb/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,8FAAA,2BAElC,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,sLAAA,mHAQlC,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,IAAI,GAAG,MAAM,CAAC,CAAC,kLAAA,+GAO3B,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,OAAO,GAAG,MAAM,CAAC,GAAG,8KAAA,2GAMhC,IAAA,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { JSX } from 'react';
1
2
  export interface TextProps {
2
3
  children: JSX.Element[] | JSX.Element | string;
3
4
  className?: string;
@@ -1,3 +1,4 @@
1
+ import { JSX } from "react";
1
2
  export interface TextProps {
2
3
  children: JSX.Element[] | JSX.Element | string;
3
4
  className?: string;
@@ -1,2 +1,2 @@
1
- declare const useClickOutside: (ref: React.RefObject<HTMLElement>, callback: () => void) => void;
1
+ declare const useClickOutside: (ref: React.RefObject<HTMLElement | null>, callback: () => void) => void;
2
2
  export default useClickOutside;
@@ -1 +1 @@
1
- {"version":3,"file":"useClickOutside.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,IAAM,eAAe,GAAG,UAAC,GAAiC,EAAE,QAAoB;IAC9E,IAAM,kBAAkB,GAAG,UAAC,KAAiB;QAC3C,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;YAC/D,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC;IAEF,SAAS,CAAC;QACR,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO;YACL,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"useClickOutside.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,IAAM,eAAe,GAAG,UAAC,GAAwC,EAAE,QAAoB;IACrF,IAAM,kBAAkB,GAAG,UAAC,KAAiB;QAC3C,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;YAC/D,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC;IAEF,SAAS,CAAC;QACR,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO;YACL,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.6.86",
3
+ "version": "0.6.87",
4
4
  "private": false,
5
5
  "description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
6
6
  "scripts": {
@@ -34,19 +34,19 @@
34
34
  "@emotion/core": "^11.0.0",
35
35
  "@emotion/styled-base": "^11.0.0",
36
36
  "@mdx-js/loader": "^2.3.0",
37
- "@storybook/addon-essentials": "^7.5.0",
38
- "@storybook/addon-interactions": "^7.5.0",
39
- "@storybook/addon-links": "^7.5.0",
40
- "@storybook/addon-onboarding": "^1.0.8",
37
+ "@storybook/addon-essentials": "^8.5.6",
38
+ "@storybook/addon-interactions": "^8.5.6",
39
+ "@storybook/addon-links": "^8.5.6",
40
+ "@storybook/addon-onboarding": "^8.5.6",
41
41
  "@storybook/addon-styling": "^1.3.7",
42
- "@storybook/blocks": "^7.5.0",
43
- "@storybook/react": "^7.5.0",
44
- "@storybook/react-vite": "^7.5.0",
45
- "@storybook/react-webpack5": "^7.5.0-alpha.1",
46
- "@storybook/testing-library": "^0.2.2",
47
- "@types/react": "^18.2.15",
48
- "@types/react-datepicker": "^4.19.1",
49
- "@types/react-dom": "^18.2.7",
42
+ "@storybook/blocks": "^8.5.6",
43
+ "@storybook/react": "^8.5.6",
44
+ "@storybook/react-vite": "^8.5.6",
45
+ "@storybook/react-webpack5": "^8.5.6",
46
+ "@storybook/test": "^8.5.6",
47
+ "@types/react": "^19.0.0",
48
+ "@types/react-datepicker": "^7.0.0",
49
+ "@types/react-dom": "^19.0.0",
50
50
  "@typescript-eslint/eslint-plugin": "^6.0.0",
51
51
  "@typescript-eslint/parser": "^6.0.0",
52
52
  "@vitejs/plugin-react": "^4.0.3",
@@ -60,17 +60,17 @@
60
60
  "eslint": "^8.45.0",
61
61
  "eslint-plugin-react-hooks": "^4.6.0",
62
62
  "eslint-plugin-react-refresh": "^0.4.3",
63
- "eslint-plugin-storybook": "^0.6.15",
63
+ "eslint-plugin-storybook": "^0.11.2",
64
64
  "git-cz": "^4.9.0",
65
65
  "lint-staged": "^14.0.1",
66
66
  "path": "^0.12.7",
67
67
  "postcss": "^8.4.29",
68
68
  "postcss-prettify": "^0.3.4",
69
- "react": "^18.2.0",
70
- "react-dom": "^18.2.0",
69
+ "react": "^19.0.0",
70
+ "react-dom": "^19.0.0",
71
71
  "rimraf": "^5.0.5",
72
- "storybook": "^7.5.0",
73
- "storybook-dark-mode": "^3.0.1",
72
+ "storybook": "^8.5.6",
73
+ "storybook-dark-mode": "^4.0.2",
74
74
  "style-loader": "^3.3.3",
75
75
  "tsconfig-paths-webpack-plugin": "^4.1.0",
76
76
  "typescript": "^5.0.2",
@@ -92,24 +92,24 @@
92
92
  "@dnd-kit/core": "^6.3.1",
93
93
  "@dnd-kit/modifiers": "^9.0.0",
94
94
  "@dnd-kit/sortable": "^10.0.0",
95
- "@emotion/react": "^11.11.1",
95
+ "@emotion/react": "^11.14.0",
96
96
  "@emotion/styled": "^11.11.0",
97
97
  "@mui/icons-material": "^5.14.9",
98
98
  "@mui/lab": "^5.0.0-alpha.152",
99
99
  "@mui/material": "^5.16.7",
100
- "@mui/x-date-pickers": "^6.20.2",
101
- "@storybook/addon-mdx-gfm": "^7.5.2",
100
+ "@mui/x-date-pickers": "^7.26.0",
101
+ "@storybook/addon-mdx-gfm": "^8.5.6",
102
102
  "@tanstack/react-table": "^8.10.7",
103
103
  "dayjs": "^1.11.9",
104
104
  "react-datepicker": "^7.5.0",
105
- "react-i18next": "^13.2.2",
105
+ "react-i18next": "^15.4.0",
106
106
  "react-select": "^5.8.0",
107
107
  "styled-components": "^6.1.0",
108
108
  "tslib": "^2.6.2"
109
109
  },
110
110
  "peerDependencies": {
111
- "react": "^17.0.0 || ^18.0.0",
112
- "react-dom": "^17.0.0 || ^18.0.0"
111
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
112
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
113
113
  },
114
114
  "browserslist": {
115
115
  "production": [
@@ -1,3 +1,5 @@
1
+ import { JSX } from "react"
2
+
1
3
  export interface BoxProps {
2
4
  children: JSX.Element[] | JSX.Element
3
5
  size: string
@@ -1,25 +1,30 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import * as S from "./styles"
3
- import { BreadcrumbProps, Link } from './interface';
3
+ import { BreadCrumbProps, Item } from './interface';
4
+ import { Icons } from '../Icons';
5
+ import { Home } from '@mui/icons-material';
4
6
 
5
- const Breadcrumb:React.FC<BreadcrumbProps> = ({ links, onChange }) => {
6
- const listLinks = useMemo(() => {
7
- return links.map((link: Link, index: number, self: Link[]) => {
7
+ const Breadcrumb: React.FC<BreadCrumbProps> = ({ items, onHomeClick, onPathClick }) => {
8
+ const listItems = useMemo(() => {
9
+ return items.map((item: Item, index: number, self: Item[]) => {
8
10
  const showIcon = self.length > index + 1
11
+ const isFixedIcon = items[0] === item
9
12
  return (
10
- <div className='content' key={index}>
11
- <S.Link onClick={() => onChange(link)}>{link.name}</S.Link>
12
- { showIcon ? <S.Arrow><i className="icon"></i></S.Arrow> : null }
13
+ <div className='content' key={index} onClick={(event) => items[0] === item ? onHomeClick(event) : onPathClick(item, event)}>
14
+ {isFixedIcon && <Icons icon={Home} />}
15
+ {!isFixedIcon && item.icon && <Icons icon={item.icon} color='inherit' />}
16
+ <S.Item>{item.label}</S.Item>
17
+ {showIcon && <S.Divisor>/</S.Divisor>}
13
18
  </div>
14
19
  )
15
20
  })
16
- }, [links])
21
+ }, [items])
17
22
 
18
23
  return (
19
24
  <S.Container>
20
- <S.ListLinks>
21
- { listLinks }
22
- </S.ListLinks>
25
+ <S.ListItems>
26
+ {listItems}
27
+ </S.ListItems>
23
28
  </S.Container>
24
29
  )
25
30
  }
@@ -1,9 +1,15 @@
1
- export interface Link {
2
- name: string
3
- route: string
1
+ import { IconType } from "../../types";
2
+ import { SvgIconComponent } from "@mui/icons-material";
3
+
4
+ export interface Item {
5
+ id: string;
6
+ label: string;
7
+ href: string;
8
+ icon?: SvgIconComponent | IconType;
4
9
  }
5
10
 
6
- export interface BreadcrumbProps {
7
- links: Link[]
8
- onChange: Function
11
+ export interface BreadCrumbProps {
12
+ onPathClick: Function;
13
+ onHomeClick: Function;
14
+ items: Item[];
9
15
  }
@@ -4,30 +4,29 @@ export const Container = styled.div`
4
4
  margin: 0 0 16px 0;
5
5
  `
6
6
 
7
- export const ListLinks = styled.div`
7
+ export const ListItems = styled.div`
8
8
  display: flex;
9
9
  gap: 8px;
10
10
  .content {
11
11
  display: flex;
12
12
  gap: 8px;
13
+ align-items: center;
13
14
  }
14
15
  `
15
16
 
16
- export const Link = styled.p`
17
+ export const Item = styled.p`
17
18
  color: #666;
18
19
  font-size: 14px;
19
20
  cursor: pointer;
21
+ &:hover {
22
+ text-decoration: underline;
23
+ }
20
24
  `
21
25
 
22
- export const Arrow = styled.div`
26
+ export const Divisor = styled.div`
23
27
  display: flex;
24
28
  align-items: center;
25
- .icon {
26
- border: solid #999;
27
- border-width: 0 2px 2px 0;
28
- display: inline-block;
29
- padding: 2px;
30
- transform: rotate(-45deg);
31
- -webkit-transform: rotate(-45deg);
32
- }
29
+ justify-content: center;
30
+ color: #666;
31
+ content: '/';
33
32
  `
@@ -1,6 +1,8 @@
1
+ import { JSX } from 'react'
2
+
1
3
  export interface TextProps {
2
4
  children: JSX.Element[] | JSX.Element | string
3
5
  className?: string
4
6
  size: string
5
7
  type: string
6
- }
8
+ }
@@ -1,3 +1,5 @@
1
+ import { JSX } from "react"
2
+
1
3
  export interface TextProps {
2
4
  children: JSX.Element[] | JSX.Element | string
3
5
  className?: string
@@ -1,6 +1,6 @@
1
1
  import { useEffect } from 'react';
2
2
 
3
- const useClickOutside = (ref: React.RefObject<HTMLElement>, callback: () => void) => {
3
+ const useClickOutside = (ref: React.RefObject<HTMLElement | null>, callback: () => void) => {
4
4
  const handleClickOutside = (event: MouseEvent) => {
5
5
  if (ref.current && !ref.current.contains(event.target as Node)) {
6
6
  callback();
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import React from 'react'
2
2
 
3
- import type { Meta, StoryObj } from '@storybook/react';
4
- import { Accordion } from '../components';
5
- import { DataAccordion } from '../types';
6
- import { Typography } from '@mui/material';
3
+ import type { Meta, StoryObj } from '@storybook/react'
4
+ import { Accordion } from '../components'
5
+ import { DataAccordion } from '../types'
6
+ import { Typography } from '@mui/material'
7
7
 
8
8
  const data: DataAccordion[] = [
9
9
  {
@@ -11,8 +11,8 @@ const data: DataAccordion[] = [
11
11
  id: 'panel-1',
12
12
  children: (
13
13
  <Typography>
14
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
15
- lobortis eget.
14
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit
15
+ amet blandit leo lobortis eget.
16
16
  </Typography>
17
17
  ),
18
18
  },
@@ -21,12 +21,12 @@ const data: DataAccordion[] = [
21
21
  id: 'panel-2',
22
22
  children: (
23
23
  <Typography>
24
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
25
- lobortis eget.
24
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit
25
+ amet blandit leo lobortis eget.
26
26
  </Typography>
27
27
  ),
28
28
  },
29
- ];
29
+ ]
30
30
 
31
31
  const meta = {
32
32
  title: 'Display/Accordion',
@@ -38,28 +38,28 @@ const meta = {
38
38
  argTypes: {
39
39
  data: data,
40
40
  },
41
- } satisfies Meta<typeof Accordion>;
41
+ } satisfies Meta<typeof Accordion>
42
42
 
43
- export default meta;
43
+ export default meta
44
44
 
45
- type Story = StoryObj<typeof meta>;
45
+ type Story = StoryObj<typeof meta>
46
46
 
47
47
  export const AccordionBasic = () => {
48
48
  return (
49
49
  <div style={{ width: '480px', marginBottom: 30 }}>
50
50
  <Accordion data={data} />
51
51
  </div>
52
- );
53
- };
52
+ )
53
+ }
54
54
 
55
- AccordionBasic.storyName = 'Accordion Basic';
55
+ AccordionBasic.storyName = 'Accordion Basic'
56
56
 
57
57
  export const AccordionExpanded = () => {
58
58
  return (
59
59
  <div style={{ width: '480px', marginBottom: 30 }}>
60
60
  <Accordion data={data} defaultExpanded="panel-1" />
61
61
  </div>
62
- );
63
- };
62
+ )
63
+ }
64
64
 
65
- AccordionExpanded.storyName = 'Accordion Expanded';
65
+ AccordionExpanded.storyName = 'Accordion Expanded'
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import React from 'react'
2
2
 
3
- import type { Meta } from '@storybook/react';
4
- import { Avatar, Icons } from '../components';
5
- import { AvatarGroup, Stack } from '@mui/material';
6
- import { green, pink } from '@mui/material/colors';
3
+ import type { Meta } from '@storybook/react'
4
+ import { Avatar, Icons } from '../components'
5
+ import { AvatarGroup, Stack } from '@mui/material'
6
+ import { green, pink } from '@mui/material/colors'
7
7
 
8
8
  const meta = {
9
9
  title: 'Display/Avatar',
@@ -13,28 +13,28 @@ const meta = {
13
13
  },
14
14
  tags: ['autodocs'],
15
15
  argTypes: {},
16
- } satisfies Meta<typeof Avatar>;
16
+ } satisfies Meta<typeof Avatar>
17
17
 
18
- export default meta;
18
+ export default meta
19
19
 
20
20
  function stringToColor(string: string) {
21
- let hash = 0;
22
- let i;
21
+ let hash = 0
22
+ let i
23
23
 
24
24
  /* eslint-disable no-bitwise */
25
25
  for (i = 0; i < string.length; i += 1) {
26
- hash = string.charCodeAt(i) + ((hash << 5) - hash);
26
+ hash = string.charCodeAt(i) + ((hash << 5) - hash)
27
27
  }
28
28
 
29
- let color = '#';
29
+ let color = '#'
30
30
 
31
31
  for (i = 0; i < 3; i += 1) {
32
- const value = (hash >> (i * 8)) & 0xff;
33
- color += `00${value.toString(16)}`.slice(-2);
32
+ const value = (hash >> (i * 8)) & 0xff
33
+ color += `00${value.toString(16)}`.slice(-2)
34
34
  }
35
35
  /* eslint-enable no-bitwise */
36
36
 
37
- return color;
37
+ return color
38
38
  }
39
39
 
40
40
  function stringAvatar(name: string) {
@@ -43,7 +43,7 @@ function stringAvatar(name: string) {
43
43
  bgcolor: stringToColor(name),
44
44
  },
45
45
  children: `${name.split(' ')[0][0]}${name.split(' ')[1][0]}`,
46
- };
46
+ }
47
47
  }
48
48
 
49
49
  export const AvatarBasic = () => {
@@ -51,8 +51,8 @@ export const AvatarBasic = () => {
51
51
  <>
52
52
  <Avatar src="https://mui.com/static/images/avatar/2.jpg" />
53
53
  </>
54
- );
55
- };
54
+ )
55
+ }
56
56
 
57
57
  export const AvatarVariants = () => {
58
58
  return (
@@ -61,8 +61,8 @@ export const AvatarVariants = () => {
61
61
  <Avatar src="https://mui.com/static/images/avatar/2.jpg" variant="rounded" />
62
62
  <Avatar src="https://mui.com/static/images/avatar/3.jpg" />
63
63
  </Stack>
64
- );
65
- };
64
+ )
65
+ }
66
66
 
67
67
  export const AvatarLetters = () => {
68
68
  return (
@@ -73,20 +73,24 @@ export const AvatarLetters = () => {
73
73
  <Avatar {...stringAvatar('Tim Neutkens')} />
74
74
  </Stack>
75
75
  </>
76
- );
77
- };
76
+ )
77
+ }
78
78
 
79
79
  export const AvatarSizes = () => {
80
80
  return (
81
81
  <>
82
82
  <Stack direction="row" spacing={2}>
83
- <Avatar src="https://mui.com/static/images/avatar/1.jpg" variant="square" sx={{ width: 24, height: 24 }} />
83
+ <Avatar
84
+ src="https://mui.com/static/images/avatar/1.jpg"
85
+ variant="square"
86
+ sx={{ width: 24, height: 24 }}
87
+ />
84
88
  <Avatar src="https://mui.com/static/images/avatar/2.jpg" variant="rounded" />
85
89
  <Avatar src="https://mui.com/static/images/avatar/3.jpg" sx={{ width: 56, height: 56 }} />
86
90
  </Stack>
87
91
  </>
88
- );
89
- };
92
+ )
93
+ }
90
94
 
91
95
  export const AvatarWidthIcons = () => {
92
96
  return (
@@ -103,8 +107,8 @@ export const AvatarWidthIcons = () => {
103
107
  </Avatar>
104
108
  </Stack>
105
109
  </>
106
- );
107
- };
110
+ )
111
+ }
108
112
 
109
113
  export const AvatarGrouped = () => {
110
114
  return (
@@ -119,5 +123,5 @@ export const AvatarGrouped = () => {
119
123
  </AvatarGroup>
120
124
  </Stack>
121
125
  </>
122
- );
123
- };
126
+ )
127
+ }