@itwin/itwinui-react 3.0.0-dev.12 → 3.0.0-dev.13
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 +20 -0
- package/cjs/core/ColorPicker/ColorBuilder.js +2 -0
- package/cjs/core/ColorPicker/ColorInputPanel.js +24 -4
- package/cjs/core/ColorPicker/ColorPalette.js +2 -80
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +25 -15
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +3 -3
- package/cjs/core/Select/Select.d.ts +1 -1
- package/cjs/core/Select/Select.js +6 -4
- package/cjs/core/Tabs/Tabs.d.ts +222 -52
- package/cjs/core/Tabs/Tabs.js +436 -376
- package/cjs/core/ThemeProvider/ThemeProvider.js +3 -1
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +1 -2
- package/cjs/styles.js +4 -2
- package/esm/core/ColorPicker/ColorBuilder.js +2 -0
- package/esm/core/ColorPicker/ColorInputPanel.js +25 -5
- package/esm/core/ColorPicker/ColorPalette.js +3 -83
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +18 -12
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +3 -2
- package/esm/core/Select/Select.d.ts +1 -1
- package/esm/core/Select/Select.js +3 -3
- package/esm/core/Tabs/Tabs.d.ts +222 -52
- package/esm/core/Tabs/Tabs.js +429 -369
- package/esm/core/ThemeProvider/ThemeProvider.js +3 -1
- package/esm/index.d.ts +1 -2
- package/esm/index.js +1 -2
- package/esm/styles.js +4 -2
- package/package.json +2 -2
- package/styles.css +8 -8
- package/cjs/core/Tabs/Tab.d.ts +0 -40
- package/cjs/core/Tabs/Tab.js +0 -65
- package/esm/core/Tabs/Tab.d.ts +0 -40
- package/esm/core/Tabs/Tab.js +0 -57
package/cjs/core/Tabs/Tabs.d.ts
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Whether to allow tabs list to scroll when there is overflow,
|
|
5
|
-
* i.e. when there is not enough space to fit all the tabs.
|
|
6
|
-
*
|
|
7
|
-
* Not applicable to types `pill` and `borderless`.
|
|
8
|
-
*/
|
|
9
|
-
useOverflow?: boolean;
|
|
10
|
-
};
|
|
11
|
-
type TabsOverflowProps = {
|
|
12
|
-
/**
|
|
13
|
-
* Options that can be specified to deal with tabs overflowing the allotted space.
|
|
14
|
-
*/
|
|
15
|
-
overflowOptions?: OverflowOptions;
|
|
16
|
-
/**
|
|
17
|
-
* Type of the tabs.
|
|
18
|
-
*
|
|
19
|
-
* If `orientation = 'vertical'`, `pill` is not applicable.
|
|
20
|
-
* @default 'default'
|
|
21
|
-
*/
|
|
22
|
-
type?: 'default';
|
|
23
|
-
} | {
|
|
24
|
-
type: 'pill' | 'borderless';
|
|
25
|
-
};
|
|
2
|
+
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
26
3
|
type TabsOrientationProps = {
|
|
27
4
|
/**
|
|
28
5
|
* Orientation of the tabs.
|
|
@@ -40,24 +17,85 @@ type TabsOrientationProps = {
|
|
|
40
17
|
orientation: 'vertical';
|
|
41
18
|
type?: 'default' | 'borderless';
|
|
42
19
|
};
|
|
43
|
-
type
|
|
20
|
+
type TabsWrapperOwnProps = {
|
|
44
21
|
/**
|
|
45
|
-
*
|
|
22
|
+
* Color of the bar on the active tab.
|
|
23
|
+
* @default 'blue'
|
|
24
|
+
*/
|
|
25
|
+
color?: 'blue' | 'green';
|
|
26
|
+
/**
|
|
27
|
+
* Control whether focusing tabs (using arrow keys) should automatically select them.
|
|
28
|
+
* Use 'manual' if tab panel content is not preloaded.
|
|
29
|
+
* @default 'auto'
|
|
30
|
+
*/
|
|
31
|
+
focusActivationMode?: 'auto' | 'manual';
|
|
32
|
+
/**
|
|
33
|
+
* Value of the tab that should be active on initial render.
|
|
46
34
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
35
|
+
* Should be used for uncontrolled state (when no `value` passed).
|
|
36
|
+
*
|
|
37
|
+
* If not specified, then first tab will be active by default.
|
|
49
38
|
*/
|
|
50
|
-
|
|
39
|
+
defaultValue?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Value of the active tab for controlled state.
|
|
42
|
+
*/
|
|
43
|
+
value?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Function that gets called when active tab is changed.
|
|
46
|
+
*
|
|
47
|
+
* Should be used alongside `value` prop.
|
|
48
|
+
*/
|
|
49
|
+
onValueChange?: (value: string) => void;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Do not use.
|
|
52
|
+
*/
|
|
53
|
+
defaultChecked?: never;
|
|
54
|
+
} & TabsOrientationProps;
|
|
55
|
+
type TabListOwnProps = {
|
|
56
|
+
/**
|
|
57
|
+
* Tab items.
|
|
58
|
+
*/
|
|
59
|
+
children: React.ReactNode[];
|
|
60
|
+
};
|
|
61
|
+
type TabOwnProps = {
|
|
62
|
+
/**
|
|
63
|
+
* Value used to associate the tab with a given panel.
|
|
64
|
+
*/
|
|
65
|
+
value: string;
|
|
66
|
+
/**
|
|
67
|
+
* Tab label used for simple Tab construction.
|
|
68
|
+
* Cannot be used with tabs that have icons or descriptions.
|
|
69
|
+
*/
|
|
70
|
+
label?: string | React.ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Don't pass `id`, as it will be automatically set.
|
|
73
|
+
*/
|
|
74
|
+
id?: string;
|
|
75
|
+
};
|
|
76
|
+
type TabsActionsOwnProps = {
|
|
77
|
+
/**
|
|
78
|
+
* Passes props to the wrapper component for the actions
|
|
79
|
+
*/
|
|
80
|
+
wrapperProps?: React.ComponentPropsWithRef<'div'>;
|
|
81
|
+
};
|
|
82
|
+
type TabsPanelOwnProps = {
|
|
83
|
+
/**
|
|
84
|
+
* Value used to associate the panel with a given tab.
|
|
85
|
+
*/
|
|
86
|
+
value: string;
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated Don't pass `id`, as it will be automatically set.
|
|
89
|
+
*/
|
|
90
|
+
id?: string;
|
|
91
|
+
};
|
|
92
|
+
type TabsLegacyProps = {
|
|
51
93
|
/**
|
|
52
94
|
* Content displayed to the right/bottom of the horizontal/vertical tabs
|
|
53
95
|
*
|
|
54
96
|
* If `type = 'pill'`, `actions` is not applicable.
|
|
55
97
|
*/
|
|
56
98
|
actions?: React.ReactNode[];
|
|
57
|
-
} | {
|
|
58
|
-
type: 'pill';
|
|
59
|
-
};
|
|
60
|
-
export type TabsProps = {
|
|
61
99
|
/**
|
|
62
100
|
* Elements shown for each tab.
|
|
63
101
|
* Recommended to pass an array of `Tab` components.
|
|
@@ -98,33 +136,165 @@ export type TabsProps = {
|
|
|
98
136
|
* Content inside the tab panel.
|
|
99
137
|
*/
|
|
100
138
|
children?: React.ReactNode;
|
|
101
|
-
|
|
139
|
+
/**
|
|
140
|
+
* @deprecated Tabs will now overflow by default, so this prop does nothing.
|
|
141
|
+
*/
|
|
142
|
+
overflowOptions?: {
|
|
143
|
+
/**
|
|
144
|
+
* @deprecated Tabs will now overflow by default, so this prop does nothing.
|
|
145
|
+
*/
|
|
146
|
+
useOverflow?: boolean;
|
|
147
|
+
};
|
|
148
|
+
defaultValue?: never;
|
|
149
|
+
defaultChecked?: never;
|
|
150
|
+
} & TabsOrientationProps;
|
|
151
|
+
type TabLegacyProps = {
|
|
152
|
+
/**
|
|
153
|
+
* The main label shown in the tab.
|
|
154
|
+
*/
|
|
155
|
+
label?: React.ReactNode;
|
|
156
|
+
/**
|
|
157
|
+
* Secondary label shown below the main label.
|
|
158
|
+
*/
|
|
159
|
+
sublabel?: React.ReactNode;
|
|
160
|
+
/**
|
|
161
|
+
* Svg icon shown before the labels.
|
|
162
|
+
*/
|
|
163
|
+
startIcon?: JSX.Element;
|
|
164
|
+
/**
|
|
165
|
+
* Control whether the tab is disabled.
|
|
166
|
+
*/
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Custom content appended to the tab.
|
|
170
|
+
*/
|
|
171
|
+
children?: React.ReactNode;
|
|
172
|
+
/**
|
|
173
|
+
* `value` of the tab.
|
|
174
|
+
*
|
|
175
|
+
* Will be set by parent `Tabs` component.
|
|
176
|
+
*/
|
|
177
|
+
value?: string;
|
|
178
|
+
};
|
|
102
179
|
/**
|
|
103
|
-
*
|
|
180
|
+
* Legacy Tab component.
|
|
181
|
+
* For full functionality use composition API.
|
|
182
|
+
*
|
|
183
|
+
* Individual tab component to be used in the `labels` prop of `Tabs`.
|
|
104
184
|
* @example
|
|
105
185
|
* const tabs = [
|
|
106
|
-
* <Tab label='Label 1' />,
|
|
107
|
-
* <Tab label='Label 2' />,
|
|
108
|
-
* <Tab label='Label 3' />,
|
|
186
|
+
* <Tab label='Label 1' sublabel='Description 1' />,
|
|
187
|
+
* <Tab label='Label 2' startIcon={<SvgPlaceholder />} />,
|
|
109
188
|
* ];
|
|
110
|
-
|
|
111
|
-
|
|
189
|
+
*/
|
|
190
|
+
declare const LegacyTab: PolymorphicForwardRefComponent<"button", TabLegacyProps>;
|
|
191
|
+
export { LegacyTab as Tab };
|
|
192
|
+
/**
|
|
193
|
+
* Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
|
|
194
|
+
* `Tabs.Tab` and `Tabs.Panel` can be associated with each other by passing them the same `value`.
|
|
112
195
|
* @example
|
|
113
|
-
* <Tabs
|
|
196
|
+
* <Tabs.Wrapper>
|
|
197
|
+
* <Tabs.TabList>
|
|
198
|
+
* <Tabs.Tab value='tab1' label='Label 1' />
|
|
199
|
+
* <Tabs.Tab value='tab2' label='Label 2' />
|
|
200
|
+
* <Tabs.Tab value='tab3' label='Label 3' />
|
|
201
|
+
* </Tabs.TabList>
|
|
202
|
+
* <Tabs.ActionsWrapper>
|
|
203
|
+
* <Tabs.Actions>
|
|
204
|
+
* <Button>Sample Button</Button>
|
|
205
|
+
* </Tabs.Actions>
|
|
206
|
+
* </Tabs.ActionsWrapper>
|
|
207
|
+
* <Tabs.Panel value='tab1'>Content 1</Tabs.Panel>
|
|
208
|
+
* <Tabs.Panel value='tab2'>Content 2</Tabs.Panel>
|
|
209
|
+
* <Tabs.Panel value='tab3'>Content 3</Tabs.Panel>
|
|
210
|
+
* </Tabs.Wrapper>
|
|
114
211
|
*
|
|
115
212
|
* @example
|
|
116
|
-
*
|
|
117
|
-
* <Tab label='Label 1' sublabel='First tab' />,
|
|
118
|
-
* <Tab label='Label 2' sublabel='Active tab' />,
|
|
119
|
-
* ];
|
|
120
|
-
* <Tabs labels={tabsWithSublabels} activeIndex={1} />
|
|
213
|
+
* <Tabs orientation='vertical'/>
|
|
121
214
|
*
|
|
122
215
|
* @example
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* <
|
|
126
|
-
*
|
|
127
|
-
*
|
|
216
|
+
* <Tabs.Wrapper focusActivationMode='manual'>
|
|
217
|
+
* <Tabs.Tab value='sample'>
|
|
218
|
+
* <Tabs.TabIcon>
|
|
219
|
+
* <SvgPlaceholder />
|
|
220
|
+
* </Tabs.TabIcon>
|
|
221
|
+
* <Tabs.TabLabel>Sample Label</Tabs.TabLabel>
|
|
222
|
+
* <Tabs.TabDescription>Sample Description</Tabs.TabDescription>
|
|
223
|
+
* </Tabs.Tab>
|
|
224
|
+
* </Tabs.Wrapper>
|
|
128
225
|
*/
|
|
129
|
-
export declare const Tabs:
|
|
226
|
+
export declare const Tabs: PolymorphicForwardRefComponent<"div", TabsLegacyProps> & {
|
|
227
|
+
/**
|
|
228
|
+
* A wrapper component for Tabs
|
|
229
|
+
*/
|
|
230
|
+
Wrapper: PolymorphicForwardRefComponent<"div", TabsWrapperOwnProps>;
|
|
231
|
+
/**
|
|
232
|
+
* Tablist subcomponent which contains all of the tab subcomponents.
|
|
233
|
+
* @example
|
|
234
|
+
* <Tabs.TabList>
|
|
235
|
+
* <Tabs.Tab value='tab1' label='Label 1' />
|
|
236
|
+
* <Tabs.Tab value='tab2' label='Label 2' />
|
|
237
|
+
* <Tabs.Tab value='tab3' label='Label 3' />
|
|
238
|
+
* </Tabs.TabList>
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* <Tabs.TabList>
|
|
242
|
+
* <Tabs.Tab value='tab1' label='Green Tab' />
|
|
243
|
+
* </Tabs.TabList>
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* <Tabs.TabList focusActivationMode='manual'>
|
|
247
|
+
* <Tabs.Tab value='tab1' label='Manual Focus Tab' />
|
|
248
|
+
* </Tabs.TabList>
|
|
249
|
+
*/
|
|
250
|
+
TabList: PolymorphicForwardRefComponent<"div", TabListOwnProps>;
|
|
251
|
+
/**
|
|
252
|
+
* Tab subcomponent which is used for each of the tabs.
|
|
253
|
+
* @example
|
|
254
|
+
* <Tabs.Tab value='tab1' label='Label 1' />
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* <Tabs.Tab value='sample'>
|
|
258
|
+
* <Tabs.TabIcon>
|
|
259
|
+
* <SvgPlaceholder />
|
|
260
|
+
* </Tabs.TabIcon>
|
|
261
|
+
* <Tabs.TabLabel>Sample Label</Tabs.TabLabel>
|
|
262
|
+
* <Tabs.TabDescription>Sample Description</Tabs.TabDescription>
|
|
263
|
+
* </Tabs.Tab>
|
|
264
|
+
*
|
|
265
|
+
*/
|
|
266
|
+
Tab: PolymorphicForwardRefComponent<"button", TabOwnProps>;
|
|
267
|
+
/**
|
|
268
|
+
* Tab icon subcomponent which places an icon on the left side of the tab.
|
|
269
|
+
*/
|
|
270
|
+
TabIcon: PolymorphicForwardRefComponent<"span", Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
271
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
272
|
+
}, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
|
|
273
|
+
size?: "small" | "auto" | "medium" | "large" | import("../utils/types.js").AnyString | undefined;
|
|
274
|
+
fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
|
|
275
|
+
padded?: boolean | undefined;
|
|
276
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
277
|
+
as?: "span" | undefined;
|
|
278
|
+
}>;
|
|
279
|
+
/**
|
|
280
|
+
* Tab label subcomponent which holds the tab's label.
|
|
281
|
+
*/
|
|
282
|
+
TabLabel: PolymorphicForwardRefComponent<"span", {}>;
|
|
283
|
+
/**
|
|
284
|
+
* Tab description subcomponent which places a description under the tab label.
|
|
285
|
+
*/
|
|
286
|
+
TabDescription: PolymorphicForwardRefComponent<"span", {}>;
|
|
287
|
+
/**
|
|
288
|
+
* Tab actions subcomponent which contains action buttons that are placed at the end of the tabs.
|
|
289
|
+
*/
|
|
290
|
+
Actions: PolymorphicForwardRefComponent<"div", TabsActionsOwnProps>;
|
|
291
|
+
/**
|
|
292
|
+
* Tab panel subcomponent which contains the tab's content.
|
|
293
|
+
* @example
|
|
294
|
+
* <Tabs.Panel value='tab1'>
|
|
295
|
+
* Sample Panel
|
|
296
|
+
* </Tabs.Panel>
|
|
297
|
+
*/
|
|
298
|
+
Panel: PolymorphicForwardRefComponent<"div", TabsPanelOwnProps>;
|
|
299
|
+
};
|
|
130
300
|
export default Tabs;
|