jamespot-react-components 1.0.256 → 1.0.258

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 (26) hide show
  1. package/README.md +48 -4
  2. package/build/jamespot-react-components.js +760 -760
  3. package/build/jamespot-react-components.js.LICENSE.txt +10 -0
  4. package/build/jamespot-react-components.js.map +1 -1
  5. package/build/src/components/Common/DashedFocusBorder.d.ts +5 -4
  6. package/build/src/components/Common/DashedFocusBorder.stories.d.ts +6 -0
  7. package/build/src/components/Form/Input/JRCSelect/JRCInputSelect.style.d.ts +2 -1
  8. package/build/src/components/JRCButton/JRCButton.stories.d.ts +13 -0
  9. package/build/src/components/JRCButtonDropdown/JRCButtonDropdown.stories.d.ts +5 -0
  10. package/build/src/components/JRCHtml/JRCHtml.d.ts +1 -1
  11. package/build/src/components/JRCIcon/JRCIcon.stories.d.ts +8 -0
  12. package/build/src/components/JRCLoader/JRCLoader.stories.d.ts +6 -0
  13. package/build/src/components/JRCTooltip/JRCTooltip.stories.d.ts +11 -0
  14. package/build/src/components/JRCTypography/JRCTypography.stories.d.ts +5 -0
  15. package/build/src/styles/theme.d.ts +1 -0
  16. package/build/src/styles/utils.d.ts +1 -2
  17. package/jest.config.ts +4 -1
  18. package/package.json +23 -6
  19. package/build/src/components/Widgets/utils.test.d.ts +0 -1
  20. package/build/src/utils/utils.files.test.d.ts +0 -1
  21. /package/build/src/components/JRCAvatar/{JRCAvatar.test.d.ts → JRCAvatar.oldtest.d.ts} +0 -0
  22. /package/build/src/components/{JRCButton/JRCButton.test.d.ts → JRCHtml/JRCHtml.oldtest.d.ts} +0 -0
  23. /package/build/src/components/{JRCHtml/JRCHtml.test.d.ts → JRCImg/JRCImg.oldtest.d.ts} +0 -0
  24. /package/build/src/components/{JRCImg/JRCImg.test.d.ts → JRCPagination/JRCPagination.oldtest.d.ts} +0 -0
  25. /package/build/src/components/{JRCPagination/JRCPagination.test.d.ts → Widgets/utils.oldtest.d.ts} +0 -0
  26. /package/build/src/{components/JRCTypography/JRCTypography.test.d.ts → utils/utils.files.oldtest.d.ts} +0 -0
@@ -3,12 +3,13 @@ export type DashedFocusBorderProps = {
3
3
  offset?: string;
4
4
  focusColor?: string;
5
5
  };
6
+ export type DashedFocusBorderNormalProps = {
7
+ offset?: string;
8
+ color?: Colors;
9
+ };
6
10
  /**
7
11
  * The HTML element this styled is applied to should be selectable
8
12
  * @props offset offset of the dashed focus border, default to 2px
9
13
  */
10
- export declare const DashedFocusBorder: (args?: {
11
- offset?: string;
12
- color?: Colors;
13
- }) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
14
+ export declare const DashedFocusBorder: (args?: DashedFocusBorderNormalProps) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
14
15
  export declare const DashedFocusBorderAbsolute: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<DashedFocusBorderProps, import("styled-components").DefaultTheme>>;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryFn } from '@storybook/react';
