@ainias42/react-bootstrap-mobile 0.1.7

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 (233) hide show
  1. package/.eslintrc.json +189 -0
  2. package/.prettierrc +5 -0
  3. package/LICENSE +21 -0
  4. package/README.md +1 -0
  5. package/babel.config.js +22 -0
  6. package/bin/build.js +60 -0
  7. package/bin/release.sh +35 -0
  8. package/bin/updateCopies.js +86 -0
  9. package/bootstrapReactMobile.ts +87 -0
  10. package/dist/bootstrapReactMobile.d.ts +87 -0
  11. package/dist/bootstrapReactMobile.js +6275 -0
  12. package/dist/src/Components/ActionSheet/ActionSheet.d.ts +21 -0
  13. package/dist/src/Components/Card/Card.d.ts +13 -0
  14. package/dist/src/Components/Clickable/Clickable.d.ts +14 -0
  15. package/dist/src/Components/Dialog/AlertDialog.d.ts +10 -0
  16. package/dist/src/Components/Dialog/ButtonDialog.d.ts +13 -0
  17. package/dist/src/Components/Dialog/ConfirmDialog.d.ts +11 -0
  18. package/dist/src/Components/Dialog/Dialog.d.ts +14 -0
  19. package/dist/src/Components/Dialog/DialogBackground.d.ts +7 -0
  20. package/dist/src/Components/Dialog/DialogContainer.d.ts +6 -0
  21. package/dist/src/Components/Dialog/DialogContext.d.ts +9 -0
  22. package/dist/src/Components/Dialog/useAlertDialog.d.ts +1 -0
  23. package/dist/src/Components/Dialog/useConfirmDialog.d.ts +1 -0
  24. package/dist/src/Components/DragAndDrop/DragItem.d.ts +7 -0
  25. package/dist/src/Components/DragAndDrop/DropArea.d.ts +7 -0
  26. package/dist/src/Components/DragAndDrop/useStrictEnabled.d.ts +1 -0
  27. package/dist/src/Components/FormElements/Button/Button.d.ts +8 -0
  28. package/dist/src/Components/FormElements/CheckBox/Checkbox.d.ts +10 -0
  29. package/dist/src/Components/FormElements/ColorInput/ColorInput.d.ts +17 -0
  30. package/dist/src/Components/FormElements/ColorInput/sharedSelectedColor.d.ts +4 -0
  31. package/dist/src/Components/FormElements/ImageInput/ImageInput.d.ts +17 -0
  32. package/dist/src/Components/FormElements/Input/HiddenInput.d.ts +8 -0
  33. package/dist/src/Components/FormElements/Input/Input.d.ts +10 -0
  34. package/dist/src/Components/FormElements/Input/PasswordInput/PasswordInput.d.ts +4 -0
  35. package/dist/src/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +10 -0
  36. package/dist/src/Components/FormElements/Select/Select.d.ts +16 -0
  37. package/dist/src/Components/FormElements/Slider/Slider.d.ts +8 -0
  38. package/dist/src/Components/FormElements/Switch/Switch.d.ts +12 -0
  39. package/dist/src/Components/FormElements/Textarea/Textarea.d.ts +12 -0
  40. package/dist/src/Components/FormElements/hooks/useOnChangeDone.d.ts +2 -0
  41. package/dist/src/Components/FullScreen/FullScreen.d.ts +14 -0
  42. package/dist/src/Components/Hooks/useBreakpoint.d.ts +11 -0
  43. package/dist/src/Components/Hooks/useComposedRef.d.ts +2 -0
  44. package/dist/src/Components/Hooks/useDebounced.d.ts +1 -0
  45. package/dist/src/Components/Hooks/useDelayed.d.ts +1 -0
  46. package/dist/src/Components/Hooks/useInViewport.d.ts +2 -0
  47. package/dist/src/Components/Hooks/useKeyListener.d.ts +3 -0
  48. package/dist/src/Components/Hooks/useListener.d.ts +18 -0
  49. package/dist/src/Components/Hooks/useOnMount.d.ts +1 -0
  50. package/dist/src/Components/Hooks/useOnce.d.ts +1 -0
  51. package/dist/src/Components/Icon/Icon.d.ts +13 -0
  52. package/dist/src/Components/Image/Image.d.ts +12 -0
  53. package/dist/src/Components/InViewport/InViewport.d.ts +11 -0
  54. package/dist/src/Components/Layout/Block.d.ts +7 -0
  55. package/dist/src/Components/Layout/Container.d.ts +15 -0
  56. package/dist/src/Components/Layout/Flex.d.ts +10 -0
  57. package/dist/src/Components/Layout/Grid/Grid.d.ts +9 -0
  58. package/dist/src/Components/Layout/Grid/GridItem.d.ts +25 -0
  59. package/dist/src/Components/Layout/Grow.d.ts +9 -0
  60. package/dist/src/Components/Layout/Inline.d.ts +7 -0
  61. package/dist/src/Components/Layout/InlineBlock.d.ts +7 -0
  62. package/dist/src/Components/Layout/View.d.ts +9 -0
  63. package/dist/src/Components/Layout/ViewWithoutListeners.d.ts +8 -0
  64. package/dist/src/Components/List/BulletList/BulletList.d.ts +8 -0
  65. package/dist/src/Components/List/BulletList/ListItem.d.ts +7 -0
  66. package/dist/src/Components/List/List.d.ts +10 -0
  67. package/dist/src/Components/LoadingArea/LoadingArea.d.ts +12 -0
  68. package/dist/src/Components/LoadingCircle/LoadingCircle.d.ts +8 -0
  69. package/dist/src/Components/Menu/Menu.d.ts +16 -0
  70. package/dist/src/Components/Menu/useMenu.d.ts +3 -0
  71. package/dist/src/Components/RbmComponentProps.d.ts +31 -0
  72. package/dist/src/Components/SizeCalculator/SizeCalculator.d.ts +9 -0
  73. package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +15 -0
  74. package/dist/src/Components/SpoilerList/SpoilerList.d.ts +15 -0
  75. package/dist/src/Components/SpoilerList/useSpoilerGroup.d.ts +12 -0
  76. package/dist/src/Components/TabBar/TabBar.d.ts +30 -0
  77. package/dist/src/Components/TabBar/TabBarButton.d.ts +9 -0
  78. package/dist/src/Components/Table/Table.d.ts +36 -0
  79. package/dist/src/Components/Text/Heading.d.ts +7 -0
  80. package/dist/src/Components/Text/Text.d.ts +26 -0
  81. package/dist/src/Components/Toast/Toast.d.ts +13 -0
  82. package/dist/src/Components/Toast/ToastContainer.d.ts +7 -0
  83. package/dist/src/Components/TopBar/MoreButton.d.ts +9 -0
  84. package/dist/src/Components/TopBar/TopBar.d.ts +25 -0
  85. package/dist/src/Components/TopBar/TopBarButton.d.ts +9 -0
  86. package/dist/src/StyleProvider.d.ts +2 -0
  87. package/dist/src/TypeHelpers.d.ts +4 -0
  88. package/dist/src/WindowContext/WindowContext.d.ts +3 -0
  89. package/dist/src/WrongChildError.d.ts +4 -0
  90. package/dist/src/helper/Characters.d.ts +5 -0
  91. package/dist/src/helper/DistributiveOmit.d.ts +1 -0
  92. package/dist/src/helper/EmptyProps.d.ts +1 -0
  93. package/dist/src/helper/memoComparator.d.ts +1 -0
  94. package/dist/src/helper/nonEmptyString.d.ts +1 -0
  95. package/dist/src/helper/withForwardRef.d.ts +7 -0
  96. package/dist/src/helper/withMemo.d.ts +3 -0
  97. package/dist/src/helper/withRenderBrowserOnly.d.ts +2 -0
  98. package/dist/src/helper/withRestrictedChildren.d.ts +6 -0
  99. package/package.json +92 -0
  100. package/react-bootstrap-mobile.scss +6 -0
  101. package/scripts/getPackageJson.js +25 -0
  102. package/src/Components/ActionSheet/ActionSheet.tsx +115 -0
  103. package/src/Components/ActionSheet/actionSheet.scss +153 -0
  104. package/src/Components/Card/Card.tsx +46 -0
  105. package/src/Components/Card/card.scss +76 -0
  106. package/src/Components/Clickable/Clickable.tsx +174 -0
  107. package/src/Components/Clickable/clickable.scss +3 -0
  108. package/src/Components/Dialog/AlertDialog.tsx +44 -0
  109. package/src/Components/Dialog/ButtonDialog.tsx +57 -0
  110. package/src/Components/Dialog/ConfirmDialog.tsx +46 -0
  111. package/src/Components/Dialog/Dialog.tsx +82 -0
  112. package/src/Components/Dialog/DialogBackground.tsx +38 -0
  113. package/src/Components/Dialog/DialogContainer.tsx +77 -0
  114. package/src/Components/Dialog/DialogContext.ts +21 -0
  115. package/src/Components/Dialog/buttonDialog.scss +114 -0
  116. package/src/Components/Dialog/dialog.scss +30 -0
  117. package/src/Components/Dialog/dialogBackground.scss +4 -0
  118. package/src/Components/Dialog/useAlertDialog.ts +13 -0
  119. package/src/Components/Dialog/useConfirmDialog.ts +13 -0
  120. package/src/Components/DragAndDrop/DragItem.tsx +38 -0
  121. package/src/Components/DragAndDrop/DropArea.tsx +43 -0
  122. package/src/Components/DragAndDrop/useStrictEnabled.ts +20 -0
  123. package/src/Components/FormElements/Button/Button.tsx +25 -0
  124. package/src/Components/FormElements/Button/button.scss +39 -0
  125. package/src/Components/FormElements/CheckBox/Checkbox.tsx +61 -0
  126. package/src/Components/FormElements/CheckBox/checkbox.scss +107 -0
  127. package/src/Components/FormElements/ColorInput/ColorInput.tsx +139 -0
  128. package/src/Components/FormElements/ColorInput/colorInput.scss +35 -0
  129. package/src/Components/FormElements/ColorInput/sharedSelectedColor.ts +40 -0
  130. package/src/Components/FormElements/ImageInput/ImageInput.tsx +97 -0
  131. package/src/Components/FormElements/ImageInput/imageInput.scss +24 -0
  132. package/src/Components/FormElements/Input/HiddenInput.tsx +43 -0
  133. package/src/Components/FormElements/Input/Input.tsx +102 -0
  134. package/src/Components/FormElements/Input/PasswordInput/PasswordInput.tsx +55 -0
  135. package/src/Components/FormElements/Input/PasswordInput/passwordInput.scss +7 -0
  136. package/src/Components/FormElements/Input/input.scss +57 -0
  137. package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +162 -0
  138. package/src/Components/FormElements/SearchSelectInput/seachSelectInput.scss +90 -0
  139. package/src/Components/FormElements/Select/Select.tsx +77 -0
  140. package/src/Components/FormElements/Select/select.scss +51 -0
  141. package/src/Components/FormElements/Slider/Slider.tsx +80 -0
  142. package/src/Components/FormElements/Slider/slider.scss +92 -0
  143. package/src/Components/FormElements/Switch/Switch.tsx +82 -0
  144. package/src/Components/FormElements/Switch/switch.scss +149 -0
  145. package/src/Components/FormElements/Textarea/Textarea.tsx +77 -0
  146. package/src/Components/FormElements/Textarea/textarea.scss +22 -0
  147. package/src/Components/FormElements/hooks/useOnChangeDone.ts +16 -0
  148. package/src/Components/FullScreen/FullScreen.tsx +89 -0
  149. package/src/Components/Hooks/useBreakpoint.ts +66 -0
  150. package/src/Components/Hooks/useComposedRef.ts +17 -0
  151. package/src/Components/Hooks/useDebounced.ts +22 -0
  152. package/src/Components/Hooks/useDelayed.ts +46 -0
  153. package/src/Components/Hooks/useInViewport.ts +23 -0
  154. package/src/Components/Hooks/useKeyListener.ts +77 -0
  155. package/src/Components/Hooks/useListener.ts +73 -0
  156. package/src/Components/Hooks/useOnMount.ts +12 -0
  157. package/src/Components/Hooks/useOnce.ts +11 -0
  158. package/src/Components/Icon/Icon.tsx +45 -0
  159. package/src/Components/Image/Image.tsx +44 -0
  160. package/src/Components/Image/image.scss +3 -0
  161. package/src/Components/InViewport/InViewport.tsx +71 -0
  162. package/src/Components/InViewport/inViewport.scss +3 -0
  163. package/src/Components/Layout/Block.tsx +48 -0
  164. package/src/Components/Layout/Container.tsx +57 -0
  165. package/src/Components/Layout/Flex.tsx +51 -0
  166. package/src/Components/Layout/Grid/Grid.tsx +53 -0
  167. package/src/Components/Layout/Grid/GridItem.tsx +138 -0
  168. package/src/Components/Layout/Grid/grid.scss +43 -0
  169. package/src/Components/Layout/Grow.tsx +51 -0
  170. package/src/Components/Layout/Inline.tsx +48 -0
  171. package/src/Components/Layout/InlineBlock.tsx +48 -0
  172. package/src/Components/Layout/View.tsx +40 -0
  173. package/src/Components/Layout/ViewWithoutListeners.tsx +40 -0
  174. package/src/Components/Layout/container.scss +12 -0
  175. package/src/Components/Layout/layout.scss +56 -0
  176. package/src/Components/List/BulletList/BulletList.tsx +33 -0
  177. package/src/Components/List/BulletList/ListItem.tsx +34 -0
  178. package/src/Components/List/List.tsx +88 -0
  179. package/src/Components/List/list.scss +30 -0
  180. package/src/Components/LoadingArea/LoadingArea.tsx +64 -0
  181. package/src/Components/LoadingArea/loadingArea.scss +19 -0
  182. package/src/Components/LoadingCircle/LoadingCircle.tsx +41 -0
  183. package/src/Components/LoadingCircle/loadingCircle.scss +42 -0
  184. package/src/Components/Menu/Menu.tsx +113 -0
  185. package/src/Components/Menu/menu.scss +21 -0
  186. package/src/Components/Menu/useMenu.ts +20 -0
  187. package/src/Components/RbmComponentProps.ts +40 -0
  188. package/src/Components/SizeCalculator/SizeCalculator.tsx +45 -0
  189. package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +106 -0
  190. package/src/Components/SpoilerList/Spoiler/spoiler.scss +120 -0
  191. package/src/Components/SpoilerList/SpoilerList.tsx +63 -0
  192. package/src/Components/SpoilerList/useSpoilerGroup.ts +39 -0
  193. package/src/Components/TabBar/TabBar.tsx +117 -0
  194. package/src/Components/TabBar/TabBarButton.tsx +44 -0
  195. package/src/Components/TabBar/tabBar.scss +108 -0
  196. package/src/Components/Table/Table.tsx +182 -0
  197. package/src/Components/Text/Heading.tsx +44 -0
  198. package/src/Components/Text/Text.tsx +79 -0
  199. package/src/Components/Text/heading.scss +3 -0
  200. package/src/Components/Text/text.scss +60 -0
  201. package/src/Components/Toast/Toast.tsx +107 -0
  202. package/src/Components/Toast/ToastContainer.tsx +35 -0
  203. package/src/Components/Toast/toast.scss +52 -0
  204. package/src/Components/TopBar/MoreButton.tsx +38 -0
  205. package/src/Components/TopBar/TopBar.tsx +176 -0
  206. package/src/Components/TopBar/TopBarButton.tsx +29 -0
  207. package/src/Components/TopBar/topBar.scss +124 -0
  208. package/src/StyleProvider.ts +4 -0
  209. package/src/TypeHelpers.ts +4 -0
  210. package/src/WindowContext/WindowContext.ts +8 -0
  211. package/src/WrongChildError.ts +19 -0
  212. package/src/env.d.ts +1 -0
  213. package/src/helper/Characters.ts +5 -0
  214. package/src/helper/DistributiveOmit.ts +1 -0
  215. package/src/helper/EmptyProps.ts +2 -0
  216. package/src/helper/memoComparator.ts +18 -0
  217. package/src/helper/nonEmptyString.ts +8 -0
  218. package/src/helper/withForwardRef.ts +28 -0
  219. package/src/helper/withMemo.ts +16 -0
  220. package/src/helper/withRenderBrowserOnly.tsx +30 -0
  221. package/src/helper/withRestrictedChildren.tsx +57 -0
  222. package/src/scss/_animations.scss +46 -0
  223. package/src/scss/_baseClasses.scss +27 -0
  224. package/src/scss/_colors.scss +13 -0
  225. package/src/scss/_default.scss +17 -0
  226. package/src/scss/_designMixin.scss +13 -0
  227. package/src/scss/_mobileMixin.scss +35 -0
  228. package/src/scss/_variables.scss +22 -0
  229. package/src/types/isomorphic-style-loader.d.ts +3 -0
  230. package/src/types/react-table-config.d.ts +120 -0
  231. package/src/types/scss-module.d.ts +7 -0
  232. package/tsconfig.json +57 -0
  233. package/webpack.config.js +85 -0
