@feminab/box-ui 0.1.0 → 0.1.2
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/.storybook/main.ts +40 -2
- package/dist/@interfaces/Badge.d.d.ts.map +1 -1
- package/dist/@interfaces/Button.d.d.ts.map +1 -1
- package/dist/@interfaces/Color.d.d.ts.map +1 -1
- package/dist/@interfaces/IButtonItem.d.d.ts.map +1 -1
- package/dist/@interfaces/ISubNavItem.d.d.ts.map +1 -1
- package/dist/@interfaces/MobileNavProps.d.d.ts.map +1 -1
- package/dist/@interfaces/NavItem.d.d.ts.map +1 -1
- package/dist/@interfaces/Pagination.d.d.ts.map +1 -1
- package/dist/@interfaces/Select.d.d.ts.map +1 -1
- package/dist/@interfaces/SideNavProps.d.d.ts.map +1 -1
- package/dist/@interfaces/TextInput.d.d.ts.map +1 -1
- package/dist/@interfaces/index.d.ts.map +1 -1
- package/dist/Badge.d.ts.map +1 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/ButtonGroup.d.ts.map +1 -1
- package/dist/ColorBox.d.ts.map +1 -1
- package/dist/Header.d.ts.map +1 -1
- package/dist/Nav/MobileNav.d.ts.map +1 -1
- package/dist/Nav/NavItem.d.ts.map +1 -1
- package/dist/Nav/SideNav.d.ts.map +1 -1
- package/dist/Nav/SubNavItem.d.ts.map +1 -1
- package/dist/Paginate.d.ts.map +1 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/StoryLayout.d.ts.map +1 -1
- package/dist/TextInput.d.ts.map +1 -1
- package/dist/Typography.d.ts.map +1 -1
- package/dist/box-ui.cjs.development.js +17 -11
- package/dist/box-ui.cjs.development.js.map +1 -1
- package/dist/box-ui.cjs.production.min.js +1 -1
- package/dist/box-ui.cjs.production.min.js.map +1 -1
- package/dist/box-ui.esm.js +17 -11
- package/dist/box-ui.esm.js.map +1 -1
- package/dist/data/colors.d.ts.map +1 -1
- package/dist/data/countries.d.ts.map +1 -1
- package/dist/data/images/index.d.ts.map +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/navItems.d.ts.map +1 -1
- package/dist/data/options.d.ts.map +1 -1
- package/dist/data/prices.d.ts.map +1 -1
- package/dist/hooks/useIconClassName.d.ts.map +1 -1
- package/dist/hooks/useIconProps.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/jest.config.d.ts +9 -0
- package/dist/jest.config.d.ts.map +1 -0
- package/dist/reportWebVitals.d.ts.map +1 -1
- package/dist/setupTests.d.ts.map +1 -1
- package/dist/stories/Badge.stories.d.ts +3 -4
- package/dist/stories/Badge.stories.d.ts.map +1 -1
- package/dist/stories/Button.stories.d.ts +3 -4
- package/dist/stories/Button.stories.d.ts.map +1 -1
- package/dist/stories/ButtonGroup.stories.d.ts +4 -4
- package/dist/stories/ButtonGroup.stories.d.ts.map +1 -1
- package/dist/stories/Colors.stories.d.ts +3 -3
- package/dist/stories/Colors.stories.d.ts.map +1 -1
- package/dist/stories/MobileNav.stories.d.ts +3 -4
- package/dist/stories/MobileNav.stories.d.ts.map +1 -1
- package/dist/stories/Paginate.stories.d.ts +3 -4
- package/dist/stories/Paginate.stories.d.ts.map +1 -1
- package/dist/stories/Select.stories.d.ts +3 -4
- package/dist/stories/Select.stories.d.ts.map +1 -1
- package/dist/stories/SideNav.stories.d.ts +3 -4
- package/dist/stories/SideNav.stories.d.ts.map +1 -1
- package/dist/stories/TextInput.stories.d.ts +3 -4
- package/dist/stories/TextInput.stories.d.ts.map +1 -1
- package/dist/stories/Typography.stories.d.ts +4 -4
- package/dist/stories/Typography.stories.d.ts.map +1 -1
- package/dist/utils/IconWrapper.d.ts +8 -0
- package/dist/utils/IconWrapper.d.ts.map +1 -0
- package/jest.config.js +13 -0
- package/jest.setup.ts +3 -0
- package/netlify.toml +3 -0
- package/package.json +24 -26
- package/src/Nav/MobileNav.tsx +2 -0
- package/src/Nav/SideNav.tsx +1 -0
- package/src/Paginate.tsx +2 -0
- package/src/Select.tsx +1 -1
- package/src/TextInput.tsx +23 -27
- package/src/index.js +1 -1
- package/src/stories/Badge.stories.tsx +6 -8
- package/src/stories/Button.stories.tsx +21 -8
- package/src/stories/ButtonGroup.stories.tsx +48 -48
- package/src/stories/Colors.stories.tsx +2 -4
- package/src/stories/MobileNav.stories.tsx +29 -19
- package/src/stories/Paginate.stories.tsx +36 -35
- package/src/stories/Select.stories.tsx +46 -43
- package/src/stories/SideNav.stories.tsx +18 -19
- package/src/stories/TextInput.stories.tsx +81 -71
- package/src/stories/Typography.stories.tsx +2 -4
- package/src/styles/global.css +1 -181
- package/src/tests/Badge.test.tsx +48 -0
- package/src/tests/Button.test.tsx +69 -0
- package/src/tests/ButtonGroup.test.tsx +51 -0
- package/src/tests/MobileNav.test.tsx +66 -0
- package/src/tests/Paginate.test.tsx +86 -0
- package/src/tests/Select.test.tsx +63 -0
- package/src/tests/SideNav.test.tsx +43 -0
- package/src/tests/TextInput.test.tsx +42 -0
- package/src/tests/Typography.test.tsx +41 -0
- package/src/tests/__snapshots__/Badge.test.tsx.snap +13 -0
- package/src/tests/__snapshots__/Button.test.tsx.snap +106 -0
- package/src/tests/__snapshots__/ButtonGroup.test.tsx.snap +228 -0
- package/src/tests/__snapshots__/Paginate.test.tsx.snap +580 -0
- package/src/tests/__snapshots__/Select.test.tsx.snap +119 -0
- package/src/tests/__snapshots__/TextInput.test.tsx.snap +323 -0
- package/src/utils/IconWrapper.tsx +11 -0
- package/storybook-static/{125.65b26339.iframe.bundle.js → 125.df7cc93e.iframe.bundle.js} +3 -3
- package/storybook-static/125.df7cc93e.iframe.bundle.js.map +1 -0
- package/storybook-static/13.d4c3993e.iframe.bundle.js +2 -0
- package/storybook-static/161.f5193502.iframe.bundle.js +2 -0
- package/storybook-static/167.89fa6ac2.iframe.bundle.js +1 -0
- package/storybook-static/294.eccdc80d.iframe.bundle.js +1 -0
- package/storybook-static/314.c9f9245e.iframe.bundle.js +2 -0
- package/storybook-static/364.1cfcaebe.iframe.bundle.js +1 -0
- package/storybook-static/735.c396ee77.iframe.bundle.js +2 -0
- package/storybook-static/742.52c662a4.iframe.bundle.js +1 -0
- package/storybook-static/{844.aec20bdb.iframe.bundle.js → 844.3bb89aad.iframe.bundle.js} +3 -3
- package/storybook-static/844.3bb89aad.iframe.bundle.js.map +1 -0
- package/storybook-static/936.c827da74.iframe.bundle.js +1 -0
- package/storybook-static/961.c3df469f.iframe.bundle.js +2 -0
- package/storybook-static/iframe.html +3 -3
- package/storybook-static/main.179173d1.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/{runtime~main.295ddda4.iframe.bundle.js → runtime~main.70344601.iframe.bundle.js} +1 -1
- package/storybook-static/static/css/main.08036cd2.css.map +1 -1
- package/storybook-static/stories-Badge-stories.a924d6d5.iframe.bundle.js +1 -0
- package/storybook-static/stories-Button-stories.a3c88a14.iframe.bundle.js +1 -0
- package/storybook-static/stories-ButtonGroup-stories.2c74e4c4.iframe.bundle.js +1 -0
- package/storybook-static/stories-Colors-stories.424256b4.iframe.bundle.js +2 -0
- package/storybook-static/stories-Configure-mdx.46ebbf59.iframe.bundle.js +1 -0
- package/storybook-static/stories-Header-stories.df09e844.iframe.bundle.js +2 -0
- package/storybook-static/stories-MobileNav-stories.eb9a0ca6.iframe.bundle.js +1 -0
- package/storybook-static/stories-Page-stories.ab66c885.iframe.bundle.js +2 -0
- package/storybook-static/stories-Paginate-stories.086f736a.iframe.bundle.js +1 -0
- package/storybook-static/stories-Select-stories.4c04edb3.iframe.bundle.js +1 -0
- package/storybook-static/stories-SideNav-stories.272a4362.iframe.bundle.js +1 -0
- package/storybook-static/stories-TextInput-stories.cfa81131.iframe.bundle.js +1 -0
- package/storybook-static/stories-Typography-stories.a31da7ce.iframe.bundle.js +2 -0
- package/tailwind.config.js +1 -1
- package/tsconfig.json +6 -3
- package/tsdx.config.js +14 -0
- package/dist/Page.d.ts +0 -3
- package/dist/Page.d.ts.map +0 -1
- package/dist/stories/Header.stories.d.ts +0 -20
- package/dist/stories/Header.stories.d.ts.map +0 -1
- package/dist/stories/Page.stories.d.ts +0 -14
- package/dist/stories/Page.stories.d.ts.map +0 -1
- package/src/Page.tsx +0 -72
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Page.stories.ts +0 -32
- package/storybook-static/125.65b26339.iframe.bundle.js.map +0 -1
- package/storybook-static/13.0638081a.iframe.bundle.js +0 -2
- package/storybook-static/161.a19908ac.iframe.bundle.js +0 -2
- package/storybook-static/167.3fa3a909.iframe.bundle.js +0 -1
- package/storybook-static/294.ce38f65c.iframe.bundle.js +0 -1
- package/storybook-static/314.568bd9af.iframe.bundle.js +0 -2
- package/storybook-static/364.0b18ef67.iframe.bundle.js +0 -1
- package/storybook-static/735.1625d9f4.iframe.bundle.js +0 -2
- package/storybook-static/742.597501f6.iframe.bundle.js +0 -1
- package/storybook-static/844.aec20bdb.iframe.bundle.js.map +0 -1
- package/storybook-static/936.fd850a3f.iframe.bundle.js +0 -1
- package/storybook-static/961.0e5457c5.iframe.bundle.js +0 -2
- package/storybook-static/main.069281cf.iframe.bundle.js +0 -1
- package/storybook-static/stories-Badge-stories.484f7206.iframe.bundle.js +0 -1
- package/storybook-static/stories-Button-stories.5e29be85.iframe.bundle.js +0 -1
- package/storybook-static/stories-ButtonGroup-stories.cc89968c.iframe.bundle.js +0 -1
- package/storybook-static/stories-Colors-stories.f892dc75.iframe.bundle.js +0 -2
- package/storybook-static/stories-Configure-mdx.81346d97.iframe.bundle.js +0 -1
- package/storybook-static/stories-Header-stories.cf691094.iframe.bundle.js +0 -2
- package/storybook-static/stories-MobileNav-stories.f04cccdd.iframe.bundle.js +0 -1
- package/storybook-static/stories-Page-stories.0c9aa29d.iframe.bundle.js +0 -2
- package/storybook-static/stories-Paginate-stories.3b161781.iframe.bundle.js +0 -1
- package/storybook-static/stories-Select-stories.7556ae0d.iframe.bundle.js +0 -1
- package/storybook-static/stories-SideNav-stories.093fac6a.iframe.bundle.js +0 -1
- package/storybook-static/stories-TextInput-stories.6d3e15c6.iframe.bundle.js +0 -1
- package/storybook-static/stories-Typography-stories.6640f7ac.iframe.bundle.js +0 -2
- /package/storybook-static/{125.65b26339.iframe.bundle.js.LICENSE.txt → 125.df7cc93e.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{13.0638081a.iframe.bundle.js.LICENSE.txt → 13.d4c3993e.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{161.a19908ac.iframe.bundle.js.LICENSE.txt → 161.f5193502.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{314.568bd9af.iframe.bundle.js.LICENSE.txt → 314.c9f9245e.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{735.1625d9f4.iframe.bundle.js.LICENSE.txt → 735.c396ee77.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{844.aec20bdb.iframe.bundle.js.LICENSE.txt → 844.3bb89aad.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{961.0e5457c5.iframe.bundle.js.LICENSE.txt → 961.c3df469f.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{stories-Colors-stories.f892dc75.iframe.bundle.js.LICENSE.txt → stories-Colors-stories.424256b4.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{stories-Header-stories.cf691094.iframe.bundle.js.LICENSE.txt → stories-Header-stories.df09e844.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{stories-Page-stories.0c9aa29d.iframe.bundle.js.LICENSE.txt → stories-Page-stories.ab66c885.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook-static/{stories-Typography-stories.6640f7ac.iframe.bundle.js.LICENSE.txt → stories-Typography-stories.a31da7ce.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["Select.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAW,WAAW,EAAE,MAAM,gBAAgB,CAAC;;AAOtD,wBAOU;AACV,UAAU,KAAM,SAAQ,WAAW;IAC/B,QAAQ,EAAE,KAAK,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,KAAK,CA2BnC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,KAAK,CA4B1C,CAAA"}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
2
|
import { SideNavProps } from "../@interfaces";
|
3
|
-
|
4
|
-
|
5
|
-
export default meta;
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
6
5
|
interface Props extends SideNavProps {
|
7
6
|
darkMode: boolean;
|
8
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SideNav.stories.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"SideNav.stories.d.ts","sourceRoot":"","sources":["SideNav.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;;AAK9C,wBAGU;AAEV,UAAU,KAAM,SAAQ,YAAY;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAiBD,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,KAAK,CAKnC,CAAC"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { TextInputProps } from "../@interfaces";
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
export default meta;
|
2
|
+
import { StoryObj } from "@storybook/react";
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
6
5
|
interface Props extends TextInputProps {
|
7
6
|
darkMode: boolean;
|
8
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextInput.stories.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"TextInput.stories.d.ts","sourceRoot":"","sources":["TextInput.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;;AAMlD,wBAGU;AAEV,UAAU,KAAM,SAAQ,cAAc;IACpC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,KAAK,CAMnC,CAAC;AAyCF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAM5C,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
declare const
|
4
|
-
export default
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
|
+
import { TypographyProps } from "../Typography";
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
5
5
|
interface Props extends TypographyProps {
|
6
6
|
darkMode: boolean;
|
7
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["Typography.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;;AAG5D,wBAMU;AAEV,UAAU,KAAM,SAAQ,eAAe;IACrC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAqB7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAsC9C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,KAAK,CAgC1C,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { IconType } from "react-icons";
|
3
|
+
interface IconWrapperProps {
|
4
|
+
Icon: IconType;
|
5
|
+
}
|
6
|
+
export declare const IconWrapper: ({ Icon, ...props }: IconWrapperProps) => React.JSX.Element;
|
7
|
+
export {};
|
8
|
+
//# sourceMappingURL=IconWrapper.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IconWrapper.d.ts","sourceRoot":"","sources":["IconWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,UAAU,gBAAgB;IACxB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,WAAW,uBAAwB,gBAAgB,sBAG/D,CAAC"}
|
package/jest.config.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module.exports = {
|
2
|
+
preset: 'ts-jest',
|
3
|
+
testEnvironment: 'jsdom',
|
4
|
+
transformIgnorePatterns: ['/node_modules/'],
|
5
|
+
setupFilesAfterEnv: [
|
6
|
+
'@testing-library/jest-dom',
|
7
|
+
'<rootDir>/jest.setup.ts', // 👈 Add this line
|
8
|
+
],
|
9
|
+
moduleNameMapper: {
|
10
|
+
'^.+\\.(css|scss|sass)$': 'identity-obj-proxy',
|
11
|
+
'^storybook/internal/preview-api$': '<rootDir>/node_modules/@storybook/preview-api',
|
12
|
+
},
|
13
|
+
};
|
package/jest.setup.ts
ADDED
package/netlify.toml
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@feminab/box-ui",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.2",
|
4
4
|
"private": false,
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -8,19 +8,15 @@
|
|
8
8
|
"dependencies": {
|
9
9
|
"@headlessui/react": "^2.2.0",
|
10
10
|
"@testing-library/dom": "^10.4.0",
|
11
|
-
"@testing-library/jest-dom": "^6.6.3",
|
12
|
-
"@testing-library/react": "^16.2.0",
|
13
11
|
"@testing-library/user-event": "^13.5.0",
|
14
|
-
"@types/jest": "^27.5.2",
|
15
12
|
"@types/node": "^16.18.126",
|
16
13
|
"@types/react": "^19.0.10",
|
17
14
|
"@types/react-dom": "^19.0.4",
|
18
15
|
"classnames": "^2.5.1",
|
19
|
-
"react": "^
|
20
|
-
"react-dom": "^
|
16
|
+
"react": "^18.3.1",
|
17
|
+
"react-dom": "^18.3.1",
|
21
18
|
"react-headless-pagination": "^1.1.0",
|
22
19
|
"react-icons": "^5.5.0",
|
23
|
-
"react-scripts": "5.0.1",
|
24
20
|
"web-vitals": "^2.1.4"
|
25
21
|
},
|
26
22
|
"scripts": {
|
@@ -29,16 +25,12 @@
|
|
29
25
|
"test": "tsdx test",
|
30
26
|
"eject": "tsdx eject",
|
31
27
|
"storybook": "storybook dev -p 6006",
|
32
|
-
"build-storybook": "storybook build",
|
33
|
-
"storybook:build": "build-storybook",
|
34
|
-
"storybook:deploy": "gh-pages -d storybook-static",
|
35
28
|
"build:css": "postcss ./src/styles/tailwind.css build -o css/tailwind.dist.css --minify"
|
36
29
|
},
|
37
30
|
"eslintConfig": {
|
38
31
|
"extends": [
|
39
32
|
"react-app",
|
40
|
-
"react-app/jest"
|
41
|
-
"plugin:storybook/recommended"
|
33
|
+
"react-app/jest"
|
42
34
|
]
|
43
35
|
},
|
44
36
|
"browserslist": {
|
@@ -59,33 +51,39 @@
|
|
59
51
|
"@babel/preset-env": "^7.26.9",
|
60
52
|
"@babel/preset-react": "^7.26.3",
|
61
53
|
"@babel/preset-typescript": "^7.27.0",
|
62
|
-
"@
|
63
|
-
"@storybook/addon-
|
64
|
-
"@storybook/addon-
|
65
|
-
"@storybook/
|
66
|
-
"@storybook/
|
67
|
-
"@storybook/
|
68
|
-
"@storybook/
|
69
|
-
"@
|
70
|
-
"@
|
71
|
-
"@
|
54
|
+
"@storybook/addon-essentials": "7.6.20",
|
55
|
+
"@storybook/addon-interactions": "7.6.20",
|
56
|
+
"@storybook/addon-links": "7.6.20",
|
57
|
+
"@storybook/cli": "^7.6.20",
|
58
|
+
"@storybook/preset-create-react-app": "7.6.20",
|
59
|
+
"@storybook/react": "7.6.20",
|
60
|
+
"@storybook/react-webpack5": "7.6.20",
|
61
|
+
"@testing-library/jest-dom": "^6.6.3",
|
62
|
+
"@testing-library/react": "^16.3.0",
|
63
|
+
"@types/jest": "^29.5.14",
|
72
64
|
"ajv": "^8.17.1",
|
73
65
|
"ajv-keywords": "^5.1.0",
|
74
|
-
"autoprefixer": "^10.4.
|
66
|
+
"autoprefixer": "^10.4.21",
|
75
67
|
"eslint": "^8.57.1",
|
76
68
|
"eslint-config-prettier": "^10.0.1",
|
77
69
|
"eslint-plugin-react": "^7.37.4",
|
78
|
-
"eslint-plugin-storybook": "^0.11.3",
|
79
70
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
80
71
|
"gh-pages": "^6.3.0",
|
72
|
+
"identity-obj-proxy": "^3.0.0",
|
73
|
+
"jest": "^29.7.0",
|
81
74
|
"postcss": "^8.5.3",
|
82
75
|
"prettier": "^3.5.2",
|
83
76
|
"prop-types": "^15.8.1",
|
84
77
|
"react-refresh": "^0.17.0",
|
85
|
-
"
|
78
|
+
"react-scripts": "^5.0.1",
|
79
|
+
"resize-observer-polyfill": "^1.5.1",
|
80
|
+
"rollup-plugin-postcss": "^4.0.2",
|
81
|
+
"storybook": "^7.6.20",
|
86
82
|
"tailwindcss": "^3.4.17",
|
83
|
+
"ts-jest": "^29.3.1",
|
84
|
+
"ts-loader": "^9.5.2",
|
87
85
|
"tsdx": "^0.14.1",
|
88
|
-
"typescript": "^
|
86
|
+
"typescript": "^4.9.5",
|
89
87
|
"webpack": "^5.98.0"
|
90
88
|
}
|
91
89
|
}
|
package/src/Nav/MobileNav.tsx
CHANGED
@@ -12,6 +12,7 @@ export const MobileNavbar: FC<MobileNavProps> = ({ open, toggleOpen }) => (
|
|
12
12
|
Box UI
|
13
13
|
</Typography>
|
14
14
|
<svg
|
15
|
+
role="button"
|
15
16
|
width="32"
|
16
17
|
height="32"
|
17
18
|
viewBox="0 0 32 32"
|
@@ -22,6 +23,7 @@ export const MobileNavbar: FC<MobileNavProps> = ({ open, toggleOpen }) => (
|
|
22
23
|
"opacity-0": open,
|
23
24
|
},
|
24
25
|
)}
|
26
|
+
data-testid= "mobile-nav-toggle"
|
25
27
|
onClick={toggleOpen}
|
26
28
|
>
|
27
29
|
<path
|
package/src/Nav/SideNav.tsx
CHANGED
package/src/Paginate.tsx
CHANGED
@@ -22,6 +22,7 @@ export const Paginate = ({
|
|
22
22
|
return (
|
23
23
|
<div className={classNames("flex w-full h-10 items-center", className)}>
|
24
24
|
<ArrowLeft
|
25
|
+
data-testid="prevBtn"
|
25
26
|
size={20}
|
26
27
|
className={classNames("mr-3 text-gray-500 dark:text-white", {
|
27
28
|
"cursor-pointer": page !== 0,
|
@@ -37,6 +38,7 @@ export const Paginate = ({
|
|
37
38
|
{`Page ${page} of ${totalPages}`}
|
38
39
|
</div>
|
39
40
|
<ArrowRight
|
41
|
+
data-testid="nextBtn"
|
40
42
|
size={20}
|
41
43
|
className={classNames("ml-3 text-gray-500 dark:text-white", {
|
42
44
|
"cursor-pointer": page !== totalPages - 1,
|
package/src/Select.tsx
CHANGED
@@ -56,7 +56,7 @@ export const Select: FC<SelectProps> = ({
|
|
56
56
|
},
|
57
57
|
width,)}>
|
58
58
|
{LeadingIcon && (
|
59
|
-
<div className="w-5 h-5 mr-2 overflow-hidden">
|
59
|
+
<div className="w-5 h-5 mr-2 overflow-hidden" data-testid="leading-icon">
|
60
60
|
{setProps(LeadingIcon, 20, classNames("text-gray-400"))}
|
61
61
|
</div>
|
62
62
|
)}
|
package/src/TextInput.tsx
CHANGED
@@ -18,18 +18,21 @@ export const TextInput: FC<TextInputProps> = ({
|
|
18
18
|
handleChange,
|
19
19
|
}) => {
|
20
20
|
const { setClassName } = useIconClassName();
|
21
|
+
const inputId = `textinput-${label?.toLowerCase().replace(/\s+/g, '-') || 'input'}`;
|
21
22
|
|
22
23
|
return (
|
23
24
|
<div>
|
24
25
|
{label && (
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
<label htmlFor={inputId}>
|
27
|
+
<Typography
|
28
|
+
variant="sm"
|
29
|
+
customWeight="medium"
|
30
|
+
customColor="text-gray-700 dark:text-white"
|
31
|
+
className="mb-1.5"
|
32
|
+
>
|
33
|
+
{label}
|
34
|
+
</Typography>
|
35
|
+
</label>
|
33
36
|
)}
|
34
37
|
<div
|
35
38
|
className={classNames("relative", { "flex items-center": leadingText })}
|
@@ -47,17 +50,18 @@ export const TextInput: FC<TextInputProps> = ({
|
|
47
50
|
variant="sm"
|
48
51
|
customWeight="regular"
|
49
52
|
className={classNames(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
"flex items-center h-11 text-lg text-gray-500 pl-3.5 pr-3 border border-r-0 rounded-l-lg border-gray-300 dark:border-gray-500",
|
54
|
+
{
|
55
|
+
"bg-gray-50 dark:bg-gray-700": disabled,
|
56
|
+
"dark:bg-gray-800": !disabled,
|
57
|
+
}
|
58
|
+
)}
|
56
59
|
>
|
57
60
|
{leadingText}
|
58
61
|
</Typography>
|
59
62
|
)}
|
60
63
|
<input
|
64
|
+
id={inputId}
|
61
65
|
type={type}
|
62
66
|
value={value}
|
63
67
|
placeholder={placeholder}
|
@@ -76,27 +80,19 @@ export const TextInput: FC<TextInputProps> = ({
|
|
76
80
|
error,
|
77
81
|
"bg-white dark:bg-gray-800": !disabled,
|
78
82
|
"bg-gray-50 dark:bg-gray-700": disabled,
|
79
|
-
}
|
83
|
+
}
|
80
84
|
)}
|
81
85
|
/>
|
82
86
|
</div>
|
83
87
|
{error && (
|
84
|
-
<
|
85
|
-
variant="sm"
|
86
|
-
customWeight="regular"
|
87
|
-
className="mt-1.5 text-error-500"
|
88
|
-
>
|
88
|
+
<label className="text-sm font-normal mt-1.5 text-error-500">
|
89
89
|
{error}
|
90
|
-
</
|
90
|
+
</label>
|
91
91
|
)}
|
92
92
|
{helperText && (
|
93
|
-
<
|
94
|
-
variant="sm"
|
95
|
-
customWeight="regular"
|
96
|
-
className="mt-1.5 text-gray-500"
|
97
|
-
>
|
93
|
+
<label className="text-sm font-normal mt-1.5 text-gray-500">
|
98
94
|
{helperText}
|
99
|
-
</
|
95
|
+
</label>
|
100
96
|
)}
|
101
97
|
</div>
|
102
98
|
);
|
package/src/index.js
CHANGED
@@ -5,18 +5,16 @@ import {images} from '../data/images'
|
|
5
5
|
import {Meta, StoryObj} from '@storybook/react';
|
6
6
|
import { StoryLayout } from '../StoryLayout';
|
7
7
|
import { FiArrowRight, FiStar } from 'react-icons/fi';
|
8
|
+
import { IconWrapper } from '../utils/IconWrapper';
|
8
9
|
|
9
|
-
|
10
|
+
export default {
|
10
11
|
title: 'Example/Badge',
|
11
12
|
component: Badge,
|
12
13
|
parameters: {
|
13
14
|
layout: 'centered',
|
14
15
|
},
|
15
16
|
tags: ['autodocs'],
|
16
|
-
}
|
17
|
-
|
18
|
-
export default meta;
|
19
|
-
|
17
|
+
} as Meta;
|
20
18
|
interface Props extends BadgeProps {
|
21
19
|
darkMode: boolean;
|
22
20
|
}
|
@@ -35,7 +33,7 @@ export const LeadingIconBadge:StoryObj<Props> = {
|
|
35
33
|
darkMode: false,
|
36
34
|
variant: "success",
|
37
35
|
size: "md",
|
38
|
-
LeadingIcon
|
36
|
+
LeadingIcon: <IconWrapper Icon={FiStar} data-testid="leadingIcon"/>
|
39
37
|
},
|
40
38
|
render: (args) => {
|
41
39
|
return (
|
@@ -53,7 +51,7 @@ export const ImageIconBadge:StoryObj<Props> = {
|
|
53
51
|
darkMode: false,
|
54
52
|
variant: "gray",
|
55
53
|
size: "md",
|
56
|
-
LeadingIcon: <img src={images.NL} alt="nl" className="w-4 h-4" />
|
54
|
+
LeadingIcon: <img src={images.NL} alt="nl" className="w-4 h-4" data-testid="iconOnly" />
|
57
55
|
},
|
58
56
|
render: (args) => {
|
59
57
|
return (
|
@@ -71,7 +69,7 @@ export const TrailingIconBadge:StoryObj<Props> = {
|
|
71
69
|
darkMode: false,
|
72
70
|
variant: "primary",
|
73
71
|
size: "md",
|
74
|
-
TrailingIcon: < FiArrowRight/>
|
72
|
+
TrailingIcon: <IconWrapper Icon={FiArrowRight} data-testid="trailingIcon"/>
|
75
73
|
},
|
76
74
|
render: (args) => {
|
77
75
|
return (
|
@@ -4,18 +4,16 @@ import { Button } from "../Button";
|
|
4
4
|
import { ButtonProps } from "../@interfaces";
|
5
5
|
import { FiArrowLeft, FiArrowRight, FiStar } from "react-icons/fi";
|
6
6
|
import { StoryLayout } from "../StoryLayout";
|
7
|
+
import { IconWrapper } from "../utils/IconWrapper";
|
7
8
|
|
8
|
-
|
9
|
+
export default{
|
9
10
|
title: "Example/Button",
|
10
11
|
component: Button,
|
11
12
|
parameters: {
|
12
13
|
layout: "centered",
|
13
14
|
},
|
14
15
|
tags: ["autodocs"],
|
15
|
-
};
|
16
|
-
|
17
|
-
export default meta;
|
18
|
-
|
16
|
+
} as Meta;
|
19
17
|
interface Props extends ButtonProps {
|
20
18
|
darkMode: boolean;
|
21
19
|
}
|
@@ -84,21 +82,36 @@ export const TrailingIconButton: Story = {
|
|
84
82
|
args: {
|
85
83
|
darkMode: false,
|
86
84
|
children: "Button",
|
87
|
-
TrailingIcon: <FiArrowRight />,
|
85
|
+
TrailingIcon: <IconWrapper Icon={FiArrowRight} data-testid="trailingIcon"/>,
|
88
86
|
},
|
87
|
+
render: (args) => (
|
88
|
+
<StoryLayout {...args}>
|
89
|
+
<Button {...args} />
|
90
|
+
</StoryLayout>
|
91
|
+
),
|
89
92
|
};
|
90
93
|
|
91
94
|
export const LeadingIconButton: Story = {
|
92
95
|
args: {
|
93
96
|
darkMode: false,
|
94
97
|
children: "Button",
|
95
|
-
LeadingIcon: <FiArrowLeft />,
|
98
|
+
LeadingIcon: <IconWrapper Icon={FiArrowLeft} data-testid="LeadingIcon"/>,
|
96
99
|
},
|
100
|
+
render: (args) => (
|
101
|
+
<StoryLayout {...args}>
|
102
|
+
<Button {...args} />
|
103
|
+
</StoryLayout>
|
104
|
+
),
|
97
105
|
};
|
98
106
|
|
99
107
|
export const IconOnlyButton: Story = {
|
100
108
|
args: {
|
101
109
|
darkMode: false,
|
102
|
-
IconOnly: <FiStar />,
|
110
|
+
IconOnly: <IconWrapper Icon={FiStar} data-testid="iconOnly"/>,
|
103
111
|
},
|
112
|
+
render: (args) => (
|
113
|
+
<StoryLayout {...args}>
|
114
|
+
<Button {...args} />
|
115
|
+
</StoryLayout>
|
116
|
+
),
|
104
117
|
};
|
@@ -4,80 +4,80 @@ import { ButtonGroupProps, ButtonGroup } from "../ButtonGroup";
|
|
4
4
|
import { StoryLayout } from "../StoryLayout";
|
5
5
|
import { options1, options2, options3 } from "../data/options";
|
6
6
|
|
7
|
-
|
7
|
+
export default {
|
8
8
|
title: "Example/ButtonGroup",
|
9
9
|
component: ButtonGroup,
|
10
10
|
parameters: {
|
11
11
|
layout: 'centered',
|
12
12
|
},
|
13
13
|
tags: ['autodocs'],
|
14
|
-
};
|
15
|
-
|
16
|
-
export default meta;
|
17
|
-
|
14
|
+
} as Meta;
|
18
15
|
interface Props extends ButtonGroupProps {
|
19
16
|
darkMode: boolean;
|
20
17
|
}
|
21
18
|
|
19
|
+
const LabelButtonGroupComponent = (args: Props) => {
|
20
|
+
const [activeItem1, setActiveItem1] = useState<string>(options1[1].value);
|
21
|
+
|
22
|
+
return (
|
23
|
+
<StoryLayout {...args}>
|
24
|
+
<ButtonGroup
|
25
|
+
{...args}
|
26
|
+
options={options1}
|
27
|
+
activeOption={activeItem1}
|
28
|
+
setActiveOption={setActiveItem1}
|
29
|
+
/>
|
30
|
+
</StoryLayout>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
22
34
|
export const LabelButtonGroup: StoryObj<Props> = {
|
23
35
|
args: {
|
24
36
|
darkMode: false,
|
25
37
|
},
|
26
|
-
render: (args) => {
|
27
|
-
|
38
|
+
render: (args) => <LabelButtonGroupComponent {...args} />,
|
39
|
+
};
|
28
40
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
const IconButtonGroupComponent = (args: Props) => {
|
42
|
+
const [activeView, setViewOption] = useState<string>("list");
|
43
|
+
|
44
|
+
return (
|
45
|
+
<StoryLayout {...args}>
|
46
|
+
<ButtonGroup
|
47
|
+
{...args}
|
48
|
+
options={options3}
|
49
|
+
activeOption={activeView}
|
50
|
+
setActiveOption={setViewOption}
|
51
|
+
/>
|
52
|
+
</StoryLayout>
|
53
|
+
);
|
41
54
|
};
|
42
55
|
|
43
56
|
export const IconButtonGroup: StoryObj<Props> = {
|
44
57
|
args: {
|
45
58
|
darkMode: false,
|
46
59
|
},
|
47
|
-
render: (args) => {
|
48
|
-
|
60
|
+
render: (args) => <IconButtonGroupComponent {...args} />,
|
61
|
+
};
|
49
62
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
63
|
+
const LabelIconButtonGroupComponent = (args: Props) => {
|
64
|
+
const [activeItem2, setActiveItem2] = useState<string>(options2[1].value);
|
65
|
+
|
66
|
+
return (
|
67
|
+
<StoryLayout {...args}>
|
68
|
+
<ButtonGroup
|
69
|
+
{...args}
|
70
|
+
options={options2}
|
71
|
+
activeOption={activeItem2}
|
72
|
+
setActiveOption={setActiveItem2}
|
73
|
+
/>
|
74
|
+
</StoryLayout>
|
75
|
+
);
|
62
76
|
};
|
63
77
|
|
64
78
|
export const LabelIconButtonGroup: StoryObj<Props> = {
|
65
79
|
args: {
|
66
80
|
darkMode: false,
|
67
81
|
},
|
68
|
-
render: (args) => {
|
69
|
-
const [activeItem2, setActiveItem2] = useState<string>(options2[1].value);
|
70
|
-
|
71
|
-
return (
|
72
|
-
<StoryLayout {...args}>
|
73
|
-
<div>
|
74
|
-
<ButtonGroup
|
75
|
-
options={options2}
|
76
|
-
activeOption={activeItem2}
|
77
|
-
setActiveOption={setActiveItem2}
|
78
|
-
/>
|
79
|
-
</div>
|
80
|
-
</StoryLayout>
|
81
|
-
);
|
82
|
-
},
|
82
|
+
render: (args) => <LabelIconButtonGroupComponent {...args} />,
|
83
83
|
};
|
@@ -4,14 +4,12 @@ import { ColorBox } from "../ColorBox";
|
|
4
4
|
import { colors } from "../data/colors";
|
5
5
|
import { StoryLayout } from "../StoryLayout";
|
6
6
|
|
7
|
-
|
7
|
+
export default {
|
8
8
|
title: "Colors",
|
9
9
|
parameters: {
|
10
10
|
controls: { expanded: true },
|
11
11
|
},
|
12
|
-
};
|
13
|
-
|
14
|
-
export default meta;
|
12
|
+
} as Meta;
|
15
13
|
|
16
14
|
interface Props {
|
17
15
|
darkMode: boolean;
|