@onewelcome/react-lib-components 0.1.10-alpha → 0.2.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/README.md +13 -11
- package/dist/Tiles/Tile.d.ts +3 -3
- package/dist/Typography/Typography.d.ts +1 -2
- package/dist/_BaseStyling_/BaseStyling.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/react-lib-components.cjs.development.js +129 -99
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +129 -100
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +8 -8
- package/src/ContextMenu/ContextMenu.module.scss +2 -5
- package/src/ContextMenu/ContextMenu.tsx +1 -1
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +1 -0
- package/src/Form/Input/Input.module.scss +15 -2
- package/src/Form/Select/Select.module.scss +25 -18
- package/src/Form/Select/Select.tsx +1 -1
- package/src/Form/Textarea/Textarea.module.scss +8 -7
- package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +2 -1
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +4 -1
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +2 -2
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss +1 -1
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +13 -13
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +1 -1
- package/src/Pagination/Pagination.module.scss +4 -0
- package/src/Pagination/Pagination.tsx +1 -1
- package/src/Popover/Popover.tsx +1 -1
- package/src/Tiles/Tile.tsx +7 -2
- package/src/Typography/Typography.tsx +10 -2
- package/src/_BaseStyling_/BaseStyling.tsx +2 -0
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -2,30 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
This project provides React components built according to the [UI Component Library design](https://xd.adobe.com/view/1f7161d7-5ade-4e54-bb3d-6e4aa3a1d1a0-4a22/grid/). It uses the [DTS tool](https://weiran-zsd.github.io/dts-cli/) which provides for a consistent setup and configuration.
|
|
4
4
|
|
|
5
|
-
> Note: the package is publicly available.
|
|
5
|
+
> Note: the package is publicly available [on npm](https://www.npmjs.com/package/@onewelcome/react-lib-components).
|
|
6
6
|
|
|
7
7
|
## Commands
|
|
8
8
|
|
|
9
9
|
### Component library
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
When you are developing for the component library, you're going to want to run the Typescript compiler, test watcher and storybook. Please see the commands below for more information.
|
|
12
|
+
|
|
13
|
+
Run the Typescript compiler:
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
npm start
|
|
16
|
+
npm start
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
|
|
18
20
|
|
|
19
|
-
To run tests, use `npm test`
|
|
21
|
+
To run tests, use `npm test`
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
|
-
npm test
|
|
24
|
+
npm test
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
For running and watching tests, use `npm
|
|
27
|
+
For running and watching tests, use `npm test -- --watch`.
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
|
-
npm
|
|
30
|
+
npm test -- --watch
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
### Storybook
|
|
@@ -33,7 +35,7 @@ npm run test:watch
|
|
|
33
35
|
Run Storybook locally:
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
|
-
npm run storybook
|
|
38
|
+
npm run storybook
|
|
37
39
|
```
|
|
38
40
|
|
|
39
41
|
### All at once
|
|
@@ -52,13 +54,13 @@ Please see the [CONTRIBUTING.md](https://github.com/onewelcome/react-lib-compone
|
|
|
52
54
|
|
|
53
55
|
See [adding icons to font manual](font/README.md)
|
|
54
56
|
|
|
55
|
-
##
|
|
57
|
+
## Code quality
|
|
56
58
|
|
|
57
|
-
Code quality is set up for you with `prettier`, `husky`, and `lint-staged`.
|
|
59
|
+
Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. This is to ensure that formatting is the same in every file of the component library. If you would like to suggest a change, please let the `SASSy` team know.
|
|
58
60
|
|
|
59
61
|
### Bundle analysis
|
|
60
62
|
|
|
61
|
-
Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and
|
|
63
|
+
Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visualise it with `npm run analyze`.
|
|
62
64
|
|
|
63
65
|
### Rollup
|
|
64
66
|
|
package/dist/Tiles/Tile.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { ComponentPropsWithRef, ReactElement } from 'react';
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactElement } from 'react';
|
|
2
2
|
import { Props as ContextMenuProps } from '../ContextMenu/ContextMenu';
|
|
3
3
|
import { Props as IconButtonProps } from '../Button/IconButton';
|
|
4
|
-
interface ImageProps {
|
|
4
|
+
interface ImageProps extends ComponentPropsWithoutRef<'img'> {
|
|
5
5
|
src: string;
|
|
6
6
|
}
|
|
7
7
|
export interface Props extends ComponentPropsWithRef<'div'> {
|
|
@@ -11,5 +11,5 @@ export interface Props extends ComponentPropsWithRef<'div'> {
|
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
tileAction?: ReactElement<ContextMenuProps> | ReactElement<IconButtonProps>;
|
|
13
13
|
}
|
|
14
|
-
export declare const Tile: React.ForwardRefExoticComponent<Pick<Props, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "imageProps" | "enabled" | "
|
|
14
|
+
export declare const Tile: React.ForwardRefExoticComponent<Pick<Props, "slot" | "style" | "title" | "key" | "loading" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "imageProps" | "enabled" | "tileAction"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import { Spacing } from '../hooks/useSpacing';
|
|
3
|
-
declare const validVariants: readonly ["h1", "h2", "h3", "h4", "body", "body-bold", "sub-text", "code"];
|
|
3
|
+
export declare const validVariants: readonly ["h1", "h2", "h3", "h4", "body", "body-bold", "sub-text", "code"];
|
|
4
4
|
export declare type Variant = typeof validVariants[number];
|
|
5
5
|
declare type Tags = 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'div' | 'code' | 'span' | 'sup' | 'sub' | 'strong' | 'em' | 'small' | 'mark' | 'del' | 'ins' | 'blockquote';
|
|
6
|
-
/** I couldn't find anything on the internet that indicated that ComponentPropsWithRef can take multiple tags. Since the TagName can be many different things I have to use any here. Using a mix of tags (like the Tags type) will throw an error. */
|
|
7
6
|
export interface Props extends ComponentPropsWithRef<any> {
|
|
8
7
|
children: ReactNode;
|
|
9
8
|
variant: Variant;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { Tiles, Props as TilesProps } from './Tiles/Tiles';
|
|
|
14
14
|
export { Tooltip, Props as TooltipProps } from './Tooltip/Tooltip';
|
|
15
15
|
export { Typography, Variant, Props as TypographyProps } from './Typography/Typography';
|
|
16
16
|
export { Skeleton, Props as SkeletonProps } from './Skeleton/Skeleton';
|
|
17
|
+
export { StatusIndicator, Props as StatusIndicatorProps } from './StatusIndicator/StatusIndicator';
|
|
17
18
|
export { Pagination, Props as PaginationProps, PageChangeLabels, PaginationTranslations, PageSize, } from './Pagination/Pagination';
|
|
18
19
|
export { useRepeater } from './hooks/useRepeater';
|
|
19
20
|
export { generateID } from './util/helper';
|