@instructure/ui-tabs 8.11.2-snapshot.52 → 8.11.2-snapshot.53
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/es/Tabs/Tab/index.js +3 -1
- package/es/Tabs/Tab/styles.js +13 -3
- package/es/Tabs/index.js +5 -8
- package/lib/Tabs/Tab/index.js +3 -1
- package/lib/Tabs/Tab/styles.js +13 -3
- package/lib/Tabs/index.js +4 -7
- package/package.json +21 -21
- package/src/Tabs/Tab/index.tsx +2 -0
- package/src/Tabs/Tab/styles.ts +15 -1
- package/src/Tabs/index.tsx +35 -23
- package/types/Tabs/Tab/index.d.ts.map +1 -1
- package/types/Tabs/Tab/styles.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +7 -13
- package/types/Tabs/index.d.ts.map +1 -1
package/es/Tabs/Tab/index.js
CHANGED
|
@@ -114,7 +114,9 @@ let Tab = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
114
114
|
"aria-selected": isSelected ? 'true' : void 0,
|
|
115
115
|
"aria-disabled": isDisabled ? 'true' : void 0,
|
|
116
116
|
"aria-controls": controls,
|
|
117
|
-
tabIndex: isSelected && !isDisabled ? '0' : void 0
|
|
117
|
+
tabIndex: isSelected && !isDisabled ? '0' : void 0,
|
|
118
|
+
position: "relative",
|
|
119
|
+
focusPosition: "inset"
|
|
118
120
|
}), callRenderProp(children));
|
|
119
121
|
}
|
|
120
122
|
|
package/es/Tabs/Tab/styles.js
CHANGED
|
@@ -102,6 +102,18 @@ const generateStyle = (componentTheme, props) => {
|
|
|
102
102
|
})
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
+
}; // overrides for View default focus ring
|
|
106
|
+
|
|
107
|
+
const focusRingStyles = {
|
|
108
|
+
'&:before': {
|
|
109
|
+
inset: '0.5rem',
|
|
110
|
+
borderRadius: '0.25rem'
|
|
111
|
+
},
|
|
112
|
+
'&:focus': {
|
|
113
|
+
'&:before': {
|
|
114
|
+
inset: '0.375rem'
|
|
115
|
+
}
|
|
116
|
+
}
|
|
105
117
|
};
|
|
106
118
|
return {
|
|
107
119
|
tab: {
|
|
@@ -119,9 +131,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
119
131
|
...(isDisabled && {
|
|
120
132
|
opacity: 0.5
|
|
121
133
|
}),
|
|
122
|
-
|
|
123
|
-
outline: 'none'
|
|
124
|
-
},
|
|
134
|
+
...focusRingStyles,
|
|
125
135
|
...variants[variant]
|
|
126
136
|
}
|
|
127
137
|
};
|
package/es/Tabs/index.js
CHANGED
|
@@ -46,12 +46,12 @@ import generateComponentTheme from './theme';
|
|
|
46
46
|
import { Tab } from './Tab';
|
|
47
47
|
import { Panel } from './Panel';
|
|
48
48
|
import { allowedProps, propTypes } from './props';
|
|
49
|
+
|
|
49
50
|
/**
|
|
50
51
|
---
|
|
51
52
|
category: components
|
|
52
53
|
---
|
|
53
54
|
**/
|
|
54
|
-
|
|
55
55
|
let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bidirectional(), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class Tabs extends Component {
|
|
56
56
|
constructor(props) {
|
|
57
57
|
super(props);
|
|
@@ -293,7 +293,7 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
clonePanel(
|
|
296
|
+
clonePanel(_index, generatedId, selected, panel) {
|
|
297
297
|
const id = panel.props.id || generatedId; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
298
298
|
|
|
299
299
|
const hasFixedHeight = typeof this.props.fixHeight !== 'undefined';
|
|
@@ -305,8 +305,8 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
305
305
|
variant: this.props.variant,
|
|
306
306
|
padding: panel.props.padding || this.props.padding,
|
|
307
307
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
308
|
-
maxHeight:
|
|
309
|
-
minHeight:
|
|
308
|
+
maxHeight: !hasFixedHeight ? this.props.maxHeight : void 0,
|
|
309
|
+
minHeight: !hasFixedHeight ? this.props.minHeight : '100%'
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
|
|
@@ -363,13 +363,10 @@ let Tabs = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = bid
|
|
|
363
363
|
css: styles === null || styles === void 0 ? void 0 : styles.container
|
|
364
364
|
}), jsx(Focusable, {
|
|
365
365
|
ref: this.handleFocusableRef
|
|
366
|
-
}, ({
|
|
367
|
-
focusVisible
|
|
368
|
-
}) => jsx(View, {
|
|
366
|
+
}, () => jsx(View, {
|
|
369
367
|
as: "div",
|
|
370
368
|
position: "relative",
|
|
371
369
|
borderRadius: "medium",
|
|
372
|
-
withFocusOutline: focusVisible,
|
|
373
370
|
shouldAnimateFocus: false,
|
|
374
371
|
css: styles === null || styles === void 0 ? void 0 : styles.tabs
|
|
375
372
|
}, jsx(View, {
|
package/lib/Tabs/Tab/index.js
CHANGED
|
@@ -106,7 +106,9 @@ let Tab = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec
|
|
|
106
106
|
"aria-selected": isSelected ? 'true' : void 0,
|
|
107
107
|
"aria-disabled": isDisabled ? 'true' : void 0,
|
|
108
108
|
"aria-controls": controls,
|
|
109
|
-
tabIndex: isSelected && !isDisabled ? '0' : void 0
|
|
109
|
+
tabIndex: isSelected && !isDisabled ? '0' : void 0,
|
|
110
|
+
position: "relative",
|
|
111
|
+
focusPosition: "inset"
|
|
110
112
|
}), (0, _callRenderProp.callRenderProp)(children));
|
|
111
113
|
}
|
|
112
114
|
|
package/lib/Tabs/Tab/styles.js
CHANGED
|
@@ -110,6 +110,18 @@ const generateStyle = (componentTheme, props) => {
|
|
|
110
110
|
})
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
+
}; // overrides for View default focus ring
|
|
114
|
+
|
|
115
|
+
const focusRingStyles = {
|
|
116
|
+
'&:before': {
|
|
117
|
+
inset: '0.5rem',
|
|
118
|
+
borderRadius: '0.25rem'
|
|
119
|
+
},
|
|
120
|
+
'&:focus': {
|
|
121
|
+
'&:before': {
|
|
122
|
+
inset: '0.375rem'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
113
125
|
};
|
|
114
126
|
return {
|
|
115
127
|
tab: {
|
|
@@ -127,9 +139,7 @@ const generateStyle = (componentTheme, props) => {
|
|
|
127
139
|
...(isDisabled && {
|
|
128
140
|
opacity: 0.5
|
|
129
141
|
}),
|
|
130
|
-
|
|
131
|
-
outline: 'none'
|
|
132
|
-
},
|
|
142
|
+
...focusRingStyles,
|
|
133
143
|
...variants[variant]
|
|
134
144
|
}
|
|
135
145
|
};
|
package/lib/Tabs/index.js
CHANGED
|
@@ -308,7 +308,7 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
clonePanel(
|
|
311
|
+
clonePanel(_index, generatedId, selected, panel) {
|
|
312
312
|
const id = panel.props.id || generatedId; // fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
313
313
|
|
|
314
314
|
const hasFixedHeight = typeof this.props.fixHeight !== 'undefined';
|
|
@@ -320,8 +320,8 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
320
320
|
variant: this.props.variant,
|
|
321
321
|
padding: panel.props.padding || this.props.padding,
|
|
322
322
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
323
|
-
maxHeight:
|
|
324
|
-
minHeight:
|
|
323
|
+
maxHeight: !hasFixedHeight ? this.props.maxHeight : void 0,
|
|
324
|
+
minHeight: !hasFixedHeight ? this.props.minHeight : '100%'
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -380,13 +380,10 @@ let Tabs = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
380
380
|
css: styles === null || styles === void 0 ? void 0 : styles.container
|
|
381
381
|
}), (0, _emotion.jsx)(_Focusable.Focusable, {
|
|
382
382
|
ref: this.handleFocusableRef
|
|
383
|
-
}, ({
|
|
384
|
-
focusVisible
|
|
385
|
-
}) => (0, _emotion.jsx)(_View.View, {
|
|
383
|
+
}, () => (0, _emotion.jsx)(_View.View, {
|
|
386
384
|
as: "div",
|
|
387
385
|
position: "relative",
|
|
388
386
|
borderRadius: "medium",
|
|
389
|
-
withFocusOutline: focusVisible,
|
|
390
387
|
shouldAnimateFocus: false,
|
|
391
388
|
css: styles === null || styles === void 0 ? void 0 : styles.tabs
|
|
392
389
|
}, (0, _emotion.jsx)(_View.View, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tabs",
|
|
3
|
-
"version": "8.11.2-snapshot.
|
|
3
|
+
"version": "8.11.2-snapshot.53+3a59c3f04",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.11.2-snapshot.
|
|
28
|
-
"@instructure/ui-color-utils": "8.11.2-snapshot.
|
|
29
|
-
"@instructure/ui-test-locator": "8.11.2-snapshot.
|
|
30
|
-
"@instructure/ui-test-utils": "8.11.2-snapshot.
|
|
31
|
-
"@instructure/ui-themes": "8.11.2-snapshot.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.11.2-snapshot.53+3a59c3f04",
|
|
28
|
+
"@instructure/ui-color-utils": "8.11.2-snapshot.53+3a59c3f04",
|
|
29
|
+
"@instructure/ui-test-locator": "8.11.2-snapshot.53+3a59c3f04",
|
|
30
|
+
"@instructure/ui-test-utils": "8.11.2-snapshot.53+3a59c3f04",
|
|
31
|
+
"@instructure/ui-themes": "8.11.2-snapshot.53+3a59c3f04"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.11.2-snapshot.
|
|
36
|
-
"@instructure/debounce": "8.11.2-snapshot.
|
|
37
|
-
"@instructure/emotion": "8.11.2-snapshot.
|
|
38
|
-
"@instructure/shared-types": "8.11.2-snapshot.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.11.2-snapshot.
|
|
40
|
-
"@instructure/ui-focusable": "8.11.2-snapshot.
|
|
41
|
-
"@instructure/ui-i18n": "8.11.2-snapshot.
|
|
42
|
-
"@instructure/ui-motion": "8.11.2-snapshot.
|
|
43
|
-
"@instructure/ui-prop-types": "8.11.2-snapshot.
|
|
44
|
-
"@instructure/ui-react-utils": "8.11.2-snapshot.
|
|
45
|
-
"@instructure/ui-testable": "8.11.2-snapshot.
|
|
46
|
-
"@instructure/ui-utils": "8.11.2-snapshot.
|
|
47
|
-
"@instructure/ui-view": "8.11.2-snapshot.
|
|
48
|
-
"@instructure/uid": "8.11.2-snapshot.
|
|
35
|
+
"@instructure/console": "8.11.2-snapshot.53+3a59c3f04",
|
|
36
|
+
"@instructure/debounce": "8.11.2-snapshot.53+3a59c3f04",
|
|
37
|
+
"@instructure/emotion": "8.11.2-snapshot.53+3a59c3f04",
|
|
38
|
+
"@instructure/shared-types": "8.11.2-snapshot.53+3a59c3f04",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.11.2-snapshot.53+3a59c3f04",
|
|
40
|
+
"@instructure/ui-focusable": "8.11.2-snapshot.53+3a59c3f04",
|
|
41
|
+
"@instructure/ui-i18n": "8.11.2-snapshot.53+3a59c3f04",
|
|
42
|
+
"@instructure/ui-motion": "8.11.2-snapshot.53+3a59c3f04",
|
|
43
|
+
"@instructure/ui-prop-types": "8.11.2-snapshot.53+3a59c3f04",
|
|
44
|
+
"@instructure/ui-react-utils": "8.11.2-snapshot.53+3a59c3f04",
|
|
45
|
+
"@instructure/ui-testable": "8.11.2-snapshot.53+3a59c3f04",
|
|
46
|
+
"@instructure/ui-utils": "8.11.2-snapshot.53+3a59c3f04",
|
|
47
|
+
"@instructure/ui-view": "8.11.2-snapshot.53+3a59c3f04",
|
|
48
|
+
"@instructure/uid": "8.11.2-snapshot.53+3a59c3f04",
|
|
49
49
|
"keycode": "^2",
|
|
50
50
|
"prop-types": "^15"
|
|
51
51
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3a59c3f0443db81631c4f4d5dafe5778389e8dbc"
|
|
60
60
|
}
|
package/src/Tabs/Tab/index.tsx
CHANGED
|
@@ -118,6 +118,8 @@ class Tab extends Component<TabsTabProps> {
|
|
|
118
118
|
aria-controls={controls}
|
|
119
119
|
//@ts-expect-error fix this to be number
|
|
120
120
|
tabIndex={isSelected && !isDisabled ? '0' : undefined}
|
|
121
|
+
position="relative"
|
|
122
|
+
focusPosition="inset"
|
|
121
123
|
>
|
|
122
124
|
{callRenderProp(children)}
|
|
123
125
|
</View>
|
package/src/Tabs/Tab/styles.ts
CHANGED
|
@@ -115,6 +115,20 @@ const generateStyle = (
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// overrides for View default focus ring
|
|
119
|
+
const focusRingStyles = {
|
|
120
|
+
'&:before': {
|
|
121
|
+
inset: '0.5rem',
|
|
122
|
+
borderRadius: '0.25rem'
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
'&:focus': {
|
|
126
|
+
'&:before': {
|
|
127
|
+
inset: '0.375rem'
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
118
132
|
return {
|
|
119
133
|
tab: {
|
|
120
134
|
label: 'tab',
|
|
@@ -129,7 +143,7 @@ const generateStyle = (
|
|
|
129
143
|
...((isSelected || isDisabled) && { cursor: 'default' }),
|
|
130
144
|
...(isDisabled && { opacity: 0.5 }),
|
|
131
145
|
|
|
132
|
-
|
|
146
|
+
...focusRingStyles,
|
|
133
147
|
|
|
134
148
|
...variants[variant!]
|
|
135
149
|
}
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -23,7 +23,13 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
|
-
import React, {
|
|
26
|
+
import React, {
|
|
27
|
+
Component,
|
|
28
|
+
ComponentClass,
|
|
29
|
+
ComponentElement,
|
|
30
|
+
createElement,
|
|
31
|
+
ReactElement
|
|
32
|
+
} from 'react'
|
|
27
33
|
|
|
28
34
|
import keycode from 'keycode'
|
|
29
35
|
|
|
@@ -49,8 +55,14 @@ import generateComponentTheme from './theme'
|
|
|
49
55
|
|
|
50
56
|
import { Tab } from './Tab'
|
|
51
57
|
import { Panel } from './Panel'
|
|
52
|
-
|
|
58
|
+
|
|
53
59
|
import { allowedProps, propTypes } from './props'
|
|
60
|
+
import type { TabsProps } from './props'
|
|
61
|
+
import type { TabsTabProps } from './Tab/props'
|
|
62
|
+
import type { TabsPanelProps } from './Panel/props'
|
|
63
|
+
|
|
64
|
+
type TabChild = ReactElement & ComponentElement<TabsTabProps, any>
|
|
65
|
+
type PanelChild = ReactElement & ComponentElement<TabsPanelProps, any>
|
|
54
66
|
|
|
55
67
|
/**
|
|
56
68
|
---
|
|
@@ -354,12 +366,15 @@ class Tabs extends Component<TabsProps> {
|
|
|
354
366
|
this.showActiveTabIfOverlayed(this._tabList.querySelector(`#tab-${id}`))
|
|
355
367
|
}
|
|
356
368
|
|
|
357
|
-
|
|
358
|
-
|
|
369
|
+
createTab(
|
|
370
|
+
index: number,
|
|
371
|
+
generatedId: string,
|
|
372
|
+
selected: boolean,
|
|
373
|
+
panel: PanelChild
|
|
374
|
+
): TabChild {
|
|
359
375
|
const id = panel.props.id || generatedId
|
|
360
376
|
|
|
361
|
-
|
|
362
|
-
return createElement(Tab, {
|
|
377
|
+
return createElement(Tab as ComponentClass<TabsTabProps>, {
|
|
363
378
|
variant: this.props.variant,
|
|
364
379
|
key: `tab-${id}`,
|
|
365
380
|
id: `tab-${id}`,
|
|
@@ -373,8 +388,12 @@ class Tabs extends Component<TabsProps> {
|
|
|
373
388
|
})
|
|
374
389
|
}
|
|
375
390
|
|
|
376
|
-
|
|
377
|
-
|
|
391
|
+
clonePanel(
|
|
392
|
+
_index: number,
|
|
393
|
+
generatedId: string,
|
|
394
|
+
selected: boolean,
|
|
395
|
+
panel: PanelChild
|
|
396
|
+
) {
|
|
378
397
|
const id = panel.props.id || generatedId
|
|
379
398
|
|
|
380
399
|
// fixHeight can be 0, so simply `fixheight` could return falsy value
|
|
@@ -388,10 +407,8 @@ class Tabs extends Component<TabsProps> {
|
|
|
388
407
|
variant: this.props.variant,
|
|
389
408
|
padding: panel.props.padding || this.props.padding,
|
|
390
409
|
textAlign: panel.props.textAlign || this.props.textAlign,
|
|
391
|
-
maxHeight:
|
|
392
|
-
|
|
393
|
-
minHeight:
|
|
394
|
-
panel.minHeight || (!hasFixedHeight ? this.props.minHeight : '100%')
|
|
410
|
+
maxHeight: !hasFixedHeight ? this.props.maxHeight : undefined,
|
|
411
|
+
minHeight: !hasFixedHeight ? this.props.minHeight : '100%'
|
|
395
412
|
})
|
|
396
413
|
}
|
|
397
414
|
|
|
@@ -419,8 +436,7 @@ class Tabs extends Component<TabsProps> {
|
|
|
419
436
|
render() {
|
|
420
437
|
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'panels' implicitly has type 'any[]' in s... Remove this comment to see the full error message
|
|
421
438
|
const panels = []
|
|
422
|
-
|
|
423
|
-
const tabs = []
|
|
439
|
+
const tabs: TabChild[] = []
|
|
424
440
|
const {
|
|
425
441
|
children,
|
|
426
442
|
elementRef,
|
|
@@ -445,14 +461,12 @@ class Tabs extends Component<TabsProps> {
|
|
|
445
461
|
React.Children.forEach(children, (child) => {
|
|
446
462
|
if (matchComponentTypes(child, [Panel])) {
|
|
447
463
|
const selected =
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
// @ts-expect-error ts-migrate(2533) FIXME: Object is possibly 'null' or 'undefined'.
|
|
451
|
-
(child.props.isSelected || selectedIndex === index)
|
|
464
|
+
!(child as PanelChild).props.isDisabled &&
|
|
465
|
+
((child as PanelChild).props.isSelected || selectedIndex === index)
|
|
452
466
|
const id = uid()
|
|
453
467
|
|
|
454
|
-
tabs.push(this.createTab(index, id, selected, child))
|
|
455
|
-
panels.push(this.clonePanel(index, id, selected, child))
|
|
468
|
+
tabs.push(this.createTab(index, id, selected, child as PanelChild))
|
|
469
|
+
panels.push(this.clonePanel(index, id, selected, child as PanelChild))
|
|
456
470
|
|
|
457
471
|
index++
|
|
458
472
|
} else {
|
|
@@ -486,12 +500,11 @@ class Tabs extends Component<TabsProps> {
|
|
|
486
500
|
css={styles?.container}
|
|
487
501
|
>
|
|
488
502
|
<Focusable ref={this.handleFocusableRef}>
|
|
489
|
-
{(
|
|
503
|
+
{() => (
|
|
490
504
|
<View
|
|
491
505
|
as="div"
|
|
492
506
|
position="relative"
|
|
493
507
|
borderRadius="medium"
|
|
494
|
-
withFocusOutline={focusVisible}
|
|
495
508
|
shouldAnimateFocus={false}
|
|
496
509
|
css={styles?.tabs}
|
|
497
510
|
>
|
|
@@ -502,7 +515,6 @@ class Tabs extends Component<TabsProps> {
|
|
|
502
515
|
aria-label={screenReaderLabel}
|
|
503
516
|
elementRef={this.handleTabListRef}
|
|
504
517
|
>
|
|
505
|
-
{/* @ts-expect-error ts-migrate(7005) FIXME: Variable 'tabs' implicitly has an 'any[]' type. */}
|
|
506
518
|
{tabs}
|
|
507
519
|
{withScrollFade && scrollFadeEls}
|
|
508
520
|
</View>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/index.tsx"],"names":[],"mappings":"A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
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUzD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,YAAY,SACrB,YAAY,KAClB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Tabs/Tab/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUzD;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,YAAY,SACrB,YAAY,KAClB,YAoGF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
package/types/Tabs/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React, { Component } from 'react';
|
|
2
|
+
import React, { Component, ComponentElement, ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@instructure/emotion';
|
|
4
4
|
import { Tab } from './Tab';
|
|
5
5
|
import { Panel } from './Panel';
|
|
6
6
|
import type { TabsProps } from './props';
|
|
7
|
+
import type { TabsTabProps } from './Tab/props';
|
|
8
|
+
import type { TabsPanelProps } from './Panel/props';
|
|
9
|
+
declare type TabChild = ReactElement & ComponentElement<TabsTabProps, any>;
|
|
10
|
+
declare type PanelChild = ReactElement & ComponentElement<TabsPanelProps, any>;
|
|
7
11
|
/**
|
|
8
12
|
---
|
|
9
13
|
category: components
|
|
@@ -82,18 +86,8 @@ declare class Tabs extends Component<TabsProps> {
|
|
|
82
86
|
index: any;
|
|
83
87
|
id: any;
|
|
84
88
|
}): void;
|
|
85
|
-
createTab(index:
|
|
86
|
-
clonePanel(
|
|
87
|
-
id: any;
|
|
88
|
-
labelledBy: string;
|
|
89
|
-
isSelected: any;
|
|
90
|
-
key: any;
|
|
91
|
-
variant: "default" | "secondary" | undefined;
|
|
92
|
-
padding: any;
|
|
93
|
-
textAlign: any;
|
|
94
|
-
maxHeight: any;
|
|
95
|
-
minHeight: any;
|
|
96
|
-
}, string | React.JSXElementConstructor<any>>;
|
|
89
|
+
createTab(index: number, generatedId: string, selected: boolean, panel: PanelChild): TabChild;
|
|
90
|
+
clonePanel(_index: number, generatedId: string, selected: boolean, panel: PanelChild): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
97
91
|
handleFocusableRef: (el: any) => void;
|
|
98
92
|
handleTabListRef: (el: any) => void;
|
|
99
93
|
focus(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tabs/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Tabs/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EACZ,SAAS,EAET,gBAAgB,EAEhB,YAAY,EACb,MAAM,OAAO,CAAA;AAmBd,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,aAAK,QAAQ,GAAG,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;AAClE,aA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