diff --git a/.changeset/lemon-starfishes-trade.md b/.changeset/lemon-starfishes-trade.md
new file mode 100644
index 000000000..4347ab4f9
--- /dev/null
+++ b/.changeset/lemon-starfishes-trade.md
@@ -0,0 +1,5 @@
+---
+"@hopper-ui/components": patch
+---
+
+Updated TagGroup's API. Removed TagList since it's now used internally. Added label, description and errorMessage props instead of being used as slots.
diff --git a/apps/docs/content/components/collections/TagGroup.mdx b/apps/docs/content/components/collections/TagGroup.mdx
index ce6e2eb6e..1b87a8518 100644
--- a/apps/docs/content/components/collections/TagGroup.mdx
+++ b/apps/docs/content/components/collections/TagGroup.mdx
@@ -1,7 +1,7 @@
---
title: TagGroup
description: The TagGroup is a dynamic UI component that encapsulates a collection of tags.
- Each tag, representing a label, category, keyword, or filter, is designed to be used within a TagList for groupings.
+ Each tag represents a label, category, keyword, or filter, and can be used for various groupings
category: "collections"
links:
source: https://github.com/gsoft-inc/wl-hopper/blob/main/packages/components/src/tag/src/TagGroup.tsx
@@ -34,19 +34,19 @@ links:
A `TagGroup` uses the following components.
-
+
## Usage
### Label
-A tag group can contain a label to provide more context to the user.
+A tag group can use the `label` prop to provide more context to the user.
### Description
-A tag group can contain a description to provide more information to the user.
+A tag group can use a `description` prop to provide more information to the user.
@@ -111,7 +111,7 @@ A tag can vary in style using the `variant` prop.
Using the `renderEmptyState` prop, you can customize the empty state message when there are no tags.
-
+
### Invalid
@@ -176,10 +176,6 @@ A tag can be rendered as a react router link when using the `href` prop and sett
-### TagList
-
-
-
### Tag
@@ -190,10 +186,6 @@ A tag can be rendered as a react router link when using the `href` prop and sett
-### TagList
-
-
-
### Tag
diff --git a/apps/docs/examples/Preview.ts b/apps/docs/examples/Preview.ts
index 908d98b62..80d766db6 100644
--- a/apps/docs/examples/Preview.ts
+++ b/apps/docs/examples/Preview.ts
@@ -191,8 +191,8 @@ export const Previews: Record = {
"tag/docs/tag/variants": {
component: lazy(() => import("@/../../packages/components/src/tag/docs/tag/variants.tsx"))
},
- "tag/docs/tagList/empty": {
- component: lazy(() => import("@/../../packages/components/src/tag/docs/tagList/empty.tsx"))
+ "tag/docs/tagGroup/empty": {
+ component: lazy(() => import("@/../../packages/components/src/tag/docs/tagGroup/empty.tsx"))
},
"tag/docs/tag/invalid": {
component: lazy(() => import("@/../../packages/components/src/tag/docs/tag/invalid.tsx"))
diff --git a/packages/components/src/Form/tests/chromatic/Form.stories.tsx b/packages/components/src/Form/tests/chromatic/Form.stories.tsx
index aaf5aca35..5b0f4c9be 100644
--- a/packages/components/src/Form/tests/chromatic/Form.stories.tsx
+++ b/packages/components/src/Form/tests/chromatic/Form.stories.tsx
@@ -5,7 +5,6 @@ import {
ComboBox,
ComboBoxItem,
Inline,
- Label,
Radio,
RadioGroup,
Select,
@@ -13,7 +12,6 @@ import {
Stack,
Tag,
TagGroup,
- TagList,
TextArea,
TextField
} from "@hopper-ui/components";
@@ -67,12 +65,9 @@ const Template = () => {
CatFrog
-
-
-
- Canada
- US
-
+
+ Canada
+ US
>);
diff --git a/packages/components/src/tag/docs/TagGroup.stories.tsx b/packages/components/src/tag/docs/TagGroup.stories.tsx
index a50a25346..a78c34895 100644
--- a/packages/components/src/tag/docs/TagGroup.stories.tsx
+++ b/packages/components/src/tag/docs/TagGroup.stories.tsx
@@ -6,16 +6,12 @@ import { useState } from "react";
import { RouterProvider, createMemoryRouter, useNavigate } from "react-router-dom";
import { Badge } from "../../Badge/index.ts";
-import { ErrorMessage } from "../../ErrorMessage/index.ts";
-import { HelperMessage } from "../../HelperMessage/index.ts";
import { HopperProvider } from "../../HopperProvider/index.ts";
import { IconList } from "../../IconList/index.ts";
import { Stack } from "../../layout/index.ts";
-import { Label } from "../../typography/Label/index.ts";
import { Text } from "../../typography/Text/index.ts";
import { Tag } from "../src/Tag.tsx";
import { TagGroup } from "../src/TagGroup.tsx";
-import { TagList } from "../src/TagList.tsx";
/**
* The TagGroup is a dynamic UI component that encapsulates a collection of tags.
@@ -49,11 +45,9 @@ type Story = StoryObj;
export const Default = {
render: props => (
-
- Tag 1
- Tag 2
- Tag 3
-
+ Tag 1
+ Tag 2
+ Tag 3
)
} satisfies Story;
@@ -77,11 +71,9 @@ export const RemovableTags = {
export const LoadingTags = {
render: props => (
-
- Tag 1
- Tag 2
- Tag 3
-
+ Tag 1
+ Tag 2
+ Tag 3
),
args: {
@@ -92,18 +84,15 @@ export const LoadingTags = {
} satisfies Story;
/**
- * A TagGroup can have a Label to provide more context to the user.
+ * A TagGroup can have a label to provide more context to the user.
*/
export const LabelStory = {
name: "Label",
render: props => (
-
-
- Tag 1
- Tag 2
- Tag 3
-
-
+
+ Tag 1
+ Tag 2
+ Tag 3
)
} satisfies Story;
@@ -115,25 +104,19 @@ export const Sizes = {
render: props => (
-
- Tag 1
- Tag 2
- Tag 3
-
+ Tag 1
+ Tag 2
+ Tag 3
-
- Tag 1
- Tag 2
- Tag 3
-
+ Tag 1
+ Tag 2
+ Tag 3
-
- Tag 1
- Tag 2
- Tag 3
-
+ Tag 1
+ Tag 2
+ Tag 3
),
@@ -150,49 +133,22 @@ export const Sizes = {
export const Variants = {
render: props => (
-
-
- Neutral
-
-
- Subdued
-
-
- Progress
-
-
- Positive
-
-
- Caution
-
-
- Negative
-
-
- Option 1
-
-
- Option 2
-
-
- Option 3
-
-
- Option 4
-
-
- Option 5
-
-
- Option 6
-
-
+ Neutral
+ Subdued
+ Progress
+ Positive
+ Caution
+ Negative
+ Option 1
+ Option 2
+ Option 3
+ Option 4
+ Option 5
+ Option 6
)
} satisfies Story;
-
/**
* Tags can have icons.
*/
@@ -200,52 +156,46 @@ export const Icons = {
render: props => (
-
-
+
+
+ Developer
+
+
+ Designer
+
+
- Developer
-
-
- Designer
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+ Developer
+
+
+ Designer
+
+
- Developer
-
-
- Designer
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+ Developer
+
+
+ Designer
+
+
- Developer
-
-
- Designer
-
-
-
-
-
-
-
+
+
+
),
@@ -256,7 +206,6 @@ export const Icons = {
}
} satisfies Story;
-
/**
* Tags can also have a count using the `Badge` component.
*/
@@ -264,40 +213,34 @@ export const Count = {
render: props => (
-
-
- Designer
- 12
-
-
- Developer
- 100
-
-
+
+ Designer
+ 12
+
+
+ Developer
+ 100
+
-
-
- Designer
- 12
-
-
- Developer
- 100
-
-
+
+ Designer
+ 12
+
+
+ Developer
+ 100
+
-
-
- 12
- Designer
-
-
- Developer
- 100
-
-
+
+ 12
+ Designer
+
+
+ Developer
+ 100
+
)
@@ -308,14 +251,10 @@ export const Count = {
*/
export const Description = {
render: props => (
-
-
-
- Earth
- Mars
- Jupiter
-
- The planets in this list are in no particular order.
+
+ Earth
+ Mars
+ Jupiter
),
args: {
@@ -327,8 +266,6 @@ export const Description = {
/**
* Tags can be selected using the `selectionMode` prop.
- * Use `defaultSelectedKeys` for initial selected items (uncontrolled) and `selectedKeys` to manage selected items (controlled).
- * The selected keys should match the item's id prop.
*/
export const SelectableTags = {
...Description,
@@ -340,7 +277,7 @@ export const SelectableTags = {
} satisfies Story;
/**
- * Tags can be disabled using the `disabledKeys` prop or the `isDisabled` prop on the Tag component.
+ * Tags can be disabled using the `disabledKeys` prop.
*/
export const DisabledTags = {
...Description,
@@ -351,8 +288,7 @@ export const DisabledTags = {
} satisfies Story;
/**
- * If a TagGroup is invalid, it will display an error message. Displaying this error message will hide the helper message.
- * A individual Tag can also be set as invalid using the `isInvalid` prop.
+ * If a TagGroup is invalid, it will display an error message.
*/
export const Validation = {
args: {
@@ -371,23 +307,15 @@ export const Validation = {
return (
-
- Unselect all to show the error message
- Select a tag and the description will appear
-
- Tag 1
- Tag 2
- Tag 3
-
-
+
+ Tag 1
+ Tag 2
+ Tag 3
-
-
-
- Tag 1
- Tag 2
- Tag 3
-
+
+ Tag 1
+ Tag 2
+ Tag 3
);
@@ -400,32 +328,26 @@ export const Validation = {
export const EmptyState = {
render: props => (
- "No tags available"}
- >
- {[]}
-
+ No tags available
)
} satisfies Story;
/**
- * Tags can be links by using the `href` prop on the Tag component. Tags with an `href` are not selectable.
+ * Tags can be links by using the `href` prop on the Tag component.
*/
export const Links = {
render: props => (
-
- Google
- Bing
- Yahoo
-
+ Google
+ Bing
+ Yahoo
)
} satisfies Story;
/**
- * A Tag can be rendered as a react router link when using the href property, and setting the navigate property on the HopperProvider
+ * A Tag can be rendered as a react router link when using the href property, and setting the navigate property on the HopperProvider.
*/
export const ReactRouterLink: Story = {
render: props => {
@@ -435,30 +357,32 @@ export const ReactRouterLink: Story = {
return (
-
- Page 1
- Page 2
- Page 3
-
+ Page 1
+ Page 2
+ Page 3
);
},
decorators: [
Story => {
- const router = createMemoryRouter([{
- path: "/123",
- element: