@sproutsocial/seeds-react-tabs 1.4.14 → 1.4.15

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 DELETED
@@ -1,391 +0,0 @@
1
- # @sproutsocial/seeds-react-tabs
2
-
3
- ## 1.4.14
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [6611f6a]
8
- - @sproutsocial/seeds-react-system-props@3.1.2
9
- - @sproutsocial/seeds-react-button@2.2.4
10
-
11
- ## 1.4.13
12
-
13
- ### Patch Changes
14
-
15
- - Updated dependencies [85f9728]
16
- - Updated dependencies [fa7d859]
17
- - @sproutsocial/seeds-react-theme@4.2.0
18
- - @sproutsocial/seeds-react-button@2.2.3
19
-
20
- ## 1.4.12
21
-
22
- ### Patch Changes
23
-
24
- - Updated dependencies [a13a571]
25
- - @sproutsocial/seeds-react-theme@4.1.1
26
- - @sproutsocial/seeds-react-button@2.2.2
27
-
28
- ## 1.4.11
29
-
30
- ### Patch Changes
31
-
32
- - @sproutsocial/seeds-react-button@2.2.1
33
-
34
- ## 1.4.10
35
-
36
- ### Patch Changes
37
-
38
- - Updated dependencies [456a20f]
39
- - Updated dependencies [5892f44]
40
- - @sproutsocial/seeds-react-button@2.2.0
41
- - @sproutsocial/seeds-react-system-props@3.1.1
42
-
43
- ## 1.4.9
44
-
45
- ### Patch Changes
46
-
47
- - Updated dependencies [5114a32]
48
- - Updated dependencies [a0fe3d3]
49
- - @sproutsocial/seeds-react-theme@4.1.0
50
- - @sproutsocial/seeds-react-button@2.1.3
51
-
52
- ## 1.4.8
53
-
54
- ### Patch Changes
55
-
56
- - Updated dependencies [cb27f07]
57
- - @sproutsocial/seeds-react-button@2.1.2
58
-
59
- ## 1.4.7
60
-
61
- ### Patch Changes
62
-
63
- - Updated dependencies [40d2dfe]
64
- - @sproutsocial/seeds-react-button@2.1.1
65
-
66
- ## 1.4.6
67
-
68
- ### Patch Changes
69
-
70
- - Updated dependencies [132ef9d]
71
- - Updated dependencies [132ef9d]
72
- - Updated dependencies [132ef9d]
73
- - @sproutsocial/seeds-react-button@2.1.0
74
- - @sproutsocial/seeds-react-theme@4.0.0
75
- - @sproutsocial/seeds-react-system-props@3.1.0
76
-
77
- ## 1.4.5
78
-
79
- ### Patch Changes
80
-
81
- - @sproutsocial/seeds-react-button@2.0.8
82
-
83
- ## 1.4.4
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies [47c62b3]
88
- - @sproutsocial/seeds-react-theme@3.7.1
89
- - @sproutsocial/seeds-react-button@2.0.7
90
-
91
- ## 1.4.3
92
-
93
- ### Patch Changes
94
-
95
- - Updated dependencies [06da9c2]
96
- - @sproutsocial/seeds-react-theme@3.7.0
97
- - @sproutsocial/seeds-react-button@2.0.6
98
-
99
- ## 1.4.2
100
-
101
- ### Patch Changes
102
-
103
- - 9c60744: Fix Safari-only tab collapse not addressed by 1.4.1:
104
-
105
- Inside a flex parent with `overflow: auto/hidden`, Safari resolves the Container's `min-height: min-content` to `0` when the same element also has `overflow-x: auto; overflow-y: hidden`. Tabs would paint once, then collapse to their `border-bottom` (1px). Adds `flex-shrink: 0` on the Container so the tablist preserves its intrinsic height regardless of how Safari handles `min-content` in that combination. Chrome behavior is unchanged.
106
-
107
- Reported in [BUGS-28687](https://sprout.atlassian.net/browse/BUGS-28687) across every Profiles-by-Network report.
108
-
109
- ## 1.4.1
110
-
111
- ### Patch Changes
112
-
113
- - 679806a: Fix layout regression introduced in 1.4.0:
114
-
115
- - **Tabs no longer collapse to a 1px-tall row inside flex-column parents.** Container's `overflow-x: auto; overflow-y: hidden` was triggering the flex `min-height: auto → 0` override, allowing an ancestor `display: flex; flex-direction: column` with a bounded height (e.g. `ContentWithDrillDown`'s `Content.Body`) to shrink the tablist to its border-bottom. Container now sets `min-height: min-content`, restoring the pre-1.4.0 minimum-size behavior without changing scroll semantics.
116
-
117
- No API changes.
118
-
119
- ## 1.4.0
120
-
121
- ### Minor Changes
122
-
123
- - 412cc1e: Tabs now scrolls horizontally when the tab list overflows its container, with a fade indicator at each edge that auto-adapts to the parent's background via CSS `mask-image`. Vertical mouse-wheel input is redirected to horizontal scroll (with release-at-ends behavior so page scrolling isn't trapped), and arrow-key and click activation auto-scroll the selected tab into view. Adds an optional `aria-label` prop that's forwarded to the `role="tablist"` element per the WAI-ARIA Authoring Practices Tabs pattern.
124
-
125
- Spacing change for non-`fullWidth` Tabs: the inter-tab `margin-right` between adjacent tab buttons has been removed in favor of horizontal padding on each tab button. Visual spacing is preserved (each tab now contributes its own breathing room via padding rather than the previous tab pushing it via margin), and clickable hit-areas are slightly larger. The `fullWidth` case is unchanged. Consumers depending on the exact pixel values of the old margin should re-check their layouts.
126
-
127
- ## 1.3.11
128
-
129
- ### Patch Changes
130
-
131
- - @sproutsocial/seeds-react-button@2.0.5
132
-
133
- ## 1.3.10
134
-
135
- ### Patch Changes
136
-
137
- - @sproutsocial/seeds-react-button@2.0.4
138
-
139
- ## 1.3.9
140
-
141
- ### Patch Changes
142
-
143
- - @sproutsocial/seeds-react-button@2.0.3
144
-
145
- ## 1.3.8
146
-
147
- ### Patch Changes
148
-
149
- - @sproutsocial/seeds-react-button@2.0.2
150
-
151
- ## 1.3.7
152
-
153
- ### Patch Changes
154
-
155
- - @sproutsocial/seeds-react-button@2.0.1
156
-
157
- ## 1.3.6
158
-
159
- ### Patch Changes
160
-
161
- - Updated dependencies [4ba8720]
162
- - Updated dependencies [df9d751]
163
- - @sproutsocial/seeds-react-theme@3.6.2
164
- - @sproutsocial/seeds-react-button@2.0.0
165
-
166
- ## 1.3.5
167
-
168
- ### Patch Changes
169
-
170
- - Updated dependencies [1f9a473]
171
- - @sproutsocial/seeds-react-theme@3.6.1
172
- - @sproutsocial/seeds-react-button@1.4.3
173
-
174
- ## 1.3.4
175
-
176
- ### Patch Changes
177
-
178
- - @sproutsocial/seeds-react-button@1.4.2
179
-
180
- ## 1.3.3
181
-
182
- ### Patch Changes
183
-
184
- - @sproutsocial/seeds-react-button@1.4.1
185
-
186
- ## 1.3.2
187
-
188
- ### Patch Changes
189
-
190
- - Updated dependencies [7d54d67]
191
- - @sproutsocial/seeds-react-button@1.4.0
192
-
193
- ## 1.3.1
194
-
195
- ### Patch Changes
196
-
197
- - Updated dependencies [17d4f12]
198
- - @sproutsocial/seeds-react-theme@3.6.0
199
- - @sproutsocial/seeds-react-button@1.3.20
200
-
201
- ## 1.3.0
202
-
203
- ### Minor Changes
204
-
205
- - 651fc1b: Update TabButton structure to correct aria descendents
206
-
207
- ## 1.2.10
208
-
209
- ### Patch Changes
210
-
211
- - @sproutsocial/seeds-react-button@1.3.19
212
-
213
- ## 1.2.9
214
-
215
- ### Patch Changes
216
-
217
- - Updated dependencies [118e300]
218
- - @sproutsocial/seeds-react-theme@3.5.1
219
- - @sproutsocial/seeds-react-button@1.3.18
220
-
221
- ## 1.2.8
222
-
223
- ### Patch Changes
224
-
225
- - @sproutsocial/seeds-react-button@1.3.17
226
-
227
- ## 1.2.7
228
-
229
- ### Patch Changes
230
-
231
- - @sproutsocial/seeds-react-button@1.3.16
232
-
233
- ## 1.2.6
234
-
235
- ### Patch Changes
236
-
237
- - @sproutsocial/seeds-react-button@1.3.15
238
-
239
- ## 1.2.5
240
-
241
- ### Patch Changes
242
-
243
- - Updated dependencies [db6ce39]
244
- - Updated dependencies [20bb01b]
245
- - @sproutsocial/seeds-react-theme@3.5.0
246
- - @sproutsocial/seeds-react-button@1.3.14
247
-
248
- ## 1.2.4
249
-
250
- ### Patch Changes
251
-
252
- - Updated dependencies [7716e16]
253
- - @sproutsocial/seeds-react-theme@3.4.0
254
- - @sproutsocial/seeds-react-button@1.3.13
255
-
256
- ## 1.2.3
257
-
258
- ### Patch Changes
259
-
260
- - @sproutsocial/seeds-react-theme@3.3.2
261
- - @sproutsocial/seeds-react-button@1.3.12
262
-
263
- ## 1.2.2
264
-
265
- ### Patch Changes
266
-
267
- - @sproutsocial/seeds-react-button@1.3.11
268
-
269
- ## 1.2.1
270
-
271
- ### Patch Changes
272
-
273
- - @sproutsocial/seeds-react-theme@3.3.1
274
- - @sproutsocial/seeds-react-button@1.3.10
275
-
276
- ## 1.2.0
277
-
278
- ### Minor Changes
279
-
280
- - 2612fec: Add TabPanel to Tabs
281
- - 2612fec: Remove list semantics from tabs
282
-
283
- ### Patch Changes
284
-
285
- - Updated dependencies [750d1ea]
286
- - @sproutsocial/seeds-react-theme@3.3.0
287
- - @sproutsocial/seeds-react-button@1.3.9
288
-
289
- ## 1.1.12
290
-
291
- ### Patch Changes
292
-
293
- - @sproutsocial/seeds-react-button@1.3.8
294
-
295
- ## 1.1.11
296
-
297
- ### Patch Changes
298
-
299
- - @sproutsocial/seeds-react-button@1.3.7
300
-
301
- ## 1.1.10
302
-
303
- ### Patch Changes
304
-
305
- - Updated dependencies [fa7579a]
306
- - @sproutsocial/seeds-react-theme@3.2.1
307
- - @sproutsocial/seeds-react-button@1.3.6
308
-
309
- ## 1.1.9
310
-
311
- ### Patch Changes
312
-
313
- - @sproutsocial/seeds-react-button@1.3.5
314
-
315
- ## 1.1.8
316
-
317
- ### Patch Changes
318
-
319
- - Updated dependencies [8f6ba8d]
320
- - @sproutsocial/seeds-react-theme@3.2.0
321
- - @sproutsocial/seeds-react-button@1.3.4
322
-
323
- ## 1.1.7
324
-
325
- ### Patch Changes
326
-
327
- - @sproutsocial/seeds-react-button@1.3.3
328
-
329
- ## 1.1.6
330
-
331
- ### Patch Changes
332
-
333
- - @sproutsocial/seeds-react-button@1.3.2
334
-
335
- ## 1.1.5
336
-
337
- ### Patch Changes
338
-
339
- - Updated dependencies [b1c3b44]
340
- - @sproutsocial/seeds-react-theme@3.1.1
341
- - @sproutsocial/seeds-react-button@1.3.1
342
-
343
- ## 1.1.4
344
-
345
- ### Patch Changes
346
-
347
- - Updated dependencies [5ea5457]
348
- - @sproutsocial/seeds-react-button@1.3.0
349
-
350
- ## 1.1.3
351
-
352
- ### Patch Changes
353
-
354
- - Updated dependencies [47580c4]
355
- - @sproutsocial/seeds-react-theme@3.1.0
356
- - @sproutsocial/seeds-react-button@1.2.3
357
-
358
- ## 1.1.2
359
-
360
- ### Patch Changes
361
-
362
- - Updated dependencies [22e1111]
363
- - @sproutsocial/seeds-react-button@1.2.2
364
- - @sproutsocial/seeds-react-theme@3.0.1
365
-
366
- ## 1.1.1
367
-
368
- ### Patch Changes
369
-
370
- - 9fd8bac: Update dependencies to use semantic package version instead of wildcards
371
- - Updated dependencies [9fd8bac]
372
- - @sproutsocial/seeds-react-system-props@3.0.2
373
- - @sproutsocial/seeds-react-button@1.2.1
374
- - @sproutsocial/seeds-react-theme@2.2.1
375
-
376
- ## 1.1.0
377
-
378
- ### Minor Changes
379
-
380
- - cd61069: Refactors Tabs onSelect prop
381
- - This should not be a breaking change; at most, type errors may arise.
382
- - Before: `onSelect: (arg0: string) => void;`
383
- - After: `onSelect(id: string): void;`
384
- - By using method syntax when defining the prop's type, we allow users more control over the type of their `onSelect` function.
385
- - For instance, this allows a function with signature `(id: 'a' | 'b') => void` to be passed
386
-
387
- ## 1.0.0
388
-
389
- ### Major Changes
390
-
391
- - bd8d03d: Migrate tabs from Racine to seeds-react-tabs
package/jest.config.js DELETED
@@ -1,9 +0,0 @@
1
- const baseConfig = require("@sproutsocial/seeds-testing");
2
-
3
- /** * @type {import('jest').Config} */
4
- const config = {
5
- ...baseConfig,
6
- displayName: "seeds-react-tabs",
7
- };
8
-
9
- module.exports = config;
@@ -1,258 +0,0 @@
1
- import React, { useState } from "react";
2
- import { Button } from "@sproutsocial/seeds-react-button";
3
- import { Icon, type TypeIconName } from "@sproutsocial/seeds-react-icon";
4
- import { Tabs } from "./";
5
- import { Text } from "@sproutsocial/seeds-react-text";
6
- import type { Meta, StoryObj } from "@storybook/react";
7
- import Box from "@sproutsocial/seeds-react-box";
8
-
9
- interface TypeTabData {
10
- id: string;
11
- text: string;
12
- icon: TypeIconName;
13
- }
14
-
15
- interface TypeTabsStoryState {
16
- selected: string;
17
- tabs?: TypeTabData[];
18
- }
19
-
20
- const meta: Meta<typeof Tabs> = {
21
- title: "Components/Tabs",
22
- component: Tabs,
23
- args: {
24
- fullWidth: false,
25
- },
26
- };
27
-
28
- export default meta;
29
-
30
- type Story = StoryObj<typeof Tabs>;
31
-
32
- export const Default: Story = {
33
- render: (args) => {
34
- const [selectedId, setSelectedId] = useState("notifications");
35
-
36
- return (
37
- <React.Fragment>
38
- <Tabs
39
- selectedId={selectedId}
40
- onSelect={(selected) => setSelectedId(selected)}
41
- fullWidth={args.fullWidth}
42
- >
43
- <Tabs.Button id="notifications">
44
- <Icon name="bell-outline" mr="12px" aria-hidden />
45
- <Text size="300" fontWeight="600">
46
- Notifications
47
- </Text>
48
- </Tabs.Button>
49
- <Tabs.Button id="issues">
50
- <Icon name="triangle-exclamation-outline" mr="12px" aria-hidden />
51
- <Text size="300" fontWeight="600">
52
- Issues
53
- </Text>
54
- </Tabs.Button>
55
- </Tabs>
56
-
57
- {selectedId === "notifications" && (
58
- <Tabs.Panel id="notifications">
59
- <Text mt="24px">
60
- Notifications panel content goes here. This panel is properly
61
- connected to the "Notifications" tab via ARIA attributes for
62
- accessibility.
63
- </Text>
64
- </Tabs.Panel>
65
- )}
66
-
67
- {selectedId === "issues" && (
68
- <Tabs.Panel id="issues">
69
- <Text mt="24px">
70
- Issues panel content goes here. Screen readers will announce the
71
- relationship between tabs and panels.
72
- </Text>
73
- </Tabs.Panel>
74
- )}
75
- </React.Fragment>
76
- );
77
- },
78
- name: "Default",
79
- };
80
-
81
- export const FullWidth: Story = {
82
- render: (args) => {
83
- const [selectedId, setSelectedId] = useState("notifications");
84
-
85
- return (
86
- <Box width="100%" display="flex" flexDirection="column">
87
- <Tabs
88
- selectedId={selectedId}
89
- onSelect={(selected) => setSelectedId(selected)}
90
- fullWidth
91
- >
92
- <Tabs.Button id="notifications">
93
- <Icon name="bell-outline" mr="12px" aria-hidden />
94
- <Text size="300" fontWeight="600">
95
- Notifications
96
- </Text>
97
- </Tabs.Button>
98
- <Tabs.Button id="issues">
99
- <Icon name="triangle-exclamation-outline" mr="12px" aria-hidden />
100
- <Text size="300" fontWeight="600">
101
- Issues
102
- </Text>
103
- </Tabs.Button>
104
- </Tabs>
105
-
106
- {selectedId === "notifications" && (
107
- <Tabs.Panel id="notifications">
108
- <Text mt="24px">
109
- Notifications panel content goes here. This panel is properly
110
- connected to the "Notifications" tab via ARIA attributes for
111
- accessibility.
112
- </Text>
113
- </Tabs.Panel>
114
- )}
115
-
116
- {selectedId === "issues" && (
117
- <Tabs.Panel id="issues">
118
- <Text mt="24px">
119
- Issues panel content goes here. Screen readers will announce the
120
- relationship between tabs and panels.
121
- </Text>
122
- </Tabs.Panel>
123
- )}
124
- </Box>
125
- );
126
- },
127
- name: "Full width",
128
- };
129
-
130
- export const Scrollable: Story = {
131
- render: () => {
132
- const tabs = [
133
- "Overview",
134
- "Notifications",
135
- "Issues",
136
- "Pull Requests",
137
- "Discussions",
138
- "Actions",
139
- "Projects",
140
- "Wiki",
141
- "Security",
142
- "Insights",
143
- ];
144
- const [selectedId, setSelectedId] = useState(tabs[0]);
145
-
146
- return (
147
- <>
148
- <Box width="450px" mb={400}>
149
- <Tabs
150
- selectedId={selectedId ?? ""}
151
- onSelect={(selected) => setSelectedId(selected)}
152
- aria-label="Repository sections"
153
- >
154
- {tabs.map((tab) => (
155
- <Tabs.Button key={tab} id={tab}>
156
- <Text size="300" fontWeight="600" flexWrap={"nowrap"}>
157
- {tab}
158
- </Text>
159
- </Tabs.Button>
160
- ))}
161
- </Tabs>
162
- </Box>
163
-
164
- {tabs.map((tab) => {
165
- if (selectedId !== tab) return null;
166
- return (
167
- <Tabs.Panel id={tab}>
168
- <Text color="text.body">{tab} Panel</Text>
169
- </Tabs.Panel>
170
- );
171
- })}
172
- </>
173
- );
174
- },
175
- name: "Scrollable",
176
- parameters: {
177
- docs: {
178
- description: {
179
- story:
180
- "When the tab list overflows its container, the bar scrolls horizontally and a fade indicator appears at each overflowing edge. Arrow-key and click activation auto-scroll the selected tab fully into view past the fade region. The fade uses CSS `mask-image` so it auto-adapts to any container background — no consumer configuration needed.",
181
- },
182
- },
183
- },
184
- };
185
-
186
- export const RemoveATab: Story = {
187
- render: (args) => {
188
- const [state, setState] = useState<TypeTabsStoryState>({
189
- selected: "notifications",
190
- tabs: [
191
- {
192
- id: "notifications",
193
- text: "Notifications",
194
- icon: "bell-outline",
195
- },
196
- {
197
- id: "issues",
198
- text: "Issues",
199
- icon: "triangle-exclamation-outline",
200
- },
201
- {
202
- id: "fun",
203
- text: "Fun Tab",
204
- icon: "x-twitter",
205
- },
206
- {
207
- id: "drafts",
208
- text: "Drafts",
209
- icon: "paper-outline",
210
- },
211
- ],
212
- });
213
-
214
- return (
215
- <React.Fragment>
216
- <Button
217
- onClick={() =>
218
- setState({
219
- ...state,
220
- tabs: state.tabs?.slice(1),
221
- })
222
- }
223
- >
224
- Remove a tab <Icon name="x-outline" aria-hidden />
225
- </Button>
226
- <Tabs
227
- selectedId={state.selected}
228
- onSelect={(selected) =>
229
- setState({
230
- ...state,
231
- selected,
232
- })
233
- }
234
- fullWidth={args.fullWidth}
235
- >
236
- {state.tabs?.map((tab) => (
237
- <Tabs.Button key={tab.id} id={tab.id}>
238
- <Icon name={tab.icon} mr="12px" aria-hidden />
239
- <Text size="300" fontWeight="600">
240
- {tab.text}
241
- </Text>
242
- </Tabs.Button>
243
- ))}
244
- </Tabs>
245
-
246
- {state.tabs?.map(
247
- (tab) =>
248
- state.selected === tab.id && (
249
- <Tabs.Panel key={tab.id} id={tab.id}>
250
- <Text mt="24px">{tab.text} panel content goes here.</Text>
251
- </Tabs.Panel>
252
- )
253
- )}
254
- </React.Fragment>
255
- );
256
- },
257
- name: "Remove a tab",
258
- };