@skedulo/sked-ui 0.0.4-alpha.3 → 0.0.4-react-18-preview

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 (196) hide show
  1. package/README.md +93 -10
  2. package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.d.ts +39 -0
  3. package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.stories.d.ts +1 -0
  4. package/dist/components/avatar/Avatar.d.ts +46 -0
  5. package/dist/components/avatar/Avatar.stories.d.ts +1 -0
  6. package/dist/components/avatar/AvatarDetail.d.ts +19 -0
  7. package/dist/components/avatar/AvatarGroup.d.ts +27 -0
  8. package/dist/components/avatar/Slot.d.ts +42 -0
  9. package/dist/components/avatar/__tests__/Avatar.spec.d.ts +1 -0
  10. package/dist/components/avatar/__tests__/AvatarDetail.spec.d.ts +1 -0
  11. package/dist/components/avatar/__tests__/GroupAvatars.spec.d.ts +1 -0
  12. package/dist/components/avatar/__tests__/Slot.spec.d.ts +1 -0
  13. package/dist/components/badge/Badge.d.ts +18 -0
  14. package/dist/components/badge/Badge.stories.d.ts +17 -0
  15. package/dist/components/badge/__tests__/Badge.spec.d.ts +1 -0
  16. package/dist/components/button-group/ButtonGroup.d.ts +6 -0
  17. package/dist/components/button-group/ButtonGroup.stories.d.ts +1 -0
  18. package/dist/components/button-group/__tests__/ButtonGroup.spec.d.ts +1 -0
  19. package/dist/components/buttons/Buttons.stories.d.ts +1 -0
  20. package/dist/components/buttons/button/Button.d.ts +60 -0
  21. package/dist/components/buttons/button/__tests__/Button.spec.d.ts +1 -0
  22. package/dist/components/buttons/button-dropdown/ButtonDropdown.d.ts +14 -0
  23. package/dist/components/buttons/button-dropdown/__tests__/ButtonDropdown.spec.d.ts +1 -0
  24. package/dist/components/buttons/icon-button/IconButton.d.ts +13 -0
  25. package/dist/components/buttons/icon-button/__tests__/IconButton.spec.d.ts +1 -0
  26. package/dist/components/buttons/icon-button-dropdown/IconButtonDropdown.d.ts +5 -0
  27. package/dist/components/buttons/icon-button-dropdown/__tests__/IconButtonDropdown.spec.d.ts +1 -0
  28. package/dist/components/buttons/interfaces.d.ts +10 -0
  29. package/dist/components/calendar-controls/CalendarControls-utils.d.ts +7 -0
  30. package/dist/components/calendar-controls/CalendarControls.d.ts +30 -0
  31. package/dist/components/calendar-controls/CalendarControls.stories.d.ts +1 -0
  32. package/dist/components/calendar-controls/elements/DateSelector.d.ts +47 -0
  33. package/dist/components/calendar-controls/elements/NavigationButtons.d.ts +6 -0
  34. package/dist/components/calendar-controls/elements/RangePicker.d.ts +21 -0
  35. package/dist/components/calendar-controls/elements/TodayButton.d.ts +5 -0
  36. package/dist/components/datepicker/DateTime.d.ts +55 -0
  37. package/dist/components/datepicker/DateTime.stories.d.ts +1 -0
  38. package/dist/components/datepicker/Datepicker.d.ts +125 -0
  39. package/dist/components/datepicker/Datepicker.stories.d.ts +1 -0
  40. package/dist/components/datepicker/Time.d.ts +44 -0
  41. package/dist/components/datepicker/Time.stories.d.ts +1 -0
  42. package/dist/components/datepicker/__tests__/DateTime.spec.d.ts +1 -0
  43. package/dist/components/datepicker/__tests__/Datepicker.spec.d.ts +1 -0
  44. package/dist/components/datepicker/__tests__/Time.spec.d.ts +1 -0
  45. package/dist/components/dynamic-table/DynamicTable-utils.d.ts +45 -0
  46. package/dist/components/dynamic-table/DynamicTable.d.ts +79 -0
  47. package/dist/components/dynamic-table/DynamicTable.stories.d.ts +1 -0
  48. package/dist/components/dynamic-table/__tests__/DynamicTable-renders.spec.d.ts +1 -0
  49. package/dist/components/dynamic-table/__tests__/DynamicTable-test-utils.d.ts +3 -0
  50. package/dist/components/dynamic-table/__tests__/DynamicTable-utils.spec.d.ts +1 -0
  51. package/dist/components/dynamic-table/__tests__/DynamicTable.spec.d.ts +1 -0
  52. package/dist/components/dynamic-table/__tests__/__mocks__/table-data.d.ts +16 -0
  53. package/dist/components/dynamic-table/interfaces.d.ts +52 -0
  54. package/dist/components/emptystate/EmptyState.d.ts +9 -0
  55. package/dist/components/emptystate/EmptyState.spec.d.ts +1 -0
  56. package/dist/components/emptystate/EmptyState.stories.d.ts +1 -0
  57. package/dist/components/filter-bar/FilterBar.d.ts +54 -0
  58. package/dist/components/filter-bar/FilterBar.stories.d.ts +1 -0
  59. package/dist/components/filter-bar/__tests__/FilterBar.spec.d.ts +1 -0
  60. package/dist/components/filter-bar/filter-list/FilterList.d.ts +10 -0
  61. package/dist/components/filter-bar/filter-list/FilterListWithApply.d.ts +24 -0
  62. package/dist/components/filter-bar/filter-list/FilterSearch.d.ts +21 -0
  63. package/dist/components/filter-bar/filter-list/RemoteSearch.d.ts +25 -0
  64. package/dist/components/filter-bar/filter-list/__tests__/FilterList.spec.d.ts +1 -0
  65. package/dist/components/filter-bar/filter-list/__tests__/FilterListWithApply.spec.d.ts +1 -0
  66. package/dist/components/filter-bar/filter-list/__tests__/FilterSearch.spec.d.ts +1 -0
  67. package/dist/components/filter-bar/filter-list/__tests__/RemoteSearch.spec.d.ts +1 -0
  68. package/dist/components/filter-bar/filter-pill/FilterPill.d.ts +23 -0
  69. package/dist/components/filter-bar/filter-pill/__tests__/FilterPill.spec.d.ts +1 -0
  70. package/dist/components/filter-bar/interfaces.d.ts +43 -0
  71. package/dist/components/forms/Forms.stories.d.ts +1 -0
  72. package/dist/components/forms/ReadOnly.d.ts +11 -0
  73. package/dist/components/forms/SkedFormValidation.d.ts +98 -0
  74. package/dist/components/forms/SkedFormValidation.spec.d.ts +1 -0
  75. package/dist/components/forms/__tests__/ReadOnly.spec.d.ts +1 -0
  76. package/dist/components/forms/elements/AsyncMultiSearchSelect.d.ts +3 -0
  77. package/dist/components/forms/elements/AsyncSearchSelect.d.ts +6 -0
  78. package/dist/components/forms/elements/AsyncSelectSearch.stories.d.ts +1 -0
  79. package/dist/components/forms/elements/FormElements.d.ts +54 -0
  80. package/dist/components/forms/elements/MultiSearchSelect.d.ts +3 -0
  81. package/dist/components/forms/elements/MultiSearchSelect.stories.d.ts +1 -0
  82. package/dist/components/forms/elements/NumberInput.d.ts +17 -0
  83. package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.d.ts +8 -0
  84. package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.stories.d.ts +1 -0
  85. package/dist/components/forms/elements/PlainMultiSearchSelect.d.ts +24 -0
  86. package/dist/components/forms/elements/PlainMultiSearchSelect.stories.d.ts +1 -0
  87. package/dist/components/forms/elements/SearchSelect.d.ts +6 -0
  88. package/dist/components/forms/elements/SearchSelect.stories.d.ts +1 -0
  89. package/dist/components/forms/elements/TextArea.d.ts +25 -0
  90. package/dist/components/forms/elements/TextArea.spec.d.ts +1 -0
  91. package/dist/components/forms/elements/__tests__/AsyncMultiSearchSelect.spec.d.ts +1 -0
  92. package/dist/components/forms/elements/__tests__/AsyncSearchSelect.spec.d.ts +1 -0
  93. package/dist/components/forms/elements/__tests__/FormElements.spec.d.ts +1 -0
  94. package/dist/components/forms/elements/__tests__/MultiSearchSelect.spec.d.ts +1 -0
  95. package/dist/components/forms/elements/__tests__/NumberInput.spec.d.ts +1 -0
  96. package/dist/components/forms/elements/__tests__/PlainAsyncMultiSearchSelect.spec.d.ts +1 -0
  97. package/dist/components/forms/elements/__tests__/PlainMultiSearchSelect.spec.d.ts +1 -0
  98. package/dist/components/forms/elements/__tests__/SearchSelect-renders.spec.d.ts +1 -0
  99. package/dist/components/forms/elements/__tests__/SearchSelect.spec.d.ts +1 -0
  100. package/dist/components/forms/elements/__tests__/__mocks__/searchData.d.ts +11 -0
  101. package/dist/components/forms/elements/interfaces.d.ts +108 -0
  102. package/dist/components/forms/elements/select-components.d.ts +38 -0
  103. package/dist/components/forms/elements/select-hooks.d.ts +38 -0
  104. package/dist/components/forms/elements/select-utils.d.ts +22 -0
  105. package/dist/components/icon/Icon.d.ts +26 -0
  106. package/dist/components/icon/Icon.spec.d.ts +1 -0
  107. package/dist/components/icon/Icon.stories.d.ts +1 -0
  108. package/dist/components/icon/iconPaths.d.ts +131 -0
  109. package/dist/components/info-card/InfoCard.d.ts +5 -0
  110. package/dist/components/info-card/InfoCard.stories.d.ts +1 -0
  111. package/dist/components/info-card/InfoCardBody.d.ts +13 -0
  112. package/dist/components/info-card/InfoCardFooter.d.ts +2 -0
  113. package/dist/components/info-card/InfoCardHeader.d.ts +11 -0
  114. package/dist/components/info-card/index.d.ts +4 -0
  115. package/dist/components/inline-banner/InlineBanner.d.ts +9 -0
  116. package/dist/components/inline-banner/InlineBanner.spec.d.ts +1 -0
  117. package/dist/components/inline-banner/InlineBanner.stories.d.ts +1 -0
  118. package/dist/components/link/Link.d.ts +5 -0
  119. package/dist/components/link/Link.spec.d.ts +1 -0
  120. package/dist/components/link/Link.stories.d.ts +17 -0
  121. package/dist/components/loader/Loading.d.ts +16 -12
  122. package/dist/components/loader/Loading.stories.d.ts +1 -0
  123. package/dist/components/loader/__tests__/Loading.spec.d.ts +1 -0
  124. package/dist/components/loader/spinner/LoadingSpinner.d.ts +21 -0
  125. package/dist/components/lozenge/CustomLozenge.d.ts +21 -0
  126. package/dist/components/lozenge/Lozenge.d.ts +22 -0
  127. package/dist/components/lozenge/Lozenge.stories.d.ts +1 -0
  128. package/dist/components/lozenge/__tests__/Lozenge.spec.d.ts +1 -0
  129. package/dist/components/menus/Menus.stories.d.ts +1 -0
  130. package/dist/components/menus/actionmenu/ActionMenu.d.ts +13 -0
  131. package/dist/components/menus/cardactionmenu/CardActionMenu.d.ts +10 -0
  132. package/dist/components/menus/index.d.ts +2 -0
  133. package/dist/components/menus/menu/Menu.d.ts +18 -0
  134. package/dist/components/modals/Modal.spec.d.ts +1 -0
  135. package/dist/components/modals/Modal.stories.d.ts +1 -0
  136. package/dist/components/modals/Modals.d.ts +35 -0
  137. package/dist/components/pagination/Pagination-utils.d.ts +1 -0
  138. package/dist/components/pagination/Pagination-utils.spec.d.ts +1 -0
  139. package/dist/components/pagination/Pagination.d.ts +3 -0
  140. package/dist/components/pagination/Pagination.spec.d.ts +1 -0
  141. package/dist/components/pagination/Pagination.stories.d.ts +1 -0
  142. package/dist/components/pagination/PaginationCount/PaginationCount.d.ts +3 -0
  143. package/dist/components/pagination/PaginationCount/PaginationCount.spec.d.ts +1 -0
  144. package/dist/components/pagination/PaginationPages/PaginationPages.d.ts +14 -0
  145. package/dist/components/pagination/PaginationPages/PaginationPages.spec.d.ts +1 -0
  146. package/dist/components/pagination/interfaces.d.ts +18 -0
  147. package/dist/components/pill/Pill.d.ts +25 -0
  148. package/dist/components/pill/Pill.spec.d.ts +1 -0
  149. package/dist/components/pill/Pill.stories.d.ts +1 -0
  150. package/dist/components/popout/PopOut.d.ts +61 -0
  151. package/dist/components/popout/PopOut.stories.d.ts +1 -0
  152. package/dist/components/popout/PopOutBase.d.ts +39 -0
  153. package/dist/components/popout/usePopOut.d.ts +9 -0
  154. package/dist/components/popups/info-window/InfoWindow.d.ts +45 -152
  155. package/dist/components/popups/info-window/InfoWindow.stories.d.ts +1 -0
  156. package/dist/components/popups/info-window/LegacyInfoWindow.d.ts +161 -0
  157. package/dist/components/popups/info-window/info-window-utils.d.ts +43 -32
  158. package/dist/components/popups/info-window/info-window-utils.spec.d.ts +1 -0
  159. package/dist/components/popups/info-window/useInfoWindowModifiers.d.ts +2 -0
  160. package/dist/components/popups/overflow-tooltip/OverflowTooltip.d.ts +31 -0
  161. package/dist/components/popups/tooltip/Tooltip.d.ts +21 -20
  162. package/dist/components/popups/tooltip/Tooltip.spec.d.ts +1 -0
  163. package/dist/components/popups/tooltip/Tooltip.stories.d.ts +1 -0
  164. package/dist/components/portal/Portal.d.ts +22 -0
  165. package/dist/components/search-box/SearchBox.d.ts +9 -0
  166. package/dist/components/search-box/SearchBox.spec.d.ts +1 -0
  167. package/dist/components/status-icon/StatusIcon.d.ts +11 -0
  168. package/dist/components/status-icon/StatusIcon.spec.d.ts +1 -0
  169. package/dist/components/status-icon/StatusIcon.stories.d.ts +1 -0
  170. package/dist/components/table/Table.d.ts +16 -0
  171. package/dist/components/table/Table.spec.d.ts +1 -0
  172. package/dist/components/table/Table.stories.d.ts +1 -0
  173. package/dist/components/tabs/Tabs/Tabs.d.ts +36 -0
  174. package/dist/components/tabs/Tabs/TabsMenuItem.d.ts +22 -0
  175. package/dist/components/tabs/Tabs/TabsRoutingUtils.d.ts +28 -0
  176. package/dist/components/tabs/Tabs/__tests__/Tabs.spec.d.ts +1 -0
  177. package/dist/components/tabs/Tabs/__tests__/TabsMenuItem.spec.d.ts +1 -0
  178. package/dist/components/tabs/Tabs/__tests__/TabsRoutingUtils.spec.d.ts +1 -0
  179. package/dist/components/tabs/Tabs/interfaces.d.ts +65 -0
  180. package/dist/components/tabs/Tabs.stories.d.ts +1 -0
  181. package/dist/components/text/MultilineContent.d.ts +6 -0
  182. package/dist/components/text/MultilineContent.spec.d.ts +1 -0
  183. package/dist/hooks/useDebounce.d.ts +1 -0
  184. package/dist/index.d.ts +59 -5
  185. package/dist/index.js +65736 -1
  186. package/dist/utils/Option.d.ts +58 -0
  187. package/dist/utils/Option.spec.d.ts +1 -0
  188. package/dist/utils/Route.d.ts +4 -0
  189. package/dist/utils/Strings.d.ts +1 -0
  190. package/dist/utils/Types.d.ts +6 -0
  191. package/dist/utils/__tests__/Route.spec.d.ts +1 -0
  192. package/dist/utils/testing-utils.d.ts +7 -0
  193. package/package.json +138 -59
  194. package/yarn.lock +14379 -4950
  195. package/dist/components/buttons/Button.d.ts +0 -23
  196. package/dist/components/test/Test.d.ts +0 -12
