react-input-material 0.0.433 → 0.0.435

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.
@@ -1,48 +0,0 @@
1
- // #!/usr/bin/env babel-node
2
- // -*- coding: utf-8 -*-
3
- /** @module WrapThemeProvider */
4
- 'use strict'
5
- /* !
6
- region header
7
- [Project page](https://torben.website/react-material-input)
8
-
9
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
10
-
11
- License
12
- -------
13
-
14
- This library written by Torben Sickert stand under a creative commons
15
- naming 3.0 unported license.
16
- See https://creativecommons.org/licenses/by/3.0/deed.de
17
- endregion
18
- */
19
- // region imports
20
- import {FunctionComponent, ReactElement} from 'react'
21
- import {ThemeProvider, ThemeProviderProps} from '@rmwc/theme'
22
- // endregion
23
- /**
24
- * Wraps a theme provider to given element if a configuration is provided.
25
- * @param properties - Component provided properties.
26
- * @param properties.children - Component or string to wrap.
27
- * @param properties.configuration - Potential theme provider configuration.
28
- * @param properties.wrap - Instead of injecting a div tag, wrap a child
29
- * component by merging the theme styles directly onto it. Useful when you
30
- * don't want to mess with layout.
31
- *
32
- * @returns Wrapped content.
33
- */
34
- export const WrapThemeProvider:FunctionComponent<{
35
- children:ReactElement
36
- configuration?:ThemeProviderProps['options']
37
- wrap?:boolean
38
- }> = ({children, configuration, wrap}):ReactElement => configuration ?
39
- <ThemeProvider options={configuration} wrap={wrap !== false}>
40
- {children}
41
- </ThemeProvider> :
42
- children
43
-
44
- export default WrapThemeProvider
45
- // region vim modline
46
- // vim: set tabstop=4 shiftwidth=4 expandtab:
47
- // vim: foldmethod=marker foldmarker=region,endregion:
48
- // endregion
@@ -1,67 +0,0 @@
1
- // #!/usr/bin/env babel-node
2
- // -*- coding: utf-8 -*-
3
- /** @module WrapTooltip */
4
- 'use strict'
5
- /* !
6
- region header
7
- [Project page](https://torben.website/react-material-input)
8
-
9
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
10
-
11
- License
12
- -------
13
-
14
- This library written by Torben Sickert stand under a creative commons
15
- naming 3.0 unported license.
16
- See https://creativecommons.org/licenses/by/3.0/deed.de
17
- endregion
18
- */
19
- // region imports
20
- import {FunctionComponent, ReactElement} from 'react'
21
- import {Typography} from '@rmwc/typography'
22
- import {Tooltip} from '@rmwc/tooltip'
23
-
24
- import {Properties} from '../type'
25
- // endregion
26
- /**
27
- * Wraps given component with a tooltip component with given tooltip
28
- * configuration.
29
- * @param properties - Component provided properties.
30
- * @param properties.children - Component or string to wrap.
31
- * @param properties.options - Tooltip options.
32
- *
33
- * @returns Wrapped given content.
34
- */
35
- export const WrapTooltip:FunctionComponent<{
36
- children:ReactElement
37
- options?:Properties['tooltip']
38
- }> = ({children, options}):ReactElement => {
39
- if (typeof options === 'string')
40
- return <Tooltip
41
- content={<Typography use="caption">{options}</Typography>}
42
- >
43
- <div className="generic-tooltip">{children}</div>
44
- </Tooltip>
45
-
46
- if (options !== null && typeof options === 'object') {
47
- if (typeof options.content === 'string')
48
- options = {
49
- ...options,
50
- content: <Typography use="caption">
51
- {options.content}
52
- </Typography>
53
- }
54
-
55
- return <Tooltip {...options}>
56
- <div className="generic-tooltip">{children}</div>
57
- </Tooltip>
58
- }
59
-
60
- return <>{children}</>
61
- }
62
-
63
- export default WrapTooltip
64
- // region vim modline
65
- // vim: set tabstop=4 shiftwidth=4 expandtab:
66
- // vim: foldmethod=marker foldmarker=region,endregion:
67
- // endregion