@luscii-healthtech/web-ui 0.0.0-alpha.ab3fdb2 → 0.0.0-alpha.ccdf511
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 +78 -74
- package/dist/components/Accordion/Accordion.d.ts +6 -1
- package/dist/components/Accordion/AccordionItem.d.ts +10 -2
- package/dist/components/AccordionList/AccordionList.d.ts +17 -4
- package/dist/components/AccordionList/subcomponents/AccordionListActions.d.ts +18 -0
- package/dist/components/Avatar/Avatar.d.ts +23 -0
- package/dist/components/ButtonV2/ButtonProps.type.d.ts +5 -0
- package/dist/components/Card/Actions.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +54 -9
- package/dist/components/Card/Padding.d.ts +6 -0
- package/dist/components/Card/Section.d.ts +6 -0
- package/dist/components/Card/TopBar.d.ts +9 -0
- package/dist/components/Carousel/Carousel.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +46 -1
- package/dist/components/CheckboxList/CheckboxGroup.d.ts +1 -1
- package/dist/components/CheckboxList/CheckboxList.d.ts +1 -2
- package/dist/components/CheckboxList/CheckboxList.types.d.ts +35 -13
- package/dist/components/Container/types/FlexContainerProps.type.d.ts +2 -2
- package/dist/components/Divider/Divider.d.ts +13 -2
- package/dist/components/FilterBar/ActiveFilters.d.ts +9 -0
- package/dist/components/FilterBar/FilterBar.d.ts +96 -0
- package/dist/components/FilterBar/FilterBar.utils.d.ts +32 -0
- package/dist/components/FilterBar/FilterBarProps.type.d.ts +86 -0
- package/dist/components/FilterBar/FiltersMenus.d.ts +8 -0
- package/dist/components/FilterBar/SortMenu.d.ts +9 -0
- package/dist/components/FilterBar/index.d.ts +2 -0
- package/dist/components/Form/FormImagePicker.d.ts +3 -3
- package/dist/components/Form/form.types.d.ts +9 -8
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icons/FireIcon.d.ts +4 -0
- package/dist/components/Icons/FirstAidKitIcon.d.ts +4 -0
- package/dist/components/Icons/FlagIcon.d.ts +4 -0
- package/dist/components/Icons/ForwardIcon.d.ts +4 -0
- package/dist/components/Icons/GroupOfThreeIcon.d.ts +4 -0
- package/dist/components/Icons/HandshakeIcon.d.ts +4 -0
- package/dist/components/Icons/HomeIcon.d.ts +4 -0
- package/dist/components/Icons/LifebuoyIcon.d.ts +4 -0
- package/dist/components/Icons/LogInIcon.d.ts +4 -0
- package/dist/components/Icons/LogOutIcon.d.ts +4 -0
- package/dist/components/Icons/MessageWithArrowIcon.d.ts +4 -0
- package/dist/components/Icons/MoreIcon.d.ts +4 -0
- package/dist/components/Icons/NoteIcon.d.ts +4 -0
- package/dist/components/Icons/PageViewIcon.d.ts +4 -0
- package/dist/components/Icons/PatientIcon.d.ts +4 -0
- package/dist/components/Icons/PencilIcon.d.ts +4 -0
- package/dist/components/Icons/PhoneIcon.d.ts +4 -0
- package/dist/components/Icons/PieChartIcon.d.ts +4 -0
- package/dist/components/Icons/PlusIcon.d.ts +4 -0
- package/dist/components/Icons/PrinterIcon.d.ts +4 -0
- package/dist/components/Icons/RobotIcon.d.ts +4 -0
- package/dist/components/Icons/RocketIcon.d.ts +4 -0
- package/dist/components/Icons/ShareIcon.d.ts +4 -0
- package/dist/components/Icons/TrashBinIcon.d.ts +4 -0
- package/dist/components/Icons/TreeIcon.d.ts +4 -0
- package/dist/components/Icons/index.d.ts +224 -23
- package/dist/components/Icons/special-icons/ChartLineColoredIcon.d.ts +4 -0
- package/dist/components/Icons/special-icons/GearColoredIcon.d.ts +4 -0
- package/dist/components/Icons/special-icons/GroupColoredIcon.d.ts +4 -0
- package/dist/components/Icons/special-icons/StatusColoredIcon.d.ts +4 -0
- package/dist/components/Icons/special-icons/index.d.ts +4 -0
- package/dist/components/InfoField/InfoField.d.ts +19 -9
- package/dist/components/Input/Input.d.ts +1 -2
- package/dist/components/Input/SearchInput.d.ts +23 -3
- package/dist/components/Link/Link.d.ts +19 -0
- package/dist/components/{ImagePicker → MediaPicker}/ImageCategory.d.ts +2 -2
- package/dist/components/MediaPicker/MediaPicker.d.ts +91 -0
- package/dist/components/Modal/FullPageModal.d.ts +31 -1
- package/dist/components/Modal/FullPageModalHeader.d.ts +6 -0
- package/dist/components/Modal/Modal.d.ts +6 -1
- package/dist/components/Modal/subcomponents/FullPageModalActions.d.ts +18 -0
- package/dist/components/NavMenu/NavLayout.d.ts +30 -15
- package/dist/components/NavMenu/types/NavMenuHeaderProps.type.d.ts +6 -0
- package/dist/components/NotificationBanner/NotificationBanner.d.ts +1 -1
- package/dist/components/Page/CRUDPage.types.d.ts +5 -1
- package/dist/components/PageHeader/PageHeader.types.d.ts +4 -0
- package/dist/components/PreviewPhone/PreviewPhone.d.ts +1 -1
- package/dist/components/Section/Section.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +9 -3
- package/dist/components/Spinner/Spinner.d.ts +2 -2
- package/dist/components/Tabbar/Tabbar.d.ts +4 -1
- package/dist/components/Table/Table.types.d.ts +1 -2
- package/dist/components/Tag/Tag.d.ts +23 -14
- package/dist/components/Tag/TagGroup.d.ts +22 -9
- package/dist/components/Text/Text.d.ts +78 -29
- package/dist/components/TextEditor/TextEditor.d.ts +53 -0
- package/dist/components/TextLink/TextLink.d.ts +3 -0
- package/dist/components/Textarea/Textarea.d.ts +4 -0
- package/dist/components/Timeline/TimelineHeader.d.ts +1 -1
- package/dist/components/Title/PageTitle.d.ts +6 -0
- package/dist/components/Title/Title.d.ts +18 -4
- package/dist/components/Toaster/toast-progress-animator.d.ts +1 -1
- package/dist/components/UnorderedList/UnorderedList.d.ts +61 -0
- package/dist/components/VerticalMenu/VerticalMenu.d.ts +86 -0
- package/dist/components/WeekdaysPicker/WeekdaysPicker.d.ts +42 -0
- package/dist/index.d.ts +22 -14
- package/dist/index.development.js +6168 -0
- package/dist/index.development.js.map +1 -0
- package/dist/index.js +1 -1356
- package/dist/index.js.map +1 -1
- package/dist/web-ui-tailwind.css +1304 -528
- package/dist/web-ui.esm.js +1 -1356
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +59 -54
- package/dist/components/CheckboxList/CheckboxListItem.d.ts +0 -3
- package/dist/components/Icons/templates/component.d.ts +0 -3
- package/dist/components/Icons/templates/index.d.ts +0 -2
- package/dist/components/ImagePicker/ImagePicker.d.ts +0 -29
- package/dist/components/TabLinks/TabLinks.d.ts +0 -14
- package/dist/components/Tag/Tag.utils.d.ts +0 -4
- /package/dist/components/Icons/{AddIcon.d.ts → BrushIcon.d.ts} +0 -0
- /package/dist/components/Icons/{AlertsIcon.d.ts → CalendarDayIcon.d.ts} +0 -0
- /package/dist/components/Icons/{ChartIcon.d.ts → CalendarMonthIcon.d.ts} +0 -0
- /package/dist/components/Icons/{ChartLineColoredIcon.d.ts → CalendarRepeatIcon.d.ts} +0 -0
- /package/dist/components/Icons/{ChatBoxIcon.d.ts → ChartBarsIcon.d.ts} +0 -0
- /package/dist/components/Icons/{DeleteIcon.d.ts → ChartLineAndBarsIcon.d.ts} +0 -0
- /package/dist/components/Icons/{DownArrowIcon.d.ts → ChatBubbleIcon.d.ts} +0 -0
- /package/dist/components/Icons/{DragIcon.d.ts → ChatBubbleWithTextIcon.d.ts} +0 -0
- /package/dist/components/Icons/{EditIcon.d.ts → ChevronLeftIcon.d.ts} +0 -0
- /package/dist/components/Icons/{EmptyStateDashboardIcon.d.ts → ClockIcon.d.ts} +0 -0
- /package/dist/components/Icons/{EyeIcon.d.ts → CogwheelIcon.d.ts} +0 -0
- /package/dist/components/Icons/{GearColoredIcon.d.ts → CopyToClipboardIcon.d.ts} +0 -0
- /package/dist/components/Icons/{GearIcon.d.ts → CrossInCircleIcon.d.ts} +0 -0
- /package/dist/components/Icons/{GroupColoredIcon.d.ts → CrossInFilledCircleIcon.d.ts} +0 -0
- /package/dist/components/Icons/{LeftArrowIcon.d.ts → DatabaseIcon.d.ts} +0 -0
- /package/dist/components/Icons/{MessagesIcon.d.ts → DragIndicatorIcon.d.ts} +0 -0
- /package/dist/components/Icons/{NotesIcon.d.ts → EarthIcon.d.ts} +0 -0
- /package/dist/components/Icons/{PrintIcon.d.ts → EmailIcon.d.ts} +0 -0
- /package/dist/components/Icons/{RightArrowIcon.d.ts → ExportIcon.d.ts} +0 -0
- /package/dist/components/Icons/{SearchCancelIcon.d.ts → EyeClosedIcon.d.ts} +0 -0
- /package/dist/components/Icons/{SpaceRocketIcon.d.ts → EyeIconSlashed.d.ts} +0 -0
- /package/dist/components/Icons/{StatusColoredIcon.d.ts → EyeOpenIcon.d.ts} +0 -0
- /package/dist/components/Icons/{WarningIcon.d.ts → FilterIcon.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,109 +1,113 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WebUI
|
|
2
2
|
|
|
3
|
-
The web-ui repository contains the
|
|
3
|
+
The `web-ui` repository contains the UI components for Luscii's frontend projects. It is published to NPM for usage into our projects. It uses Storybook and is published to Chromatic for easy review and tracking of visual changes.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Table of contents
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- 🚀 [Getting started](#getting-started)
|
|
8
|
+
- 📖 [Fonts](#fonts)
|
|
9
|
+
- 📦 [How to use](#how-to-use)
|
|
10
|
+
- 🤝 [Contributing](#contributing)
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
yarn install
|
|
11
|
-
yarn storybook
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Testing your production build
|
|
12
|
+
## Getting started
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
To use WebUI, you need to add it as a dependency to your project:
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- You have ran `yarn build` on `web-ui`
|
|
21
|
-
|
|
22
|
-
Run the script below in your terminal, _in the parent folder of the repositories_.
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
cp -a web-ui/dist/. cVitals-Web/node_modules/@luscii-healthtech/web-ui/dist
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @luscii-healthtech/web-ui
|
|
26
18
|
```
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
Then you can use components like this:
|
|
29
21
|
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
When you run cVitals again, it should contain your latest updates in the component library. Use this to make sure your changes are solid before merging a pull request.
|
|
35
|
-
|
|
36
|
-
## Contributing
|
|
37
|
-
|
|
38
|
-
Make sure you understand our design system and follow its guidelines. They are document in storybook. We value consistency, simplicity and usability highly. Don't mess it up.
|
|
39
|
-
|
|
40
|
-
If you want to add components, do so in
|
|
22
|
+
```tsx
|
|
23
|
+
import { Text } from "@luscii-healthtech/web-ui";
|
|
41
24
|
|
|
25
|
+
function MyComponent() {
|
|
26
|
+
return <Text>Some beautiful text from WebUI!</Text>;
|
|
27
|
+
}
|
|
42
28
|
```
|
|
43
|
-
/src/components
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Please stay vigilant when adding components that we implement them consistently in our projects and that it is clear when and where they have to be used. We want to avoid a lot of components that are similar.
|
|
47
29
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
### Fonts
|
|
31
|
+
|
|
32
|
+
WebUI uses the Avenir Next LT Pro font family for some headings. If you want to use these, you need to make them available in your project. You can do this by declaring the following `@font-face` rules in your CSS:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: "AvenirNextLTPro-Regular";
|
|
37
|
+
src:
|
|
38
|
+
url("./<regular-font-file>.eot") format("embedded-opentype"),
|
|
39
|
+
url("./<regular-font-file>.woff2") format("woff2"),
|
|
40
|
+
url("./<regular-font-file>.woff") format("woff"),
|
|
41
|
+
url("./<regular-font-file>.ttf") format("truetype");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: "AvenirNextLTPro-Bold";
|
|
46
|
+
src:
|
|
47
|
+
url("./<bold-font-file>.eot") format("embedded-opentype"),
|
|
48
|
+
url("./<bold-font-file>.woff2") format("woff2"),
|
|
49
|
+
url("./<bold-font-file>.woff") format("woff"),
|
|
50
|
+
url("./<bold-font-file>.ttf") format("truetype");
|
|
51
|
+
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
The `font-family` property value is important, as this is what WebUI is referencing to use the font. The `src` property values should point to the font files you want to use.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
If you don't declare these `@font-face` rules, the font will not be available and the headings will gracefully fall back to next available font in your application.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
- Run `yarn icons`
|
|
58
|
+
## How to use
|
|
60
59
|
|
|
61
|
-
The
|
|
60
|
+
The primary goal of WebUI is to make frontend development faster. It does this by providing a set of commonly used components that can be composed together to build user interfaces.
|
|
61
|
+
WebUI aims to have every component well documented, both in the code and in Storybook. You can find all available components and documentation on how to
|
|
62
|
+
use them at [design.luscii.com](https://design.luscii.com/).
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
### Example scenario
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Say you're tasked with building a UI that contains a card. This card has a title, a subtitle, some body text and a button. You could build this UI by writing the following code:
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
```tsx
|
|
69
|
+
import { Card, Text, Button } from "@luscii-healthtech/web-ui";
|
|
68
70
|
|
|
71
|
+
function MyComponent() {
|
|
72
|
+
return (
|
|
73
|
+
<div className="my-layout">
|
|
74
|
+
<Card>
|
|
75
|
+
<Card.Title>Heart program</Card.Title>
|
|
76
|
+
<Card.Subtitle>79 participants</Card.Subtitle>
|
|
77
|
+
<Card.Text>Some description of how great this program is.</Card.Text>
|
|
78
|
+
<Card.Button>View program</Card.Button>
|
|
79
|
+
</Card>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
69
83
|
```
|
|
70
|
-
//Branch names convention (enforced)
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
minor/* //for new components and stories
|
|
74
|
-
patch/* //for small improvements to existing components, stories
|
|
75
|
-
bug/* //for bugs, fixes
|
|
76
|
-
```
|
|
85
|
+
Often times WebUI will provide a component that is a composition of other components. In this case, the `Card` component is a composition of `Card.Title`, `Card.Subtitle`, `Card.Text` and `Card.Button`. This allows you to build UIs faster, as you don't have to think about where to get a certain component. You can just use `Card` and its subcomponents and everything will be styled correctly.
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
## Frequently asked questions
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
<details>
|
|
90
|
+
<summary>The feature I'm building needs a component from WebUI that doesn't exist.</summary>
|
|
81
91
|
|
|
82
|
-
|
|
83
|
-
2. The storybook build is published to chromatic.
|
|
84
|
-
3. Labels are added based on the branch name and PR size.
|
|
85
|
-
4. Branch names must follow the convention and are checked
|
|
92
|
+
Please get in touch with the design system circle by sending us a message in the [#design-system-circle channel](https://luscii.slack.com/archives/C03507ZKRCY). We'll discuss your needs and see what would be the best way to move forward.
|
|
86
93
|
|
|
87
|
-
|
|
94
|
+
</details>
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
3. Publish new package to NPM
|
|
96
|
+
<details>
|
|
97
|
+
<summary>The component I'm using doesn't have the props/subcomponents to build my feature.</summary>
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
In most cases you can build the UI you need by composing the components that are available. If for instance `Card.Text` doesn't exist, go "one level up" and find the component that is closest to what you need. In this case, you can use the `Text` component and configure it with the correct props to match the design.
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
In case the component is missing a prop that you need, please get in touch with the design system circle by sending us a message in the [#design-system-circle channel](https://luscii.slack.com/archives/C03507ZKRCY). We'll discuss your needs and see what would be the best way to move forward.
|
|
96
102
|
|
|
97
|
-
|
|
103
|
+
</details>
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- [core-js](https://www.npmjs.com/package/core-js)
|
|
102
|
-
- [regenerator-runtime](https://www.npmjs.com/package/regenerator-runtime)
|
|
103
|
-
- [smoothscroll-polyfill](https://www.npmjs.com/package/smoothscroll-polyfill)
|
|
105
|
+
## Contributing
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
Great to have you help making WebUI better! We have a few guidelines and tips
|
|
108
|
+
to make sure we can keep the library consistent and easy to use. You can find
|
|
109
|
+
them in our [contributing guide](CONTRIBUTING.md).
|
|
106
110
|
|
|
107
|
-
|
|
111
|
+
### Reporting bugs
|
|
108
112
|
|
|
109
|
-
|
|
113
|
+
If you find a bug, please report it by sending us a message in the [#design-system-circle channel](https://luscii.slack.com/archives/C03507ZKRCY). It helps us a lot knowing of anything that is not working as expected.
|
|
@@ -5,6 +5,11 @@ export interface AccordionProps {
|
|
|
5
5
|
items: AccordionItemProps[];
|
|
6
6
|
className?: string;
|
|
7
7
|
isCollapsedByDefault?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* A section at the bottom of the accordion that is
|
|
10
|
+
* always visible, even when the accordion is closed.
|
|
11
|
+
*/
|
|
12
|
+
footer?: React.ReactNode;
|
|
8
13
|
}
|
|
9
|
-
declare const Accordion: React.
|
|
14
|
+
declare const Accordion: React.FC<AccordionProps>;
|
|
10
15
|
export default Accordion;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface AccordionItemProps {
|
|
3
3
|
id: string | number;
|
|
4
|
-
title:
|
|
4
|
+
title: React.ReactNode;
|
|
5
5
|
content: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
7
|
isCollapsedByDefault?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Called when the accordion item opens.
|
|
10
|
+
*/
|
|
11
|
+
onOpened?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when the accordion item closes.
|
|
14
|
+
*/
|
|
15
|
+
onClosed?: () => void;
|
|
8
16
|
}
|
|
9
|
-
export declare const AccordionItem: React.
|
|
17
|
+
export declare const AccordionItem: React.FC<AccordionItemProps>;
|
|
@@ -3,6 +3,7 @@ import { AccordionProps } from "../Accordion/Accordion";
|
|
|
3
3
|
import { DraggableListProps, ListItemProps, SortableListProps } from "../List/List.types";
|
|
4
4
|
import { AccordionItemProps } from "../Accordion/AccordionItem";
|
|
5
5
|
import { BaseButtonProps } from "../ButtonV2/ButtonProps.type";
|
|
6
|
+
import { AccordionListActions } from "./subcomponents/AccordionListActions";
|
|
6
7
|
export interface AccordionListProps extends Omit<AccordionProps, "items"> {
|
|
7
8
|
localisations: {
|
|
8
9
|
title: string;
|
|
@@ -10,23 +11,35 @@ export interface AccordionListProps extends Omit<AccordionProps, "items"> {
|
|
|
10
11
|
emptyListText?: string;
|
|
11
12
|
};
|
|
12
13
|
accordionItems: AccordionItem[];
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* Use the `actions` prop to render any button(s)
|
|
17
|
+
* or other component(s) automatically in the correct area.
|
|
18
|
+
*/
|
|
13
19
|
buttonProps?: BaseButtonProps;
|
|
14
20
|
isSearchEnabled?: boolean;
|
|
15
21
|
isLoading?: boolean;
|
|
22
|
+
actions?: React.ReactNode;
|
|
16
23
|
}
|
|
17
|
-
export type AccordionListItemProps<T = ListItemProps> = Omit<AccordionItemProps, "content"> & {
|
|
24
|
+
export type AccordionListItemProps<T = ListItemProps> = Omit<AccordionItemProps, "title" | "content"> & {
|
|
18
25
|
listItems: T[];
|
|
19
26
|
draggableListType?: "default";
|
|
27
|
+
title: string;
|
|
20
28
|
};
|
|
21
|
-
export type DraggableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
|
|
29
|
+
export type DraggableAccordionListItemProps = Omit<AccordionItemProps, "title" | "content"> & {
|
|
22
30
|
draggableListType: "draggable";
|
|
23
31
|
listItems: DraggableListProps["items"];
|
|
32
|
+
title: string;
|
|
24
33
|
};
|
|
25
|
-
export type SortableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
|
|
34
|
+
export type SortableAccordionListItemProps = Omit<AccordionItemProps, "title" | "content"> & {
|
|
26
35
|
draggableListType: "sortable";
|
|
27
36
|
draggableIdentifier: string;
|
|
28
37
|
listItems: SortableListProps["items"];
|
|
38
|
+
title: string;
|
|
29
39
|
};
|
|
30
40
|
export type AccordionItem = AccordionListItemProps | DraggableAccordionListItemProps | SortableAccordionListItemProps;
|
|
31
|
-
|
|
41
|
+
interface StaticComponents {
|
|
42
|
+
Actions: typeof AccordionListActions;
|
|
43
|
+
}
|
|
44
|
+
export declare const AccordionList: React.FC<AccordionListProps> & StaticComponents;
|
|
32
45
|
export default AccordionList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Use in the actions of an AccordionList. Spaces out the action
|
|
4
|
+
* components correctly in relation to the styling of the AccordionList component.
|
|
5
|
+
*
|
|
6
|
+
* @usage
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <AccordionList
|
|
9
|
+
* actions={
|
|
10
|
+
* <AccordionList.Actions>
|
|
11
|
+
* <PrimaryButton />
|
|
12
|
+
* <SecondaryButton />
|
|
13
|
+
* </AccordionList.Actions>
|
|
14
|
+
* }
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const AccordionListActions: React.FC<React.PropsWithChildren>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type AvatarSize = "large" | "medium" | "small";
|
|
3
|
+
type Props = {
|
|
4
|
+
initials: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Put the name of the person here, so less sighted
|
|
8
|
+
* users can know who the avatar belongs to.
|
|
9
|
+
*
|
|
10
|
+
* In case of rendering the default image or the
|
|
11
|
+
* initials, this will also be used as the `alt` text.
|
|
12
|
+
*/
|
|
13
|
+
alt?: string;
|
|
14
|
+
size?: AvatarSize;
|
|
15
|
+
/**
|
|
16
|
+
* URL to an image to be used as the default image.
|
|
17
|
+
* If this is set, the image provided via `src` will never render.
|
|
18
|
+
*/
|
|
19
|
+
defaultImage?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const Avatar: ({ size, src, alt, defaultImage, initials, className, }: Props) => React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -6,6 +6,11 @@ import { TextColor, TextHoverColor } from "../Text/Text";
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export interface BaseButtonProps extends React.ComponentPropsWithRef<"button"> {
|
|
9
|
+
size?: "medium" | "large";
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `children` instead.
|
|
13
|
+
*/
|
|
9
14
|
text?: string;
|
|
10
15
|
icon?: React.FunctionComponent<IconProps> | IconKey;
|
|
11
16
|
isDisabled?: boolean;
|
|
@@ -1,12 +1,57 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { TitleProps } from "../Title/Title";
|
|
3
|
+
type TitleAndMaybeActions = {
|
|
3
4
|
title: string;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Spaces and positions the action components correctly in relation to
|
|
7
|
+
* the styling of the card.
|
|
8
|
+
*
|
|
9
|
+
* @usage
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Card
|
|
12
|
+
* actions={
|
|
13
|
+
* <Card.Actions>
|
|
14
|
+
* <PrimaryButton />
|
|
15
|
+
* <SecondaryButton />
|
|
16
|
+
* </Card.Actions>
|
|
17
|
+
* }
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
actions: React.ReactNode;
|
|
22
|
+
} | {
|
|
23
|
+
title: undefined;
|
|
24
|
+
actions: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The `actions` prop can only be used in conjunction with the `title` prop.
|
|
29
|
+
*/
|
|
30
|
+
actions?: never;
|
|
6
31
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
32
|
+
export type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<C> & {
|
|
33
|
+
as?: C;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not to add the default padding to the card. Set this
|
|
37
|
+
* to `false` if you want to render something full width inside of the
|
|
38
|
+
* card, like an image or a list. You have access to the `Card.Padding`
|
|
39
|
+
* subcomponent to then add back the default padding wherever needed.
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
padding?: boolean;
|
|
44
|
+
} & TitleAndMaybeActions;
|
|
45
|
+
export declare function Card<C extends React.ElementType = "div">(props: Props<C>): React.JSX.Element;
|
|
46
|
+
export declare namespace Card {
|
|
47
|
+
var Title: (props: TitleProps) => React.JSX.Element;
|
|
48
|
+
var TopBar: typeof import("./TopBar").TopBar;
|
|
49
|
+
var Padding: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}>;
|
|
52
|
+
var Section: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
}>;
|
|
55
|
+
var Actions: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">>;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = React.ComponentPropsWithoutRef<"div"> & {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function TopBar(props: Props): React.JSX.Element;
|
|
6
|
+
export declare namespace TopBar {
|
|
7
|
+
var Actions: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -1,19 +1,64 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Checkbox.scss";
|
|
3
3
|
export interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* ID used for semantic targeting, as can be used in attributes like `<label htmlFor="some-id">`.
|
|
6
|
+
*/
|
|
4
7
|
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The visible text labeling the checkbox element.
|
|
10
|
+
*/
|
|
5
11
|
text?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Helper text that adds some more information on what the option means, or inform
|
|
14
|
+
* the user about the consequences of the checkbox.
|
|
15
|
+
*
|
|
16
|
+
* Only works if the `renderLabel` prop isn't set.
|
|
17
|
+
*/
|
|
6
18
|
explanation?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Shows a different checkbox variant. `type="switch"` shows a switch-like component
|
|
21
|
+
* without a visual label.
|
|
22
|
+
*/
|
|
7
23
|
type?: "regular" | "switch";
|
|
24
|
+
/**
|
|
25
|
+
* Set the value.
|
|
26
|
+
* Same as `checked` on `<input type="checkbox" />`.
|
|
27
|
+
*/
|
|
8
28
|
isChecked?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Value for when it is not clear if the state of this checkbox
|
|
31
|
+
* is "checked" or not (for hierarchical checkboxes).
|
|
32
|
+
*/
|
|
9
33
|
isIndeterminate?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Disallow the user to change the checkbox value.
|
|
36
|
+
* Same as `disabled` on `<input type="checkbox" />`.
|
|
37
|
+
*/
|
|
10
38
|
isDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The name that the value of the checkbox will be associated with.
|
|
41
|
+
* Same as `name` on `<input type="checkbox" />`.
|
|
42
|
+
*/
|
|
11
43
|
name?: string;
|
|
44
|
+
/**
|
|
45
|
+
* This can be used to retrieve the value it is referring to through onChange.
|
|
46
|
+
*/
|
|
12
47
|
value?: string;
|
|
13
48
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
49
|
className?: string;
|
|
50
|
+
classNameCheckboxLabel?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Visually show that the currently selected value has an issue the user needs to attend to.
|
|
53
|
+
*/
|
|
15
54
|
error?: boolean;
|
|
16
55
|
innerRef?: React.Ref<HTMLInputElement>;
|
|
56
|
+
/**
|
|
57
|
+
* Renders a completely custom label. Can change its contents or
|
|
58
|
+
* appearance based on the props of the checkbox item.
|
|
59
|
+
*
|
|
60
|
+
* Overrides the `text` prop.
|
|
61
|
+
*/
|
|
62
|
+
renderLabel?: (props: CheckboxProps) => JSX.Element | null;
|
|
17
63
|
}
|
|
18
64
|
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
-
export default Checkbox;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxGroupProps } from "./CheckboxList.types";
|
|
3
|
-
export declare const CheckboxGroup: ({ title, items, onChange, className,
|
|
3
|
+
export declare const CheckboxGroup: ({ title, items, onChange, className, isCollapsed, collapsible, }: CheckboxGroupProps) => JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxListProps } from "./CheckboxList.types";
|
|
3
3
|
export { CheckboxListProps };
|
|
4
|
-
export declare const CheckboxList: ({ groups, onChange, className,
|
|
5
|
-
export default CheckboxList;
|
|
4
|
+
export declare const CheckboxList: ({ groups, onChange, className, }: CheckboxListProps) => JSX.Element;
|
|
@@ -4,34 +4,47 @@ export declare enum CheckboxState {
|
|
|
4
4
|
UNCHECKED = "unchecked"
|
|
5
5
|
}
|
|
6
6
|
export interface CheckboxListProps {
|
|
7
|
+
/**
|
|
8
|
+
* An array of items to render as checkboxes. Each item can be a single item or a group. When the
|
|
9
|
+
* title isn't specified, the group will render as a non-collapsible list. This is the way to
|
|
10
|
+
* render a regular list of checkboxes.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* Single list of checkboxes without visual grouping.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const groups = [{
|
|
17
|
+
* items: [
|
|
18
|
+
* {
|
|
19
|
+
* id: "1",
|
|
20
|
+
* label: "Item 1",
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* id: "2",
|
|
24
|
+
* label: "Item 2",
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* }]
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
7
30
|
groups: CheckboxGroup[];
|
|
8
31
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
9
|
-
hasDividers?: boolean;
|
|
10
32
|
className?: string;
|
|
11
33
|
}
|
|
12
34
|
type WithCollapsible = {
|
|
13
35
|
/**
|
|
14
|
-
* When `false
|
|
36
|
+
* When `false` will prevent the checkbox list from being collapsed (also disabling clicking to expand/collapse)
|
|
15
37
|
* in the component and it will be displayed expanded by default.
|
|
16
38
|
* @default true
|
|
17
39
|
*/
|
|
18
40
|
collapsible?: boolean;
|
|
19
41
|
};
|
|
20
|
-
export type CheckboxGroupProps = {
|
|
21
|
-
title?: string;
|
|
22
|
-
items: CheckboxListItem[];
|
|
42
|
+
export type CheckboxGroupProps = CheckboxGroup & {
|
|
23
43
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
24
|
-
hasDividers?: boolean;
|
|
25
44
|
className?: string;
|
|
26
|
-
isCollapsed?: boolean;
|
|
27
45
|
} & WithCollapsible;
|
|
28
|
-
export interface CheckboxGroupItemProps {
|
|
29
|
-
id: string;
|
|
30
|
-
label: string;
|
|
31
|
-
isChecked?: boolean;
|
|
32
|
-
isDisabled?: boolean;
|
|
46
|
+
export interface CheckboxGroupItemProps extends CheckboxListItem {
|
|
33
47
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
34
|
-
className?: string;
|
|
35
48
|
}
|
|
36
49
|
export interface CheckboxListItem {
|
|
37
50
|
id: string;
|
|
@@ -41,8 +54,17 @@ export interface CheckboxListItem {
|
|
|
41
54
|
className?: string;
|
|
42
55
|
}
|
|
43
56
|
export type CheckboxGroup = {
|
|
57
|
+
/**
|
|
58
|
+
* When the title isn't specified, the group will render as a non-collapsible list.
|
|
59
|
+
*/
|
|
44
60
|
title?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The checkbox items to be shown inside of this group.
|
|
63
|
+
*/
|
|
45
64
|
items: CheckboxListItem[];
|
|
65
|
+
/**
|
|
66
|
+
* Whether the group is initially collapsed or not.
|
|
67
|
+
*/
|
|
46
68
|
isCollapsed?: boolean;
|
|
47
69
|
} & WithCollapsible;
|
|
48
70
|
export interface CheckboxChangeEvent {
|
|
@@ -7,12 +7,12 @@ type FlexContainerBase = {
|
|
|
7
7
|
verticalSpacing?: Spacing;
|
|
8
8
|
horizontalSpacing?: Spacing;
|
|
9
9
|
/**
|
|
10
|
-
* Applies the default padding (`"p-4"`) inside the container.
|
|
10
|
+
* Applies the default padding (`"ui-p-4"`) inside the container.
|
|
11
11
|
*/
|
|
12
12
|
hasPadding?: boolean;
|
|
13
13
|
backgroundColor?: string;
|
|
14
14
|
/**
|
|
15
|
-
* If `true`, will make the flexbox full width and not size
|
|
15
|
+
* If `true`, will make the flexbox full width and not size itui-relative to its content.
|
|
16
16
|
* @default true
|
|
17
17
|
*/
|
|
18
18
|
stretch?: boolean;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type DividerProps = {
|
|
2
|
+
type DividerProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
3
3
|
dark?: boolean;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type HrProps = React.ComponentPropsWithoutRef<"hr"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Request the v2 version of the divider, which has the following benefits:
|
|
8
|
+
* - Uses an `<hr>` tag instead of a `<div>`.
|
|
9
|
+
* - Uses the border color from the design system, and doesn't have a prop
|
|
10
|
+
* to change it.
|
|
11
|
+
* - Doesn't contain any logic about when it should be hidden.
|
|
12
|
+
*/
|
|
13
|
+
version: "v2";
|
|
14
|
+
};
|
|
15
|
+
type Props = DividerProps | HrProps;
|
|
16
|
+
export declare const Divider: React.FC<Props>;
|
|
6
17
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CategorizedFilters, FilterBarLocalization, OnFilterBarFilterChange } from "./FilterBarProps.type";
|
|
3
|
+
type ActiveFiltersProps = {
|
|
4
|
+
filters: CategorizedFilters;
|
|
5
|
+
onRemoveActiveFilter: OnFilterBarFilterChange;
|
|
6
|
+
localization: Pick<FilterBarLocalization, "filtersLabel">;
|
|
7
|
+
};
|
|
8
|
+
export declare const ActiveFilters: React.FC<ActiveFiltersProps>;
|
|
9
|
+
export {};
|