package/README.md CHANGED
@@ -1,24 +1,107 @@
1
1
  # Skedulo UI
2
2
 
3
+ Demo https://ui.skedulo.com
4
+
5
+ ## Demo (Local)
3
6
 
4
- ## Installation Instructions
5
7
  Run:
6
- ```yarn bootstrap```
7
8
 
9
+ ```bash
10
+ yarn storybook
11
+ ```
12
+
13
+ ## Development
14
+
15
+ Use NodeJS 16 for development
16
+
17
+ ### Installation
8
18
 
9
- ## Testing
10
19
  Run:
11
- ```yarn test```
12
20
 
13
- Run with watch command
14
- ```yarn test:watch```
21
+ ```bash
22
+ yarn bootstrap
23
+ ```
15
24
 
25
+ ### Testing
16
26
 
17
- ## Demo
18
27
  Run:
19
- ```yarn storybook```
20
28
 
29
+ ```bash
30
+ yarn test
31
+ ```
32
+
33
+ Run with the watch command:
34
+
35
+ yarn test:watch
36
+
37
+ ### Build
21
38
 
22
- ## Build
23
39
  Run:
24
- ```yarn build```
40
+
41
+ ```bash
42
+ yarn build
43
+ ```
44
+
45
+ ### Linking between projects
46
+
47
+ If you need to test your changes to the package in another project, you can do so by first building the package:
48
+
49
+ ```bash
50
+ yarn build:package
51
+ ```
52
+
53
+ then allow a link to sked-ui by running:
54
+
55
+ ```bash
56
+ yarn link
57
+ ```
58
+
59
+ within this projects directory.
60
+
61
+ To use it within another project, navigate to the root folder of that project and run:
62
+
63
+ ```bash
64
+ yarn link @skedulo/sked-ui
65
+ ```
66
+
67
+ Some potentially helpful commands to run if you are making changes to sked are:
68
+
69
+ ```bash
70
+ yarn package:watch
71
+
72
+ # and
73
+
74
+ yarn build:declarations:watch
75
+ ```
76
+
77
+ ### Merging to master & semantic-release
78
+
79
+ #### Concurrent merging
80
+
81
+ Do not in any circumstances merge branches to master while the build pipeline for the last commit is still running.
82
+
83
+ Doing so will cause the last commit to not be published while other assets relying on it will be.
84
+
85
+ #### Failed build pipelines on master
86
+
87
+ Semantic-release will create a new commit at some point in the build pipeline that updates the package version in the source.
88
+
89
+ If the build fails BEFORE this occurs, then feel free to rerun the build pipeline as it will cleanly re-attempt to release.
90
+
91
+ If the build fails AFTER a commit is created, then you will not be able to rerun the build pipeline. This is because the release
92
+
93
+ process relies on being at the tip of master to release to NPM and a previous pipeline has already added a commit changing the package version.
94
+
95
+ In this instance you will have to create another commit and merge it through a PR. If the build pipeline is still broken and needs to be debugged
96
+
97
+ then the only other option is asking an administrator to rebase master and drop the release commit allowing the release process to cleanly retry.
98
+
99
+ This is an unfortunate scenario that comes from using semantic-release as it does not do releases idempotently.
100
+
101
+ ## Contributing
102
+
103
+ PRs welcome. Please review the [CONTRIBUTING.md](./CONTRIBUTING.md) doc for what is required for any code contributions.
104
+
105
+ ## Roadmap
106
+
107
+ Refer to [ROADMAP.md](./ROADMAP.md) for a planned list of upcoming components.
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ interface IIntersectionObserverWrapper {
3
+ /**
4
+ * Function to call when element is visible
5
+ */
6
+ onVisible: (entry?: IntersectionObserverEntry) => void;
7
+ /**
8
+ * Sends every observer entry event
9
+ */
10
+ onMonitor?: (entries: IntersectionObserverEntry[]) => void;
11
+ /**
12
+ * Defaults to browser viewport
13
+ */
14
+ root?: Element;
15
+ /**
16
+ * Between 0 and 1
17
+ * How visible does the element have to be before onVisible is shown
18
+ * eg. 1 === 100%, 0.10 === 10%
19
+ *
20
+ * Default: 1
21
+ */
22
+ threshold?: number;
23
+ /**
24
+ * Can have values similar to the CSS margin property, e.g. "10px 20px 30px 40px" (top, right, bottom, left)
25
+ */
26
+ rootMargin?: string;
27
+ /**
28
+ * The type of wrapper element to create. Defaults to div
29
+ */
30
+ as?: keyof HTMLElementTagNameMap;
31
+ }
32
+ /**
33
+ *
34
+ * A wrapper around the native IntersectionObserver that calls the onVisible
35
+ * function when the element is visible within the specified viewport
36
+ * based on supplied props. Useful for creating infinite scrolling behaviour.
37
+ */
38
+ export declare const IntersectionObserverWrapper: React.FC<React.PropsWithChildren<IIntersectionObserverWrapper>>;
39
+ export {};
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ export type AvatarSizes = 'tiny' | 'small' | 'medium' | 'large';
3
+ export interface IAvatar extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** This will be used for the 'letter' display and be the
5
+ * default tooltip text if showTooltip is true
6
+ * */
7
+ name: string;
8
+ /**
9
+ * Use this to skip the name being converted to an initials only display.
10
+ * Once set the name will be displayed as-is.
11
+ */
12
+ preserveName?: boolean;
13
+ /**
14
+ * The url to use to fetch the avatar image
15
+ */
16
+ imageUrl?: string;
17
+ /**
18
+ * 'medium' is the default
19
+ */
20
+ size?: AvatarSizes;
21
+ /**
22
+ * Wrap the avatar in a tooltip
23
+ */
24
+ showTooltip?: boolean;
25
+ /**
26
+ * If you want your tooltip text to say something other
27
+ * than the 'name' prop, you can supply the text to this prop
28
+ */
29
+ tooltipText?: string;
30
+ /**
31
+ * Wrap the avatar with a border
32
+ */
33
+ bordered?: boolean;
34
+ }
35
+ export declare const avatarSizeClassMap: {
36
+ [key in AvatarSizes]: string;
37
+ };
38
+ /**
39
+ * Simple component for displaying avatars
40
+ * @requires Tooltip
41
+ */
42
+ export declare class Avatar extends React.PureComponent<IAvatar, {}> {
43
+ getInitials(name?: string): string;
44
+ renderAvatar(): React.JSX.Element;
45
+ render(): React.JSX.Element;
46
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { IAvatar } from './Avatar';
3
+ type AvatarDetailGroupSize = 'tiny' | 'small' | 'medium' | 'large';
4
+ type AvatarProps = Pick<IAvatar, 'name' | 'imageUrl'>;
5
+ export interface IAvatarDetailProps extends AvatarProps {
6
+ /**
7
+ * 'medium' is the default
8
+ */
9
+ size?: AvatarDetailGroupSize;
10
+ /**
11
+ * Section displayed below the name
12
+ */
13
+ subtitle?: JSX.Element;
14
+ className?: string;
15
+ linkUrl?: string;
16
+ target?: string;
17
+ }
18
+ export declare const AvatarDetail: ({ name, imageUrl, size, subtitle, className, linkUrl, target }: IAvatarDetailProps) => React.JSX.Element;
19
+ export {};
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { IAvatar, AvatarSizes } from './Avatar';
3
+ export type IAvatarInfo = Partial<Pick<IAvatar, 'name' | 'imageUrl' | 'tooltipText'> & {
4
+ onClick: () => void;
5
+ }>;
6
+ export interface IAvatarGroupProps {
7
+ /**
8
+ * The number of slots which can be filled or unfilled.
9
+ */
10
+ totalSlots?: number;
11
+ /**
12
+ */
13
+ avatarInfo?: IAvatarInfo[];
14
+ /**
15
+ * The number of visible slots allowed to be rendered - Minimum of 2.
16
+ */
17
+ maxVisibleSlots?: number;
18
+ /**
19
+ * 'small' is the default
20
+ */
21
+ size?: AvatarSizes;
22
+ /**
23
+ * this is the tooltip to be displayed on unfilled slot icons
24
+ */
25
+ emptySlotTooltipText?: string;
26
+ }
27
+ export declare const AvatarGroup: React.FC<IAvatarGroupProps>;
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { ITooltipProps } from '../popups/tooltip/Tooltip';
3
+ import { AvatarSizes } from '../..';
4
+ export interface IProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * Text to display inside the slot
7
+ */
8
+ text?: string;
9
+ /**
10
+ * Show the slot as filled grey or with dashed blue line
11
+ */
12
+ filled?: boolean;
13
+ /**
14
+ * Text displayed in the tooltip is applicable
15
+ */
16
+ tooltipText?: string | JSX.Element;
17
+ /**
18
+ * Avatar size
19
+ */
20
+ size?: AvatarSizes;
21
+ /**
22
+ * Tooltip background colour
23
+ */
24
+ colorScheme?: ITooltipProps['colorScheme'];
25
+ /**
26
+ * Optimal position of the tooltip
27
+ */
28
+ tooltipPosition?: ITooltipProps['position'];
29
+ /**
30
+ * Slot has white border
31
+ * */
32
+ bordered?: boolean;
33
+ /**
34
+ * Show the tooltip on the slot
35
+ */
36
+ showTooltip?: boolean;
37
+ }
38
+ /**
39
+ * Simple component for displaying avatars
40
+ * @requires Tooltip
41
+ */
42
+ export declare const Slot: React.FC<IProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ export type BadgeTypes = 'default' | 'primary' | 'important';
3
+ export declare const DEFAULT_BADGE_CLASSES = "sked-badge-min-w sk-text-xxs sk-font-medium sk-tracking-wide sk-h-5 sk-pb-px sk-rounded-full sk-inline-flex sk-items-center sk-justify-center";
4
+ export interface IBadgeProps {
5
+ /**
6
+ * Value to be displayed in badge
7
+ */
8
+ count: number;
9
+ /**
10
+ * Optional value to indicate when count should be truncated with '+' (default 99)
11
+ */
12
+ countLimiter?: number;
13
+ /**
14
+ * The type of badge to be displayed. Default | Primary | Important (default 'primary')
15
+ */
16
+ badgeType?: BadgeTypes;
17
+ }
18
+ export declare const Badge: ({ count, countLimiter, badgeType }: IBadgeProps) => React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { ComponentStory } from '@storybook/react';
3
+ import { IBadgeProps } from './Badge';
4
+ declare const _default: {
5
+ title: string;
6
+ component: (props: IBadgeProps) => React.JSX.Element;
7
+ argTypes: {
8
+ badgeType: {
9
+ options: string[];
10
+ control: {
11
+ type: string;
12
+ };
13
+ };
14
+ };
15
+ };
16
+ export default _default;
17
+ export declare const Basic: ComponentStory<({ count, countLimiter, badgeType }: IBadgeProps) => React.JSX.Element>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface IButtonGroup extends React.HTMLProps<HTMLDivElement> {
3
+ compact?: boolean;
4
+ }
5
+ export declare const ButtonGroup: React.FC<React.PropsWithChildren<IButtonGroup>>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ import * as React from 'react';
2
+ import { IconNames } from '../../icon/Icon';
3
+ export type ButtonTypes = 'primary' | 'secondary' | 'transparent';
4
+ export type IButtonProps = {
5
+ /**
6
+ * The type of button to be displayed. Primary | Secondary | Transparent
7
+ */
8
+ buttonType: ButtonTypes;
9
+ icon?: IconNames;
10
+ /**
11
+ * Pass additional class names
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Disable the button
16
+ */
17
+ disabled?: boolean;
18
+ /**
19
+ * Compact sized button—used when space is tight - allowing more room for content.
20
+ */
21
+ compact?: boolean;
22
+ /**
23
+ * Loading button state
24
+ */
25
+ loading?: boolean;
26
+ /**
27
+ * Button is active
28
+ */
29
+ active?: boolean;
30
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
31
+ /**
32
+ * Button component
33
+ */
34
+ export declare const Button: React.ForwardRefExoticComponent<{
35
+ /**
36
+ * The type of button to be displayed. Primary | Secondary | Transparent
37
+ */
38
+ buttonType: ButtonTypes;
39
+ icon?: IconNames;
40
+ /**
41
+ * Pass additional class names
42
+ */
43
+ className?: string;
44
+ /**
45
+ * Disable the button
46
+ */
47
+ disabled?: boolean;
48
+ /**
49
+ * Compact sized button—used when space is tight - allowing more room for content.
50
+ */
51
+ compact?: boolean;
52
+ /**
53
+ * Loading button state
54
+ */
55
+ loading?: boolean;
56
+ /**
57
+ * Button is active
58
+ */
59
+ active?: boolean;
60
+ } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { IButtonDropdownCommon } from '../interfaces';
3
+ interface IButtonDropdownProps extends IButtonDropdownCommon {
4
+ /**
5
+ * Text to display on the button
6
+ */
7
+ label: React.ReactNode;
8
+ }
9
+ /**
10
+ * The DropdownButton component displays/hides children as a dropdown when clicked. The Menu and MenuItem
11
+ components are strongly recommended to be used in conjunction with this component to enforce correct styling of the dropdown menu.
12
+ */
13
+ export declare const ButtonDropdown: React.FC<React.PropsWithChildren<IButtonDropdownProps>>;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { ITooltipProps } from '../../popups/tooltip/Tooltip';
3
+ import { IconNames } from '../../icon/Icon';
4
+ import { IButtonProps } from '../button/Button';
5
+ interface IconButtonProps {
6
+ icon: IconNames;
7
+ tooltipContent: ITooltipProps['content'];
8
+ tooltipDelay?: ITooltipProps['delayShow'];
9
+ disableTooltip?: boolean;
10
+ }
11
+ export type IIconButton = IconButtonProps & Partial<IButtonProps>;
12
+ export declare const IconButton: React.FC<React.PropsWithChildren<IIconButton>>;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { IIconButton } from '../icon-button/IconButton';
3
+ import { IButtonDropdownCommon } from '../interfaces';
4
+ export type IconButtonDropdown = IIconButton & IButtonDropdownCommon;
5
+ export declare const IconButtonDropdown: React.FC<React.PropsWithChildren<IconButtonDropdown>>;
@@ -0,0 +1,10 @@
1
+ import { Placement } from 'popper.js';
2
+ import { IPopOutProps, IButtonProps } from '../..';
3
+ export interface IButtonDropdownCommon extends Partial<IButtonProps> {
4
+ placement?: Placement;
5
+ /**
6
+ * Dropdown content is placed in a PopOut which is wrapped in a Portal by default.
7
+ * You can override that container using this prop.
8
+ */
9
+ popOutContainer?: IPopOutProps['popOutContainer'];
10
+ }
@@ -0,0 +1,7 @@
1
+ import { RangeType } from './elements/RangePicker';
2
+ export type DateDirection = 'forward' | 'backward';
3
+ export type DateFormat = 'MonthDayYear' | 'DayMonthYear';
4
+ export declare const moveDate: (selected: Date, days: RangeType, direction: DateDirection) => Date;
5
+ export declare const endOfPeriod: (selected: Date, selectedRange: RangeType) => Date;
6
+ export declare const formatLongDate: (date: Date, dateFormat?: DateFormat) => string;
7
+ export declare const formatShortDate: (date: Date, dateFormat?: DateFormat) => string;
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { IDateSelectorProps } from './elements/DateSelector';
3
+ import { INavigationButtonProps } from './elements/NavigationButtons';
4
+ import { IRangeProps, RangePicker, RangeType } from './elements/RangePicker';
5
+ import { ValidationProps } from '../forms/elements/FormElements';
6
+ export interface IBaseCalendarControlProps extends ValidationProps {
7
+ /**
8
+ * The current range to display. This will update the current range dropdown and the date range displayed
9
+ */
10
+ selectedRange?: RangeType;
11
+ /**
12
+ * The current focus date for the Calendar. If a range is provided this is the start of the range to render
13
+ */
14
+ selected?: Date;
15
+ }
16
+ export interface ICalendarControlProps extends React.HTMLAttributes<HTMLDivElement>, IBaseCalendarControlProps, IDateSelectorProps, INavigationButtonProps, IRangeProps {
17
+ /**
18
+ * Whenever the user clicks the `Today` button this callback is triggered
19
+ */
20
+ onTodayClick?: () => void;
21
+ }
22
+ export declare function useCalendarControlsContext(): ICalendarControlProps;
23
+ declare function CalendarControls(props: ICalendarControlProps): React.JSX.Element;
24
+ declare namespace CalendarControls {
25
+ var TodayButton: React.FC<import("./elements/TodayButton").ITodayButtonProps>;
26
+ var NavigationButtons: (props: INavigationButtonProps) => React.JSX.Element;
27
+ var DateSelector: React.FC<IDateSelectorProps>;
28
+ var RangePicker: React.FC<IRangeProps>;
29
+ }
30
+ export { CalendarControls, RangePicker, RangeType };
@@ -0,0 +1,47 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import { ReactDatePickerProps } from 'react-datepicker';
3
+ import { ButtonTypes } from '../../..';
4
+ import { IBaseCalendarControlProps } from '../CalendarControls';
5
+ import { DateFormat } from '../CalendarControls-utils';
6
+ export type SelectDateHandler = (date: Date) => void;
7
+ export interface IBaseDateSelectorProps extends IBaseCalendarControlProps {
8
+ /**
9
+ * Whenever the date is changed, either through direct select, clicking to or navigating, the new date is provided to this function
10
+ */
11
+ onDateSelect?: SelectDateHandler;
12
+ /**
13
+ * Minimum date allowed to be selected. This will also affect the month navigation
14
+ */
15
+ minDate?: ReactDatePickerProps['minDate'];
16
+ /**
17
+ * Latest date allowed to be selected. This will also affect the month navigation
18
+ */
19
+ maxDate?: ReactDatePickerProps['maxDate'];
20
+ }
21
+ export interface IDateSelectorProps extends IBaseDateSelectorProps, HTMLAttributes<HTMLDivElement> {
22
+ /**
23
+ * The callback handler when a Day in the datepicker dropdown is hovered
24
+ */
25
+ onDayMouseEnter?: SelectDateHandler;
26
+ /**
27
+ * The callback handler for when the mouse leaves the datepicker dropdown
28
+ */
29
+ onMonthMouseLeave?: () => void;
30
+ /**
31
+ * A day of a week to highlight. It will highlight from Sunday to Saturday of the weeks selected based on rangeOptions
32
+ */
33
+ highlightWeek?: Date;
34
+ /**
35
+ * Highlight the entire week of the currently selected date, from Sunday to Saturday based on rangeOptions
36
+ */
37
+ selectWeek?: boolean;
38
+ /**
39
+ * The type of Datepicker custom input button to be displayed. Primary | Secondary | Transparent
40
+ */
41
+ buttonType?: ButtonTypes;
42
+ /**
43
+ * User preferred date format
44
+ */
45
+ dateFormat?: DateFormat;
46
+ }
47
+ export declare const DateSelector: React.FC<IDateSelectorProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { IBaseDateSelectorProps } from './DateSelector';
3
+ export interface INavigationButtonProps extends IBaseDateSelectorProps {
4
+ hideTooltipIfDisabled?: boolean;
5
+ }
6
+ export declare const NavigationButtons: (props: INavigationButtonProps) => React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { IBaseCalendarControlProps } from '../CalendarControls';
3
+ export interface IRangeProps extends IBaseCalendarControlProps {
4
+ /**
5
+ * When a new range has been provided, this callback is triggered
6
+ */
7
+ onRangeChange?: (range: RangeType) => void;
8
+ /**
9
+ * The list of options that can be chosen from. Current range options are 'day', '3-days', 'week' and 'month'
10
+ */
11
+ rangeOptions?: RangeType[];
12
+ }
13
+ export type RangeType = 'day' | '3-days' | '2-weeks' | 'week' | 'month';
14
+ export declare const dateRangeLabel: {
15
+ day: string;
16
+ '3-days': string;
17
+ week: string;
18
+ '2-weeks': string;
19
+ month: string;
20
+ };
21
+ export declare const RangePicker: React.FC<IRangeProps>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface ITodayButtonProps {
3
+ onClick?: () => void;
4
+ }
5
+ export declare const TodayButton: React.FC<ITodayButtonProps>;