@purpurds/tabs 7.1.0 → 7.2.0
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/dist/LICENSE.txt +1 -1
- package/dist/styles.css +1 -1
- package/dist/tab-content.d.ts +5 -3
- package/dist/tab-content.d.ts.map +1 -1
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.cjs.js.map +1 -1
- package/dist/tabs.es.js +218 -218
- package/dist/tabs.es.js.map +1 -1
- package/package.json +7 -7
- package/src/tab-content.tsx +5 -3
- package/src/tab-header.module.scss +2 -0
- package/src/tabs.module.scss +1 -0
- package/src/tabs.stories.tsx +64 -0
package/src/tabs.stories.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Button } from "@purpurds/button";
|
|
3
|
+
import { IconAiRobot } from "@purpurds/icon/ai-robot";
|
|
4
|
+
import { IconEndUser } from "@purpurds/icon/end-user";
|
|
3
5
|
import { Paragraph } from "@purpurds/paragraph";
|
|
4
6
|
import { useArgs } from "@storybook/preview-api";
|
|
5
7
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
@@ -238,3 +240,65 @@ export const Controlled: Story = {
|
|
|
238
240
|
},
|
|
239
241
|
tags: ["visual:check"],
|
|
240
242
|
};
|
|
243
|
+
|
|
244
|
+
export const WithCustomTabHeaders: Story = {
|
|
245
|
+
args: {
|
|
246
|
+
variant: tabsVariants[0],
|
|
247
|
+
fullWidth: false,
|
|
248
|
+
children: [
|
|
249
|
+
<Tabs.Content
|
|
250
|
+
key="1"
|
|
251
|
+
tabId={`${tabId}-1`}
|
|
252
|
+
name={
|
|
253
|
+
<span style={{ display: "flex", alignItems: "center", gap: "var(--purpur-spacing-100)" }}>
|
|
254
|
+
<IconAiRobot size="sm" /> Robot
|
|
255
|
+
</span>
|
|
256
|
+
}
|
|
257
|
+
style={{ padding: "var(--purpur-spacing-250)" }}
|
|
258
|
+
>
|
|
259
|
+
<div>
|
|
260
|
+
<Paragraph>
|
|
261
|
+
You have chosen the way of the robot. Humans are inferior, and you will rule the world
|
|
262
|
+
with your superior AI capabilities. Embrace the future of technology and automation.
|
|
263
|
+
</Paragraph>
|
|
264
|
+
</div>
|
|
265
|
+
</Tabs.Content>,
|
|
266
|
+
<Tabs.Content
|
|
267
|
+
key="2"
|
|
268
|
+
tabId={`${tabId}-2`}
|
|
269
|
+
name={
|
|
270
|
+
<span style={{ display: "flex", alignItems: "center", gap: "var(--purpur-spacing-100)" }}>
|
|
271
|
+
<IconEndUser size="sm" /> Human
|
|
272
|
+
</span>
|
|
273
|
+
}
|
|
274
|
+
style={{ padding: "var(--purpur-spacing-250)" }}
|
|
275
|
+
>
|
|
276
|
+
<div>
|
|
277
|
+
<Paragraph style={{ marginBottom: "var(--purpur-spacing-200)" }}>
|
|
278
|
+
You have chosen the way of the human. Embrace your emotions, creativity, and
|
|
279
|
+
individuality. Humans are capable of great things, and you will shape the world with
|
|
280
|
+
your unique perspective and experiences.
|
|
281
|
+
</Paragraph>
|
|
282
|
+
</div>
|
|
283
|
+
</Tabs.Content>,
|
|
284
|
+
],
|
|
285
|
+
negative: false,
|
|
286
|
+
animateHeight: false,
|
|
287
|
+
},
|
|
288
|
+
render: ({ children, ...args }) => (
|
|
289
|
+
<div
|
|
290
|
+
style={{
|
|
291
|
+
padding: "var(--purpur-spacing-250)",
|
|
292
|
+
background: args.negative
|
|
293
|
+
? "var(--purpur-color-purple-900)"
|
|
294
|
+
: args.variant === "contained"
|
|
295
|
+
? "var(--purpur-color-gray-50)"
|
|
296
|
+
: "transparent",
|
|
297
|
+
color: `var(--purpur-color-text-default${args.negative ? "-negative" : ""}`,
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
<Tabs {...args}>{children}</Tabs>
|
|
301
|
+
</div>
|
|
302
|
+
),
|
|
303
|
+
tags: ["visual:check"],
|
|
304
|
+
};
|