2
+ import { DashedFocusBorderNormalProps, DashedFocusBorderProps } from './DashedFocusBorder';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const CustomContainer: StoryFn<DashedFocusBorderNormalProps>;
6
+ export declare const AbsoluteDashedBorder: StoryFn<DashedFocusBorderProps>;
@@ -318,9 +318,10 @@ export declare const IconBefore: import("styled-components").StyledComponent<({
318
318
  export declare const TimesIndicator: ({ onClick }: {
319
319
  onClick?: (() => void) | undefined;
320
320
  }) => React.JSX.Element;
321
- export declare const DropdownIndicator: ({ loading, open, onClick, sizeVariant, }: {
321
+ export declare const DropdownIndicator: ({ loading, open, onClick, sizeVariant, disabled, }: {
322
322
  loading: boolean;
323
323
  open: boolean;
324
324
  onClick?: (() => void) | undefined;
325
325
  sizeVariant?: "s" | "md" | undefined;
326
+ disabled?: boolean | undefined;
326
327
  }) => React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { JRCButtonProps } from './JRCButton';
3
+ import { JRCValidationButton, JRCValidationButtonProps } from './JRCValidationButton';
4
+ import { Meta, StoryFn, StoryObj } from '@storybook/react';
5
+ declare const meta: Meta;
6
+ export default meta;
7
+ export declare const ButtonWithChildren: StoryFn<JRCButtonProps>;
8
+ export declare const ButtonWithLabel: StoryFn<JRCButtonProps>;
9
+ export declare const AllButtons: () => React.JSX.Element;
10
+ export declare const ValidationButton: StoryFn<JRCValidationButtonProps>;
11
+ type Story = StoryObj<typeof JRCValidationButton>;
12
+ export declare const ValidationButtonClicked: Story;
13
+ export declare const ValidationButtonClickReset: Story;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryFn } from '@storybook/react';
2
+ import type { JRCButtonDropdownProps } from './JRCButtonDropdown.types';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const ButtonDropdown: StoryFn<JRCButtonDropdownProps>;
@@ -7,6 +7,6 @@ export type JRCHtmlProps = LimitLinesProps & {
7
7
  };
8
8
  export declare const JRCHtml: React.ForwardRefExoticComponent<LimitLinesProps & {
9
9
  className?: string | undefined;
10
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "g" | "circle" | "big" | "keygen" | "menuitem" | "noindex" | "param" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
10
+ as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "g" | "filter" | "circle" | "big" | "keygen" | "menuitem" | "noindex" | "param" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
11
11
  __html: string | undefined;
12
12
  } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { JRCIcon } from './JRCIcon';
3
+ import { Meta, StoryObj } from '@storybook/react';
4
+ declare const meta: Meta;
5
+ export default meta;
6
+ type Story = StoryObj<typeof JRCIcon>;
7
+ export declare const Primary: Story;
8
+ export declare const AllIcons: () => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { JRCLoaderProps } from './JRCLoader';
2
+ import { Meta, StoryFn } from '@storybook/react';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Spinner: StoryFn<JRCLoaderProps>;
6
+ export declare const Skeleton: StoryFn<JRCLoaderProps>;
@@ -0,0 +1,11 @@
1
+ import { JRCTooltip, JRCTooltipProps } from './JRCTooltip';
2
+ import { Meta, StoryFn, StoryObj } from '@storybook/react';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Default: StoryFn<JRCTooltipProps>;
6
+ export declare const SmallTooltip: StoryFn<JRCTooltipProps>;
7
+ export declare const LargeTooltipWithTitle: StoryFn<JRCTooltipProps>;
8
+ export declare const LargeTooltipWithoutTitle: StoryFn<JRCTooltipProps>;
9
+ export declare const LargeTooltipWithButton: StoryFn<JRCTooltipProps>;
10
+ type Story = StoryObj<typeof JRCTooltip>;
11
+ export declare const TooltipWithButtonTest: Story;
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryFn } from '@storybook/react';
2
+ import { JRCTypographyProps } from './JRCTypography.d';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Typography: StoryFn<JRCTypographyProps>;
@@ -78,5 +78,6 @@ export type ThemeType = {
78
78
  };
79
79
  };
80
80
  export declare function getColor(theme: ThemeType, color: string): string;
81
+ export declare const defaultColors: ThemeConfigOptions;
81
82
  declare const Theme: ITheme;
82
83
  export default Theme;
@@ -7,8 +7,7 @@ export declare const HSBToRGB: (hue: number, saturation: number, brightness: num
7
7
  export declare const RGBToHSB: (r: number, g: number, b: number) => number[];
8
8
  export declare const hexToHSL: (H: any) => number[];
9
9
  export declare function hlsToHex(h: number, s: number, l: number): string[];
10
- export declare const hexAToHSLA: (H: any) => number[];
11
- export declare const RGBToHSL: (rgb: any) => number[];
10
+ export declare const RGBToHSL: (rgb: string) => number[];
12
11
  declare const _default: {
13
12
  getLightShade: (hex: string, lightPercentage: number) => string;
14
13
  getDarkShade: (hex: string, darkPercentage: number) => string;
package/jest.config.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  // eslint-disable-next-line no-undef
2
2
  module.exports = {
3
3
  roots: ['<rootDir>'],
4
+ // TODO: do tests on utils files and usils misc and remove them from below
4
5
  testMatch: ['**/*.test.(ts|tsx)'],
5
6
  testEnvironment: 'jsdom',
6
7
  transform: {
7
- '^.+\\.(ts|tsx)?$': 'ts-jest',
8
+ '^.+\\.(ts|tsx)?$': 'babel-jest',
8
9
  '\\.(svg|jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
9
10
  '<rootDir>/src/jest/fileMock.js',
10
11
  },
@@ -15,4 +16,6 @@ module.exports = {
15
16
  },
16
17
  cacheDirectory: './node_modules/.cache/jest',
17
18
  collectCoverage: true,
19
+ //TODO: remove misc from here too for coverage info
20
+ coveragePathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/src/utils/utils\\.misc\\.ts'],
18
21
  };
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.256",
3
+ "version": "1.0.258",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
7
+ "nyc": {
8
+ "sourceMap": false,
9
+ "instrument": false
10
+ },
7
11
  "keywords": [],
8
12
  "author": "",
9
13
  "devDependencies": {
@@ -14,12 +18,17 @@
14
18
  "@babel/preset-react": "^7.12.7",
15
19
  "@babel/preset-typescript": "^7.12.7",
16
20
  "@chromatic-com/storybook": "^3",
21
+ "@istanbuljs/nyc-config-typescript": "^1.0.2",
22
+ "@lcov-viewer/istanbul-report": "^1.4.0",
23
+ "@storybook/addon-a11y": "^8.6.12",
17
24
  "@storybook/addon-actions": "^8.6.12",
25
+ "@storybook/addon-coverage": "^1.0.5",
18
26
  "@storybook/addon-essentials": "^8.6.12",
19
27
  "@storybook/addon-links": "^8.6.12",
20
28
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
21
29
  "@storybook/react": "^8.6.12",
22
30
  "@storybook/react-webpack5": "^8.6.12",
31
+ "@storybook/test-runner": "^0.22.0",
23
32
  "@testing-library/dom": "^8.11.0",
24
33
  "@testing-library/jest-dom": "^5.12.0",
25
34
  "@testing-library/react": "^12.1.2",
@@ -46,8 +55,10 @@
46
55
  "@typescript-eslint/parser": "^5.4.0",
47
56
  "babel-jest": "^27.3.1",
48
57
  "babel-loader": "^8.2.1",
58
+ "babel-plugin-istanbul": "^7.0.0",
49
59
  "babel-plugin-react-intl": "^8.1.1",
50
60
  "babel-plugin-styled-components": "^1.12.0",
61
+ "concurrently": "^9.1.2",
51
62
  "cross-env": "^6.0.3",
52
63
  "css-loader": "^4.2.1",
53
64
  "eslint": "^8.2.0",
@@ -59,20 +70,23 @@
59
70
  "html-webpack-plugin": "^5.5.0",
60
71
  "husky": "^7.0.4",
61
72
  "identity-obj-proxy": "^3.0.0",
62
- "jest": "^27.3.1",
73
+ "jest": "^27.5.1",
63
74
  "jest-styled-components": "^7.0.3",
64
75
  "lint-staged": "^12.0.2",
76
+ "nyc": "^17.1.0",
65
77
  "prettier": "^2.4.1",
66
78
  "react-docgen-typescript-plugin": "^1.0.8",
67
79
  "react-test-renderer": "^17.0.1",
68
80
  "redux-form": "^8.3.8",
69
81
  "source-map-loader": "^1.0.1",
82
+ "storybook": "^8.6.12",
70
83
  "storybook-addon-react-docgen": "^1.2.44",
71
84
  "style-loader": "^1.2.1",
72
85
  "ts-jest": "^27.0.7",
73
86
  "ts-loader": "^8.0.2",
74
87
  "ts-node": "^10.3.0",
75
88
  "typescript": "^4.4.4",
89
+ "wait-on": "^8.0.3",
76
90
  "webpack": "^5.62.1",
77
91
  "webpack-cli": "^4.9.1",
78
92
  "webpack-dev-server": "^4.4.0"
@@ -82,7 +96,7 @@
82
96
  "chroma-js": "^2.1.1",
83
97
  "classnames": "^2.3.1",
84
98
  "dompurify": "^3.0.5",
85
- "jamespot-user-api": "^1.0.227",
99
+ "jamespot-user-api": "^1.0.229",
86
100
  "react": "^17.x",
87
101
  "react-beautiful-dnd": "^13.1.1",
88
102
  "react-dnd": "^14.0.4",
@@ -126,6 +140,7 @@
126
140
  "dev": "webpack --env NODE_ENV=development",
127
141
  "local": "webpack --env NODE_ENV=development WATCH=true",
128
142
  "build": "webpack --env NODE_ENV=production",
143
+ "build-storybook": "storybook build",
129
144
  "build-theme": "webpack --env NODE_ENV=theme",
130
145
  "build-dev-vm": "webpack --env NODE_ENV=development NODE_RUN=VM",
131
146
  "watch-dev-vm": "webpack --env NODE_ENV=development NODE_RUN=VM WATCH=true",
@@ -133,10 +148,12 @@
133
148
  "lint": "npx eslint ./src/ . --ext .ts,.tsx,.js",
134
149
  "lint:fix": "npx eslint ./src/ . --ext .ts,.tsx,.js --fix ",
135
150
  "lint:ci": "npx eslint --output-file eslint_report.json --format json . --ext .ts,.tsx,.js",
136
- "test": "jest --updateSnapshot --runInBand",
137
- "test:watch": "npm run test -- --watch --verbose",
138
151
  "storybook": "storybook dev -p 6006",
139
152
  "storybook-no-cache": "cross-env NODE_ENV=development STORYBOOK_MODE=true PUBLIC_PATH='' storybook dev -s ./.storybook/assets/ -c .storybook -p 3022 --no-manager-cache",
140
- "build-storybook": "storybook build"
153
+ "test": "concurrently -k -s command-TEST -n \"SB,TEST\" -c \"magenta,blue\" \"pnpm storybook --quiet --ci\" \"wait-on tcp:6006 && pnpm test:all\"",
154
+ "test:all": "cross-env NODE_ENV=test jest --runInBand --detectOpenHandles --logHeapUsage && test-storybook --maxWorkers=1 --coverage && cp coverage/storybook/coverage-storybook.json coverage && nyc report -t coverage --reporter=@lcov-viewer/istanbul-report --check-coverage --reporter=text --statements 100",
155
+ "test:clearJest": "jest --clearCache --detectOpenHandles --logHeapUsage",
156
+ "test:jest": "cross-env NODE_ENV=test jest --runInBand",
157
+ "test:storybook": "test-storybook --maxWorkers=4 --coverage"
141
158
  }
142
159
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};