@instructure/ui-text-area 11.6.0 → 11.6.1-snapshot-129
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/CHANGELOG.md +40 -291
- package/es/TextArea/{index.js → v1/index.js} +2 -2
- package/es/TextArea/v2/index.js +350 -0
- package/es/TextArea/v2/props.js +26 -0
- package/es/TextArea/v2/styles.js +129 -0
- package/es/TextArea/v2/theme.js +76 -0
- package/es/{index.js → exports/a.js} +1 -1
- package/{src/index.ts → es/exports/b.js} +1 -2
- package/lib/TextArea/{index.js → v1/index.js} +4 -4
- package/lib/TextArea/v2/index.js +361 -0
- package/lib/TextArea/v2/props.js +31 -0
- package/lib/TextArea/v2/styles.js +135 -0
- package/lib/TextArea/v2/theme.js +82 -0
- package/lib/{index.js → exports/a.js} +2 -2
- package/lib/exports/b.js +12 -0
- package/package.json +43 -21
- package/src/TextArea/{index.tsx → v1/index.tsx} +2 -2
- package/src/TextArea/{props.ts → v1/props.ts} +1 -1
- package/src/TextArea/{styles.ts → v1/styles.ts} +4 -3
- package/src/TextArea/v2/README.md +136 -0
- package/src/TextArea/v2/index.tsx +434 -0
- package/src/TextArea/v2/props.ts +160 -0
- package/src/TextArea/v2/styles.ts +156 -0
- package/src/TextArea/v2/theme.ts +87 -0
- package/src/exports/a.ts +25 -0
- package/src/exports/b.ts +25 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TextArea/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/TextArea/v1/index.d.ts.map +1 -0
- package/types/TextArea/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/TextArea/v1/props.d.ts.map +1 -0
- package/types/TextArea/v1/styles.d.ts.map +1 -0
- package/types/TextArea/v1/theme.d.ts.map +1 -0
- package/types/TextArea/v2/index.d.ts +84 -0
- package/types/TextArea/v2/index.d.ts.map +1 -0
- package/types/TextArea/v2/props.d.ts +92 -0
- package/types/TextArea/v2/props.d.ts.map +1 -0
- package/types/TextArea/v2/styles.d.ts +21 -0
- package/types/TextArea/v2/styles.d.ts.map +1 -0
- package/types/TextArea/v2/theme.d.ts +10 -0
- package/types/TextArea/v2/theme.d.ts.map +1 -0
- package/types/exports/a.d.ts +3 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +3 -0
- package/types/exports/b.d.ts.map +1 -0
- package/types/TextArea/index.d.ts.map +0 -1
- package/types/TextArea/props.d.ts.map +0 -1
- package/types/TextArea/styles.d.ts.map +0 -1
- package/types/TextArea/theme.d.ts.map +0 -1
- package/types/index.d.ts +0 -3
- package/types/index.d.ts.map +0 -1
- /package/es/TextArea/{props.js → v1/props.js} +0 -0
- /package/es/TextArea/{styles.js → v1/styles.js} +0 -0
- /package/es/TextArea/{theme.js → v1/theme.js} +0 -0
- /package/lib/TextArea/{props.js → v1/props.js} +0 -0
- /package/lib/TextArea/{styles.js → v1/styles.js} +0 -0
- /package/lib/TextArea/{theme.js → v1/theme.js} +0 -0
- /package/src/TextArea/{README.md → v1/README.md} +0 -0
- /package/src/TextArea/{theme.ts → v1/theme.ts} +0 -0
- /package/types/TextArea/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/TextArea/{theme.d.ts → v1/theme.d.ts} +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
import type { TextareaHTMLAttributes } from 'react'
|
|
27
|
+
import type {
|
|
28
|
+
OtherHTMLAttributes,
|
|
29
|
+
PickPropsWithExceptions
|
|
30
|
+
} from '@instructure/shared-types'
|
|
31
|
+
import type { FormMessage, FormFieldOwnProps } from '@instructure/ui-form-field/latest'
|
|
32
|
+
import type {
|
|
33
|
+
ComponentStyle,
|
|
34
|
+
Spacing,
|
|
35
|
+
ThemeOverrideValue
|
|
36
|
+
} from '@instructure/emotion'
|
|
37
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
38
|
+
|
|
39
|
+
type TextAreaOwnProps = {
|
|
40
|
+
label: React.ReactNode
|
|
41
|
+
id?: string
|
|
42
|
+
/**
|
|
43
|
+
* sets the font-size for the textarea
|
|
44
|
+
*/
|
|
45
|
+
size?: 'small' | 'medium' | 'large'
|
|
46
|
+
layout?: 'stacked' | 'inline'
|
|
47
|
+
/**
|
|
48
|
+
* the textarea will expand vertically to fit the height of the content,
|
|
49
|
+
* unless its content exceeds `maxHeight`
|
|
50
|
+
*/
|
|
51
|
+
autoGrow?: boolean
|
|
52
|
+
/**
|
|
53
|
+
* is the textarea resizable (in supported browsers)
|
|
54
|
+
*/
|
|
55
|
+
resize?: 'none' | 'both' | 'horizontal' | 'vertical'
|
|
56
|
+
/**
|
|
57
|
+
* a fixed width for the textarea
|
|
58
|
+
*/
|
|
59
|
+
width?: string
|
|
60
|
+
/**
|
|
61
|
+
* Initial height for the textarea (if autoGrow is true it will grow vertically)
|
|
62
|
+
* Accepts CSS units, e.g. '55px'
|
|
63
|
+
*/
|
|
64
|
+
height?: string
|
|
65
|
+
/**
|
|
66
|
+
* when autoGrow is true, the textarea will never grow beyond this value
|
|
67
|
+
*/
|
|
68
|
+
maxHeight?: number | string
|
|
69
|
+
/**
|
|
70
|
+
* Array of objects with shape: `{
|
|
71
|
+
* text: React.ReactNode,
|
|
72
|
+
* type: One of: ['newError', 'error', 'hint', 'success', 'screenreader-only']
|
|
73
|
+
* }`
|
|
74
|
+
*/
|
|
75
|
+
messages?: FormMessage[]
|
|
76
|
+
inline?: boolean
|
|
77
|
+
/**
|
|
78
|
+
* Html placeholder text to display when the input has no value. This should be hint text, not a label
|
|
79
|
+
* replacement.
|
|
80
|
+
*/
|
|
81
|
+
placeholder?: string
|
|
82
|
+
/**
|
|
83
|
+
* Whether or not to disable the textarea
|
|
84
|
+
*/
|
|
85
|
+
disabled?: boolean
|
|
86
|
+
/**
|
|
87
|
+
* Works just like disabled but keeps the same styles as if it were active
|
|
88
|
+
*/
|
|
89
|
+
readOnly?: boolean
|
|
90
|
+
/**
|
|
91
|
+
* Sets the required property on the underlying native textArea
|
|
92
|
+
*/
|
|
93
|
+
required?: boolean
|
|
94
|
+
/**
|
|
95
|
+
* a function that provides a reference to the actual textarea element
|
|
96
|
+
*/
|
|
97
|
+
textareaRef?: (textarea: HTMLTextAreaElement | null) => void
|
|
98
|
+
/**
|
|
99
|
+
* value to set on initial render
|
|
100
|
+
*/
|
|
101
|
+
defaultValue?: string
|
|
102
|
+
/**
|
|
103
|
+
* the selected value (must be accompanied by an `onChange` prop)
|
|
104
|
+
*/
|
|
105
|
+
value?: string // TODO: controllable(PropTypes.string)
|
|
106
|
+
/**
|
|
107
|
+
* when used with the `value` prop, the component will not control its own state
|
|
108
|
+
*/
|
|
109
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing).
|
|
113
|
+
*/
|
|
114
|
+
margin?: Spacing
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
type PropKeys = keyof TextAreaOwnProps
|
|
118
|
+
|
|
119
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
120
|
+
|
|
121
|
+
type TextAreaProps =
|
|
122
|
+
// pickProps passes through FormField.allowedProps, except the ones set manually
|
|
123
|
+
PickPropsWithExceptions<
|
|
124
|
+
FormFieldOwnProps,
|
|
125
|
+
'label' | 'inline' | 'id' | 'elementRef'
|
|
126
|
+
> &
|
|
127
|
+
TextAreaOwnProps & {
|
|
128
|
+
themeOverride?: ThemeOverrideValue
|
|
129
|
+
} & OtherHTMLAttributes<
|
|
130
|
+
TextAreaOwnProps,
|
|
131
|
+
TextareaHTMLAttributes<TextAreaOwnProps & Element>
|
|
132
|
+
> &
|
|
133
|
+
WithDeterministicIdProps
|
|
134
|
+
|
|
135
|
+
type TextAreaStyle = ComponentStyle<'textArea' | 'textAreaLayout'>
|
|
136
|
+
const allowedProps: AllowedPropKeys = [
|
|
137
|
+
'label',
|
|
138
|
+
'id',
|
|
139
|
+
'size',
|
|
140
|
+
'layout',
|
|
141
|
+
'autoGrow',
|
|
142
|
+
'resize',
|
|
143
|
+
'width',
|
|
144
|
+
'height',
|
|
145
|
+
'maxHeight',
|
|
146
|
+
'messages',
|
|
147
|
+
'inline',
|
|
148
|
+
'placeholder',
|
|
149
|
+
'disabled',
|
|
150
|
+
'readOnly',
|
|
151
|
+
'required',
|
|
152
|
+
'textareaRef',
|
|
153
|
+
'defaultValue',
|
|
154
|
+
'value',
|
|
155
|
+
'onChange',
|
|
156
|
+
'margin'
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
export type { TextAreaProps, TextAreaStyle }
|
|
160
|
+
export { allowedProps }
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { TextAreaProps, TextAreaStyle } from './props'
|
|
26
|
+
import { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
|
|
27
|
+
import { calcFocusOutlineStyles } from '@instructure/emotion'
|
|
28
|
+
|
|
29
|
+
type StyleParams = {
|
|
30
|
+
disabled: TextAreaProps['disabled']
|
|
31
|
+
readOnly: TextAreaProps['readOnly']
|
|
32
|
+
size: TextAreaProps['size']
|
|
33
|
+
success: boolean
|
|
34
|
+
invalid: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* ---
|
|
39
|
+
* private: true
|
|
40
|
+
* ---
|
|
41
|
+
* Generates the style object from the theme and provided additional information
|
|
42
|
+
* @param {Object} componentTheme The theme variable object.
|
|
43
|
+
* @param {Object} params Additional parameters to customize the style.
|
|
44
|
+
* @return {Object} The final style object, which will be used in the component
|
|
45
|
+
*/
|
|
46
|
+
const generateStyle = (
|
|
47
|
+
componentTheme: NewComponentTypes['TextArea'],
|
|
48
|
+
params: StyleParams,
|
|
49
|
+
sharedTokens: SharedTokens
|
|
50
|
+
): TextAreaStyle => {
|
|
51
|
+
const { disabled, size, success, invalid, readOnly } = params
|
|
52
|
+
|
|
53
|
+
const fontSizeVariants = {
|
|
54
|
+
small: {
|
|
55
|
+
fontSize: componentTheme.fontSizeSm
|
|
56
|
+
},
|
|
57
|
+
medium: {
|
|
58
|
+
fontSize: componentTheme.fontSizeMd
|
|
59
|
+
},
|
|
60
|
+
large: {
|
|
61
|
+
fontSize: componentTheme.fontSizeLg
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const focusColor =
|
|
66
|
+
disabled || readOnly
|
|
67
|
+
? 'info'
|
|
68
|
+
: invalid
|
|
69
|
+
? 'danger'
|
|
70
|
+
: success
|
|
71
|
+
? 'success'
|
|
72
|
+
: 'info'
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
textArea: {
|
|
76
|
+
label: 'textArea',
|
|
77
|
+
all: 'initial',
|
|
78
|
+
WebkitFontSmoothing: 'antialiased',
|
|
79
|
+
MozOsxFontSmoothing: 'grayscale',
|
|
80
|
+
appearance: 'none',
|
|
81
|
+
height: 'auto',
|
|
82
|
+
margin: 0,
|
|
83
|
+
width: '100%',
|
|
84
|
+
display: 'block',
|
|
85
|
+
boxSizing: 'border-box',
|
|
86
|
+
padding: componentTheme.padding,
|
|
87
|
+
fontFamily: componentTheme.fontFamily,
|
|
88
|
+
fontWeight: componentTheme.fontWeight,
|
|
89
|
+
borderWidth: componentTheme.borderWidth,
|
|
90
|
+
borderStyle: 'solid',
|
|
91
|
+
borderColor: componentTheme.borderColor,
|
|
92
|
+
borderRadius: componentTheme.borderRadius,
|
|
93
|
+
color: componentTheme.textColor,
|
|
94
|
+
background: componentTheme.backgroundColor,
|
|
95
|
+
whiteSpace: 'pre-wrap',
|
|
96
|
+
wordWrap: 'break-word',
|
|
97
|
+
textAlign: 'start',
|
|
98
|
+
...(!disabled &&
|
|
99
|
+
!readOnly && {
|
|
100
|
+
'&:hover': {
|
|
101
|
+
background: componentTheme.backgroundHoverColor,
|
|
102
|
+
borderColor: componentTheme.borderHoverColor,
|
|
103
|
+
'&::placeholder': {
|
|
104
|
+
color: componentTheme.placeholderHoverColor
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
...(readOnly && {
|
|
109
|
+
color: componentTheme.textReadonlyColor,
|
|
110
|
+
background: componentTheme.backgroundReadonlyColor,
|
|
111
|
+
borderColor: componentTheme.borderReadonlyColor
|
|
112
|
+
}),
|
|
113
|
+
...(disabled && {
|
|
114
|
+
color: componentTheme.textDisabledColor,
|
|
115
|
+
background: componentTheme.backgroundDisabledColor,
|
|
116
|
+
borderColor: componentTheme.borderDisabledColor,
|
|
117
|
+
cursor: 'not-allowed',
|
|
118
|
+
pointerEvents: 'none',
|
|
119
|
+
opacity: 0.5
|
|
120
|
+
}),
|
|
121
|
+
...(!disabled &&
|
|
122
|
+
!readOnly &&
|
|
123
|
+
success && {
|
|
124
|
+
borderColor: componentTheme.successBorderColor
|
|
125
|
+
}),
|
|
126
|
+
...fontSizeVariants[size!],
|
|
127
|
+
...calcFocusOutlineStyles(sharedTokens.focusOutline, {
|
|
128
|
+
focusColor
|
|
129
|
+
}),
|
|
130
|
+
...(!disabled &&
|
|
131
|
+
!readOnly && {
|
|
132
|
+
'&[aria-invalid], &[aria-invalid]:focus': {
|
|
133
|
+
borderColor: componentTheme.errorBorderColor
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
'&::placeholder': {
|
|
137
|
+
color: componentTheme.placeholderColor
|
|
138
|
+
},
|
|
139
|
+
'&::-webkit-resizer': {
|
|
140
|
+
backgroundImage: `url("data:image/svg+xml,${encodeURIComponent(
|
|
141
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9" fill="none"><path d="M8.35352 0.353516L0.353516 8.35352M8.35352 4.35352L4.35352 8.35352" stroke="#8D959F"/></svg>'
|
|
142
|
+
)}")`,
|
|
143
|
+
backgroundColor: 'transparent',
|
|
144
|
+
backgroundPosition: 'bottom 2px right 2px', // Position away from edges
|
|
145
|
+
backgroundRepeat: 'no-repeat',
|
|
146
|
+
backgroundSize: '10px 10px'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
textAreaLayout: {
|
|
150
|
+
label: 'textArea__layout',
|
|
151
|
+
position: 'relative'
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default generateStyle
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { Theme, ThemeSpecificStyle } from '@instructure/ui-themes'
|
|
26
|
+
import { TextAreaTheme } from '@instructure/shared-types'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
30
|
+
* @param {Object} theme The actual theme object.
|
|
31
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
32
|
+
*/
|
|
33
|
+
const generateComponentTheme = (theme: Theme): TextAreaTheme => {
|
|
34
|
+
const { colors, typography, borders, spacing, forms, key: themeName } = theme
|
|
35
|
+
|
|
36
|
+
const themeSpecificStyle: ThemeSpecificStyle<TextAreaTheme> = {
|
|
37
|
+
canvas: {
|
|
38
|
+
color: theme['ic-brand-font-color-dark'],
|
|
39
|
+
focusOutlineColor: theme['ic-brand-primary']
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const componentVariables: TextAreaTheme = {
|
|
44
|
+
fontFamily: typography?.fontFamily,
|
|
45
|
+
fontWeight: typography?.fontWeightNormal,
|
|
46
|
+
color: colors?.contrasts?.grey125125,
|
|
47
|
+
|
|
48
|
+
background: colors?.contrasts?.white1010,
|
|
49
|
+
|
|
50
|
+
requiredInvalidColor: colors?.contrasts?.red5782,
|
|
51
|
+
|
|
52
|
+
borderWidth: borders?.widthSmall,
|
|
53
|
+
borderStyle: borders?.style,
|
|
54
|
+
borderTopColor: colors?.contrasts?.grey3045,
|
|
55
|
+
borderRightColor: colors?.contrasts?.grey3045,
|
|
56
|
+
borderBottomColor: colors?.contrasts?.grey3045,
|
|
57
|
+
borderLeftColor: colors?.contrasts?.grey3045,
|
|
58
|
+
borderRadius: borders?.radiusMedium,
|
|
59
|
+
|
|
60
|
+
padding: spacing?.small,
|
|
61
|
+
|
|
62
|
+
focusOutlineColor: colors?.contrasts?.blue4570,
|
|
63
|
+
focusOutlineWidth: borders?.widthMedium,
|
|
64
|
+
focusOutlineStyle: borders?.style,
|
|
65
|
+
|
|
66
|
+
errorBorderColor: colors?.contrasts?.red4570,
|
|
67
|
+
errorOutlineColor: colors?.contrasts?.red4570,
|
|
68
|
+
|
|
69
|
+
placeholderColor: colors?.contrasts?.grey4570,
|
|
70
|
+
|
|
71
|
+
smallFontSize: typography?.fontSizeSmall,
|
|
72
|
+
smallHeight: forms?.inputHeightSmall,
|
|
73
|
+
|
|
74
|
+
mediumFontSize: typography?.fontSizeMedium,
|
|
75
|
+
mediumHeight: forms?.inputHeightMedium,
|
|
76
|
+
|
|
77
|
+
largeFontSize: typography?.fontSizeLarge,
|
|
78
|
+
largeHeight: forms?.inputHeightLarge
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
...componentVariables,
|
|
83
|
+
...themeSpecificStyle[themeName]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default generateComponentTheme
|
package/src/exports/a.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export { TextArea } from '../TextArea/v1'
|
|
25
|
+
export type { TextAreaProps } from '../TextArea/v1/props'
|
package/src/exports/b.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export { TextArea } from '../TextArea/v2'
|
|
25
|
+
export type { TextAreaProps } from '../TextArea/v2/props'
|