@@ -0,0 +1,10 @@
1
+ import { CSSProperties, ReactElement, ReactNode } from 'react';
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ export type ListProps<ItemType> = RbmComponentProps<{
4
+ renderItem: (item: ItemType, style: CSSProperties, index: number) => ReactElement;
5
+ itemHeight?: number;
6
+ items: ItemType[];
7
+ renderBefore?: (item: ItemType, index: number) => ReactNode;
8
+ keyExtractor?: (item: ItemType, index: number) => string;
9
+ }>;
10
+ export declare const List: <ItemType>({ items, renderItem, itemHeight: initialItemHeight, className, style, }: ListProps<ItemType>) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ export type LoadingAreaProps = RbmComponentProps<{
4
+ opacity?: number;
5
+ loading: boolean;
6
+ fullWidth?: boolean;
7
+ fullHeight?: boolean;
8
+ fullSize?: boolean;
9
+ }>;
10
+ declare function LoadingArea({ loading, fullWidth, fullSize, fullHeight, opacity, className, style, children, }: LoadingAreaProps): JSX.Element;
11
+ declare const LoadingAreaMemo: typeof LoadingArea;
12
+ export { LoadingAreaMemo as LoadingArea };
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ export type LoadingCircleProps = RbmComponentProps<{
4
+ size?: number;
5
+ }>;
6
+ declare function LoadingCircle({ size, className, style }: LoadingCircleProps): JSX.Element;
7
+ declare const LoadingCircleMemo: typeof LoadingCircle;
8
+ export { LoadingCircleMemo as LoadingCircle };
@@ -0,0 +1,16 @@
1
+ import { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
2
+ import { IconSource } from '../Icon/Icon';
3
+ export type MenuItem = {
4
+ label: string;
5
+ callback: () => void;
6
+ icon?: IconSource;
7
+ key: string;
8
+ };
9
+ export type MenuProps = RbmComponentProps<{
10
+ items: MenuItem[];
11
+ x: number;
12
+ y: number;
13
+ isOpen: boolean;
14
+ onClose: () => void;
15
+ }, WithNoChildren>;
16
+ export declare const Menu: ({ className, style, items, y, x, isOpen, onClose }: MenuProps) => JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import { MouseEvent } from 'react';
2
+ import { MenuProps } from './Menu';
3
+ export declare function useMenu(): readonly [(e: MouseEvent) => void, Omit<MenuProps, "items">];
@@ -0,0 +1,31 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { Recursive } from '../TypeHelpers';
3
+ type Child = Recursive<JSX.Element | undefined | null | Child[]> | false;
4
+ export type WithNoStringProps = {
5
+ children?: Child;
6
+ __allowChildren?: 'html';
7
+ } | {
8
+ children?: ReactNode;
9
+ __allowChildren: 'text' | 'all';
10
+ };
11
+ export type WithNoStringAndChildrenProps = {
12
+ children: Child;
13
+ __allowChildren?: 'html';
14
+ } | {
15
+ children: ReactNode;
16
+ __allowChildren: 'text' | 'all';
17
+ };
18
+ export type WithStringProps = {
19
+ children?: Recursive<string>;
20
+ };
21
+ export type WithStringAndChildrenProps = {
22
+ children: Recursive<string>;
23
+ };
24
+ export type WithNoChildren = {
25
+ children?: never;
26
+ };
27
+ export type RbmComponentProps<SpecialProps, ChildrenProps = WithNoStringProps> = ChildrenProps & {
28
+ className?: string;
29
+ style?: CSSProperties;
30
+ } & SpecialProps;
31
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { WithNoStringAndChildrenProps } from '../RbmComponentProps';
3
+ export type SizeCalculatorProps = {
4
+ onSize: (width: number, height: number) => void;
5
+ absolute?: boolean;
6
+ } & WithNoStringAndChildrenProps;
7
+ declare function SizeCalculator({ onSize, children, absolute }: SizeCalculatorProps): JSX.Element;
8
+ declare const SizeCalculatorMemo: typeof SizeCalculator;
9
+ export { SizeCalculatorMemo as SizeCalculator };
@@ -0,0 +1,15 @@
1
+ import { RbmComponentProps } from '../../RbmComponentProps';
2
+ import { ReactChild } from 'react';
3
+ import { OptionalListener } from '../../Hooks/useListener';
4
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
5
+ export type SpoilerProps<OnClickData> = RbmComponentProps<{
6
+ title: ReactChild;
7
+ initialOpen?: boolean;
8
+ open?: boolean;
9
+ noClosingAnimation?: boolean;
10
+ openIcon?: IconProp | null;
11
+ closeIcon?: IconProp | null;
12
+ } & OptionalListener<'onClick', OnClickData>>;
13
+ declare function Spoiler<OnClickData>({ title, children, initialOpen, noClosingAnimation, openIcon, closeIcon, className, style, open, ...listenerProps }: SpoilerProps<OnClickData>): JSX.Element;
14
+ declare const SpoilerMemo: typeof Spoiler;
15
+ export { SpoilerMemo as Spoiler };
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
3
+ export type SpoilerItem<BodyData, TitleData = string> = {
4
+ title: TitleData;
5
+ body: BodyData;
6
+ key: number | string;
7
+ };
8
+ export type SpoilerListProps<BodyData, TitleData = string> = RbmComponentProps<{
9
+ data: SpoilerItem<BodyData, TitleData>[];
10
+ renderBody: (item: SpoilerItem<BodyData, TitleData>) => ReactElement;
11
+ renderTitle?: (item: SpoilerItem<BodyData, TitleData>) => ReactElement | string;
12
+ }, WithNoChildren>;
13
+ declare function SpoilerList<BodyData, TitleData = string>({ data, renderBody, renderTitle, className, style, }: SpoilerListProps<BodyData, TitleData>): JSX.Element;
14
+ declare const SpoilerListMemo: typeof SpoilerList;
15
+ export { SpoilerListMemo as SpoilerList };
@@ -0,0 +1,12 @@
1
+ export type SpoilerGroupOptions = {
2
+ closeWithClick: boolean;
3
+ noClosingAnimation: boolean;
4
+ };
5
+ export declare function useSpoilerGroup(defaultKey?: number | string, options?: Partial<SpoilerGroupOptions>): readonly [(key: string | number) => {
6
+ onClick: (isOpen: boolean, key: string | number) => void;
7
+ onClickData: string | number;
8
+ key: string | number;
9
+ open: boolean;
10
+ noClosingAnimation: boolean;
11
+ closeIcon: null;
12
+ }, string | number | undefined];
@@ -0,0 +1,30 @@
1
+ import { RbmComponentProps } from '../RbmComponentProps';
2
+ import { IconSource } from '../Icon/Icon';
3
+ import { ComponentType } from 'react';
4
+ export type TabBarComponentButtonType = {
5
+ component: ComponentType<Record<string, any>>;
6
+ key?: string;
7
+ };
8
+ export type TabBarTitleButtonType = {
9
+ title: string;
10
+ icon?: IconSource;
11
+ key?: string;
12
+ };
13
+ export type TabBarIconButtonType = {
14
+ title?: string;
15
+ icon: IconSource;
16
+ key?: string;
17
+ };
18
+ export type TabBarButtonType = TabBarComponentButtonType | TabBarTitleButtonType | TabBarIconButtonType;
19
+ export type TabBarProps = RbmComponentProps<{
20
+ buttons: TabBarButtonType[];
21
+ startActiveTab?: number;
22
+ onTabChange: (newActiveTab: number) => void;
23
+ activeTab?: number;
24
+ transparent?: boolean;
25
+ drawBehind?: boolean;
26
+ underline?: boolean;
27
+ }>;
28
+ declare function TabBar({ buttons, startActiveTab, onTabChange, activeTab, transparent, underline, className, ...rbmProps }: TabBarProps): JSX.Element;
29
+ declare const TabBarMemo: typeof TabBar;
30
+ export { TabBarMemo as TabBar };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ import { Listener } from '../Hooks/useListener';
4
+ export type TabBarButtonProps = RbmComponentProps<{
5
+ active: boolean;
6
+ } & Listener<'onClick', number>>;
7
+ declare function TabBarButton({ active, className, children, ...rbmProps }: TabBarButtonProps): JSX.Element;
8
+ declare const TabBarButtonMemo: typeof TabBarButton;
9
+ export { TabBarButtonMemo as TabBarButton };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { Cell, Column as RTColumn, HeaderGroup, Row, UseSortByOptions } from 'react-table';
3
+ import { RbmComponentProps } from '../RbmComponentProps';
4
+ import { ReactNode } from 'react';
5
+ export type ColumnCellData<DataType extends string | number | Record<string, unknown>> = {
6
+ value: DataType;
7
+ cell: {
8
+ column: {
9
+ id: string;
10
+ };
11
+ row: {
12
+ original: Record<string, DataType>;
13
+ index: number;
14
+ id: string;
15
+ };
16
+ };
17
+ };
18
+ export type Column<DataType extends string | number | Record<string, unknown>> = RTColumn<Record<string, DataType>> & {
19
+ Cell?: (cellData: ColumnCellData<DataType>) => ReactNode;
20
+ };
21
+ export type TableSortOptions<DataType extends string | number | Record<string, unknown>> = UseSortByOptions<Record<string, DataType>> & {
22
+ renderSortIndicator?: (column: HeaderGroup<Record<string, DataType>>) => ReactNode;
23
+ };
24
+ export type TableProps<DataType extends string | number | Record<string, unknown>> = RbmComponentProps<{
25
+ columns: Column<DataType>[];
26
+ data: Record<string, DataType>[];
27
+ cellRenderer?: ({ value }: {
28
+ value: DataType;
29
+ }) => ReactNode;
30
+ sortOptions?: TableSortOptions<DataType>;
31
+ getCellProperties?: (row: Cell<Record<string, DataType>>) => React.TdHTMLAttributes<HTMLTableDataCellElement>;
32
+ getRowProperties?: (row: Row<Record<string, DataType>>) => React.HTMLAttributes<HTMLTableRowElement>;
33
+ }>;
34
+ declare function Table<DataType extends string | number | Record<string, unknown>>({ columns, data, cellRenderer, sortOptions, className, style, getCellProperties, getRowProperties, }: TableProps<DataType>): JSX.Element;
35
+ declare const tmp: typeof Table;
36
+ export { tmp as Table };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps, WithStringProps } from '../RbmComponentProps';
3
+ import { EmptyProps } from '../../helper/EmptyProps';
4
+ export type HeadingProps = RbmComponentProps<EmptyProps, WithStringProps>;
5
+ declare function Heading({ children, className, style }: HeadingProps): JSX.Element;
6
+ declare const HeadingMemo: typeof Heading;
7
+ export { HeadingMemo as Heading };
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { Recursive, ValueOf } from '../../TypeHelpers';
3
+ import { ViewProps } from '../Layout/View';
4
+ export declare const TEXT_PRIO: {
5
+ primary: string;
6
+ secondary: string;
7
+ heading: string;
8
+ };
9
+ export declare const TEXT_SIZE: {
10
+ xSmall: string;
11
+ small: string;
12
+ medium: string;
13
+ large: string;
14
+ xLarge: string;
15
+ xxLarge: string;
16
+ };
17
+ export type TextProps<AsType extends keyof JSX.IntrinsicElements> = {
18
+ block?: boolean;
19
+ prio?: ValueOf<typeof TEXT_PRIO>;
20
+ size?: ValueOf<typeof TEXT_SIZE>;
21
+ className?: string;
22
+ children: Recursive<string | undefined | null | number>;
23
+ } & ViewProps<AsType>;
24
+ declare function Text<AsType extends keyof JSX.IntrinsicElements = 'span'>({ className, children, block, prio, size, as, ...props }: TextProps<AsType>): JSX.Element;
25
+ declare const tmp: typeof Text;
26
+ export { tmp as Text };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps, WithNoStringAndChildrenProps } from '../RbmComponentProps';
3
+ import { Listener, OptionalListener } from '../Hooks/useListener';
4
+ type WithoutActionProps<DismissedData> = {
5
+ timeToShow?: number;
6
+ } & OptionalListener<'onDismissed', DismissedData>;
7
+ type WithActionProps<ActionData, DismissedData> = WithoutActionProps<DismissedData> & {
8
+ actionName: string;
9
+ } & Listener<'onClick', ActionData>;
10
+ export type ToastProps<ActionData, DismissedData> = RbmComponentProps<WithActionProps<ActionData, DismissedData> | WithoutActionProps<DismissedData>, WithNoStringAndChildrenProps>;
11
+ declare function Toast<ActionData, DismissedData>({ className, timeToShow, children, style, ...otherProps }: ToastProps<ActionData, DismissedData>): JSX.Element | null;
12
+ declare const ToastMemo: typeof Toast;
13
+ export { ToastMemo as Toast };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ import { EmptyProps } from '../../helper/EmptyProps';
4
+ export type ToastContainerProps = RbmComponentProps<EmptyProps>;
5
+ declare function ToastContainer({ className, children, style }: ToastContainerProps): JSX.Element;
6
+ declare const ToastContainerMemo: typeof ToastContainer;
7
+ export { ToastContainerMemo as ToastContainer };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ export type MoreButtonProps = RbmComponentProps<{
4
+ disabled?: boolean;
5
+ onClick?: () => void;
6
+ }>;
7
+ declare function MoreButton({ onClick, disabled, className, style }: MoreButtonProps): JSX.Element;
8
+ declare const MoreButtonMemo: typeof MoreButton;
9
+ export { MoreButtonMemo as MoreButton };
@@ -0,0 +1,25 @@
1
+ import { ComponentType } from 'react';
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ import { IconSource } from '../Icon/Icon';
4
+ export type TopBarActionButtonType = {
5
+ title: string;
6
+ icon?: IconSource;
7
+ action: () => void;
8
+ disabled?: boolean;
9
+ key?: string;
10
+ };
11
+ export type TopBarComponentButtonType = Partial<TopBarActionButtonType> & {
12
+ component: ComponentType<Record<string, any>>;
13
+ };
14
+ export type TopBarButtonType = TopBarComponentButtonType | TopBarActionButtonType;
15
+ export type TopBarProps = RbmComponentProps<{
16
+ title?: string;
17
+ leftButtons?: TopBarButtonType[];
18
+ rightButtons?: TopBarButtonType[];
19
+ hiddenButtons?: TopBarButtonType[];
20
+ transparent?: boolean;
21
+ drawBehind?: boolean;
22
+ }>;
23
+ declare function TopBar({ title, rightButtons, leftButtons, hiddenButtons, className, transparent, drawBehind, ...rbmProps }: TopBarProps): JSX.Element;
24
+ declare const TopBarMemo: typeof TopBar;
25
+ export { TopBarMemo as TopBar };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ export type TopBarButtonProps = RbmComponentProps<{
4
+ disabled?: boolean;
5
+ onClick?: () => void;
6
+ }>;
7
+ declare function TopBarButton({ disabled, onClick, className, children, ...rbmProps }: TopBarButtonProps): JSX.Element;
8
+ declare const TopBarButtonMemo: typeof TopBarButton;
9
+ export { TopBarButtonMemo as TopBarButton };
@@ -0,0 +1,2 @@
1
+ declare const provider: any;
2
+ export { provider as StyleProvider };
@@ -0,0 +1,4 @@
1
+ export type Override<T1, T2> = Omit<T1, keyof T2> & T2;
2
+ export type Conditional<T1, T2> = Partial<T1> | (T1 & T2);
3
+ export type ValueOf<T> = T[keyof T];
4
+ export type Recursive<T> = T | T[] | Recursive<T>[];
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const WindowContext: React.Context<Window | undefined>;
3
+ export declare function useWindow(): Window | undefined;
@@ -0,0 +1,4 @@
1
+ export declare class WrongChildError extends Error {
2
+ childValue: any;
3
+ constructor(expectedType: string, gotType: string, child: any, component: string);
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare const Characters: {
2
+ NBSP: string;
3
+ PATH_DELIMITER: string;
4
+ MIDDLE_DOT: string;
5
+ };
@@ -0,0 +1 @@
1
+ export type DistributiveOmit<T, K extends keyof T> = T extends any ? Omit<T, K> : never;
@@ -0,0 +1 @@
1
+ export type EmptyProps = {};
@@ -0,0 +1 @@
1
+ export declare function memoComparator(prevProps: Readonly<any>, nextProps: Readonly<any>): boolean;
@@ -0,0 +1 @@
1
+ export declare function nonEmptyString(str: string | undefined | null, other?: string): string;
@@ -0,0 +1,7 @@
1
+ import { ForwardRefRenderFunction, PropsWithoutRef, ReactElement, RefAttributes } from 'react';
2
+ import { RESTRICT_CHILDREN } from './withRestrictedChildren';
3
+ export interface RefComponent<PropTypes, ForwardedRefType> {
4
+ (props: PropsWithoutRef<PropTypes> & RefAttributes<ForwardedRefType>): ReactElement | null;
5
+ displayName?: string | undefined;
6
+ }
7
+ export declare function withForwardRef<PropTypes, ForwardedRefType>(component: ForwardRefRenderFunction<ForwardedRefType, PropTypes>, styles?: any, defaultAllowChildren?: typeof RESTRICT_CHILDREN['allowChildren']): RefComponent<PropTypes, ForwardedRefType>;
@@ -0,0 +1,3 @@
1
+ import { ComponentType } from 'react';
2
+ import { RESTRICT_CHILDREN } from './withRestrictedChildren';
3
+ export declare function withMemo<C extends ComponentType<any>>(component: C, styles?: any, defaultAllowChildren?: typeof RESTRICT_CHILDREN['allowChildren']): C;
@@ -0,0 +1,2 @@
1
+ import { ComponentType } from 'react';
2
+ export declare function withRenderBrowserOnly<C extends ComponentType<any>>(Component: C): C;
@@ -0,0 +1,6 @@
1
+ import React, { ComponentType, ForwardedRef, ReactElement } from 'react';
2
+ import { RbmComponentProps } from '../Components/RbmComponentProps';
3
+ export declare const RESTRICT_CHILDREN: {
4
+ allowChildren: "html" | "text" | "all" | undefined;
5
+ };
6
+ export declare function withRestrictedChildren<C extends ComponentType<RbmComponentProps<Record<string, any>>>>(Component: C, defaultAllowChildren?: typeof RESTRICT_CHILDREN['allowChildren']): (props: React.ComponentProps<C>, ref: React.ForwardedRef<React.ComponentRef<C>>) => ReactElement;
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "@ainias42/react-bootstrap-mobile",
3
+ "version": "0.1.7",
4
+ "description": "Mobile React Components using Bootstrap",
5
+ "main": "dist/bootstrapReactMobile",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "node bin/build.js && webpack",
9
+ "build:production": "node bin/build.js && webpack --env production",
10
+ "update packages": "node bin/updateCopies.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/Ainias/Bootstrap-React-Mobile.git"
15
+ },
16
+ "keywords": [
17
+ "bootstrap",
18
+ "react",
19
+ "mobile"
20
+ ],
21
+ "author": "Silas Günther",
22
+ "license": "MIT",
23
+ "bugs": {
24
+ "url": "https://github.com/Ainias/Bootstrap-React-Mobile/issues"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "homepage": "https://github.com/Ainias/Bootstrap-React-Mobile#readme",
30
+ "peerDependencies": {
31
+ "@fortawesome/fontawesome-svg-core": "^1.2.36",
32
+ "@fortawesome/free-regular-svg-icons": "^5.15.4",
33
+ "@fortawesome/free-solid-svg-icons": "^5.15.4",
34
+ "@fortawesome/react-fontawesome": "^0.1.16",
35
+ "react": ">=17.0.0",
36
+ "react-beautiful-dnd": "^13.1.1"
37
+ },
38
+ "devDependencies": {
39
+ "@babel/core": "^7.15.0",
40
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
41
+ "@babel/plugin-transform-typescript": "^7.16.8",
42
+ "@babel/preset-env": "^7.17.10",
43
+ "@babel/preset-react": "^7.16.7",
44
+ "@babel/preset-typescript": "^7.16.7",
45
+ "@types/react": ">=17.0.0",
46
+ "@types/react-beautiful-dnd": "^13.1.3",
47
+ "@types/react-color": "^3.0.6",
48
+ "@types/react-dom": ">=17.0.0",
49
+ "@types/react-redux": "^7.1.18",
50
+ "@types/react-table": "^7.7.9",
51
+ "@types/react-window": "^1.8.5",
52
+ "@types/react-window-infinite-loader": "^1.0.6",
53
+ "@typescript-eslint/eslint-plugin": "^4.30.0",
54
+ "@typescript-eslint/parser": "^4.30.0",
55
+ "babel-loader": "^8.2.5",
56
+ "bootstrap": "^5.1.0",
57
+ "css-loader": "^6.7.1",
58
+ "eslint": "^7.32.0",
59
+ "eslint-config-airbnb": "^18.2.1",
60
+ "eslint-config-airbnb-typescript": "^14.0.0",
61
+ "eslint-config-prettier": "^8.3.0",
62
+ "eslint-import-resolver-typescript": "^2.4.0",
63
+ "eslint-plugin-import": "^2.26.0",
64
+ "eslint-plugin-react": "^7.25.1",
65
+ "html-webpack-plugin": "^5.5.0",
66
+ "loader-utils": "3.2.1",
67
+ "mini-css-extract-plugin": "^2.6.0",
68
+ "prettier": "^2.3.2",
69
+ "sass": "^1.53.0",
70
+ "sass-loader": "^12.6.0",
71
+ "style-loader": "^3.3.1",
72
+ "terser-webpack-plugin": "^5.3.1",
73
+ "ts-loader": "^9.2.9",
74
+ "tsc": "^2.0.4",
75
+ "typescript": "^4.5.2",
76
+ "webpack": "^5.72.0",
77
+ "webpack-cli": "^4.9.2",
78
+ "webpack-dev-server": "^4.8.1"
79
+ },
80
+ "dependencies": {
81
+ "@types/react-virtualized-auto-sizer": "^1.0.1",
82
+ "classnames": "^2.3.1",
83
+ "isomorphic-style-loader": "^5.3.2",
84
+ "@ainias42/js-helper": ">=0.7.12",
85
+ "react-color": "^2.19.3",
86
+ "react-table": "^7.7.0",
87
+ "react-virtualized-auto-sizer": "^1.0.7",
88
+ "react-window": "^1.8.8",
89
+ "react-window-infinite-loader": "^1.0.8",
90
+ "styled-jsx": "^5.0.2"
91
+ }
92
+ }
@@ -0,0 +1,6 @@
1
+ @import "src/scss/variables";
2
+ @import "src/scss/mobileMixin";
3
+ @import "src/scss/default";
4
+ @import "src/scss/animations";
5
+ @import "src/scss/baseClasses";
6
+ @import "src/scss/colors";
@@ -0,0 +1,25 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ /**
5
+ * A module to get package informations from package.json
6
+ * @module getPackageJson
7
+ * @param {...string} keys from package.json if no arguments passed it returns package.json content as object
8
+ * @returns {object} with given keys or content of package.json as object
9
+ */
10
+
11
+ /**
12
+ * Returns package info
13
+ */
14
+ const getPackageJson = function (...args) {
15
+ const packageJSON = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')));
16
+ if (!args.length) {
17
+ return packageJSON;
18
+ }
19
+ return args.reduce((out, key) => {
20
+ out[key] = packageJSON[key];
21
+ return out;
22
+ }, {});
23
+ };
24
+
25
+ module.exports = getPackageJson;
@@ -0,0 +1,115 @@
1
+ import * as React from 'react';
2
+ import { RbmComponentProps } from '../RbmComponentProps';
3
+ import { Ref, useCallback, useImperativeHandle, useState } from 'react';
4
+ import { Clickable } from '../Clickable/Clickable';
5
+ import { Container } from '../Layout/Container';
6
+ import { faTimes } from '@fortawesome/free-solid-svg-icons';
7
+ import { Icon, IconSource } from '../Icon/Icon';
8
+
9
+ import styles from './actionSheet.scss';
10
+ import { withForwardRef } from '../../helper/withForwardRef';
11
+ import classNames from 'classnames';
12
+ import { InlineBlock } from '../Layout/InlineBlock';
13
+ import { Text } from '../Text/Text';
14
+ import { Flex } from '../Layout/Flex';
15
+ import { Block } from '../Layout/Block';
16
+
17
+ export type ActionSheetAction<ActionData> = {
18
+ name: string;
19
+ icon?: IconSource;
20
+ action: (data?: ActionData) => void;
21
+ actionData?: ActionData;
22
+ isDeleteAction?: boolean;
23
+ };
24
+
25
+ export type ActionSheetProps = RbmComponentProps<{
26
+ title?: string;
27
+ actions: ActionSheetAction<any>[];
28
+ cancelText?: string;
29
+ onClose?: () => void;
30
+ }>;
31
+
32
+ export type ActionSheetHandle = {
33
+ show: () => void;
34
+ hide: () => void;
35
+ };
36
+
37
+ function ActionSheet(
38
+ { title, actions, cancelText = 'Cancel', className, onClose, style }: ActionSheetProps,
39
+ ref: Ref<ActionSheetHandle>
40
+ ) {
41
+ const [isOpen, setIsOpen] = useState(false);
42
+
43
+ // Variables
44
+
45
+ // States
46
+
47
+ // Refs
48
+
49
+ // Callbacks
50
+ const close = useCallback(() => {
51
+ setIsOpen(false);
52
+ if (onClose) {
53
+ onClose();
54
+ }
55
+ }, [setIsOpen, onClose]);
56
+ const onActionClick = useCallback(
57
+ (_: any, action?: ActionSheetAction<any>) => {
58
+ close();
59
+ action?.action(action.actionData);
60
+ },
61
+ [close]
62
+ );
63
+
64
+ useImperativeHandle(
65
+ ref,
66
+ () => ({
67
+ show: () => setIsOpen(true),
68
+ hide: close,
69
+ }),
70
+ [setIsOpen, close]
71
+ );
72
+
73
+ // Effects
74
+
75
+ // Other
76
+
77
+ const renderAction = (action: ActionSheetAction<any>) => (
78
+ <Clickable key={action.name} className={styles.action} onClick={onActionClick} onClickData={action}>
79
+ <InlineBlock className={styles.actionIcon}>{action.icon ? <Icon icon={action.icon} /> : null}</InlineBlock>
80
+ <Text>{action.name}</Text>
81
+ </Clickable>
82
+ );
83
+
84
+ return (
85
+ <Clickable
86
+ className={classNames(styles.actionSheet, { [styles.open]: actions.length > 0 && isOpen }, className)}
87
+ onClick={close}
88
+ style={style}
89
+ >
90
+ <Container fluid="xxl" className="full-height">
91
+ <Flex className={styles.content}>
92
+ {title ? (
93
+ <Block>
94
+ <Text>{title}</Text>
95
+ </Block>
96
+ ) : null}
97
+ {actions.map(renderAction)}
98
+ <Clickable
99
+ className={styles.cancel}
100
+ onClick={() => console.log('Cancel clicked')}
101
+ __allowChildren="all"
102
+ >
103
+ <InlineBlock className={styles.actionIcon}>
104
+ <Icon icon={faTimes} />
105
+ </InlineBlock>
106
+ {cancelText}
107
+ </Clickable>
108
+ </Flex>
109
+ </Container>
110
+ </Clickable>
111
+ );
112
+ }
113
+
114
+ const ActionSheetMemo = withForwardRef<ActionSheetProps, ActionSheetHandle>(ActionSheet, styles);
115
+ export { ActionSheetMemo as ActionSheet };