@instructure/ui-view 10.26.1-snapshot-2 → 10.26.2
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 +5 -18
- package/es/ContextView/index.js +2 -2
- package/es/ContextView/props.js +67 -1
- package/es/View/index.js +6 -6
- package/es/View/props.js +44 -1
- package/lib/ContextView/index.js +1 -1
- package/lib/ContextView/props.js +68 -1
- package/lib/View/index.js +5 -5
- package/lib/View/props.js +45 -1
- package/package.json +16 -15
- package/src/ContextView/index.tsx +2 -1
- package/src/ContextView/props.ts +83 -1
- package/src/View/index.tsx +5 -4
- package/src/View/props.ts +72 -2
- package/tsconfig.build.json +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/ContextView/index.d.ts +20 -0
- package/types/ContextView/index.d.ts.map +1 -1
- package/types/ContextView/props.d.ts +3 -2
- package/types/ContextView/props.d.ts.map +1 -1
- package/types/View/index.d.ts +1 -0
- package/types/View/index.d.ts.map +1 -1
- package/types/View/props.d.ts +4 -3
- package/types/View/props.d.ts.map +1 -1
package/src/View/props.ts
CHANGED
|
@@ -23,10 +23,17 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import { cursor as cursorPropTypes } from '@instructure/ui-prop-types'
|
|
29
|
+
import { textDirectionContextConsumer } from '@instructure/ui-i18n'
|
|
30
|
+
import type { Cursor } from '@instructure/ui-prop-types'
|
|
31
|
+
import { ThemeablePropTypes } from '@instructure/emotion'
|
|
32
|
+
|
|
27
33
|
import type {
|
|
28
34
|
AsElementType,
|
|
29
35
|
OtherHTMLAttributes,
|
|
36
|
+
PropValidators,
|
|
30
37
|
ViewTheme
|
|
31
38
|
} from '@instructure/shared-types'
|
|
32
39
|
import type {
|
|
@@ -225,6 +232,69 @@ type ViewStyle = ComponentStyle<'view'> & {
|
|
|
225
232
|
inlineStyles: StyleObject
|
|
226
233
|
}
|
|
227
234
|
|
|
235
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
236
|
+
as: PropTypes.elementType,
|
|
237
|
+
elementRef: PropTypes.func,
|
|
238
|
+
display: PropTypes.oneOf([
|
|
239
|
+
'auto',
|
|
240
|
+
'inline',
|
|
241
|
+
'block',
|
|
242
|
+
'inline-block',
|
|
243
|
+
'flex',
|
|
244
|
+
'inline-flex'
|
|
245
|
+
]),
|
|
246
|
+
overflowX: PropTypes.oneOf(['auto', 'hidden', 'visible']),
|
|
247
|
+
overflowY: PropTypes.oneOf(['auto', 'hidden', 'visible']),
|
|
248
|
+
margin: PropTypes.string,
|
|
249
|
+
padding: PropTypes.string,
|
|
250
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
251
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
252
|
+
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
253
|
+
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
254
|
+
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
255
|
+
minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
256
|
+
children: PropTypes.node,
|
|
257
|
+
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
258
|
+
borderWidth: ThemeablePropTypes.borderWidth,
|
|
259
|
+
borderRadius: PropTypes.string,
|
|
260
|
+
borderColor: PropTypes.string,
|
|
261
|
+
background: PropTypes.oneOf([
|
|
262
|
+
'transparent',
|
|
263
|
+
'primary',
|
|
264
|
+
'secondary',
|
|
265
|
+
'primary-inverse',
|
|
266
|
+
'brand',
|
|
267
|
+
'info',
|
|
268
|
+
'alert',
|
|
269
|
+
'success',
|
|
270
|
+
'danger',
|
|
271
|
+
'warning'
|
|
272
|
+
]),
|
|
273
|
+
shadow: ThemeablePropTypes.shadow,
|
|
274
|
+
stacking: ThemeablePropTypes.stacking,
|
|
275
|
+
cursor: cursorPropTypes,
|
|
276
|
+
position: PropTypes.oneOf([
|
|
277
|
+
'static',
|
|
278
|
+
'absolute',
|
|
279
|
+
'relative',
|
|
280
|
+
'sticky',
|
|
281
|
+
'fixed'
|
|
282
|
+
]),
|
|
283
|
+
insetInlineStart: PropTypes.string,
|
|
284
|
+
insetInlineEnd: PropTypes.string,
|
|
285
|
+
insetBlockStart: PropTypes.string,
|
|
286
|
+
insetBlockEnd: PropTypes.string,
|
|
287
|
+
withFocusOutline: PropTypes.bool,
|
|
288
|
+
focusPosition: PropTypes.oneOf(['offset', 'inset']),
|
|
289
|
+
focusColor: PropTypes.oneOf(['info', 'inverse', 'success', 'danger']),
|
|
290
|
+
shouldAnimateFocus: PropTypes.bool,
|
|
291
|
+
withVisualDebug: PropTypes.bool,
|
|
292
|
+
dir: PropTypes.oneOf(Object.values(textDirectionContextConsumer.DIRECTION)),
|
|
293
|
+
overscrollBehavior: PropTypes.oneOf(['auto', 'contain', 'none']),
|
|
294
|
+
focusRingBorderRadius: PropTypes.string,
|
|
295
|
+
focusWithin: PropTypes.bool
|
|
296
|
+
}
|
|
297
|
+
|
|
228
298
|
// This variable will be attached as static property on the `View` component
|
|
229
299
|
// so we don't rely on the `PropTypes` validators for our internal logic.
|
|
230
300
|
// This means on prod builds the consuming applications can safely delete propTypes.
|
|
@@ -267,5 +337,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
267
337
|
'focusWithin'
|
|
268
338
|
]
|
|
269
339
|
|
|
270
|
-
export { allowedProps }
|
|
340
|
+
export { propTypes, allowedProps }
|
|
271
341
|
export type { ViewProps, ViewOwnProps, ViewStyle, BorderColor }
|
package/tsconfig.build.json
CHANGED
|
@@ -28,7 +28,12 @@
|
|
|
28
28
|
{
|
|
29
29
|
"path": "../ui-position/tsconfig.build.json"
|
|
30
30
|
},
|
|
31
|
-
{
|
|
31
|
+
{
|
|
32
|
+
"path": "../ui-prop-types/tsconfig.build.json"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"path": "../ui-react-utils/tsconfig.build.json"
|
|
36
|
+
},
|
|
32
37
|
{
|
|
33
38
|
"path": "../ui-babel-preset/tsconfig.build.json"
|
|
34
39
|
},
|