Skip to content

Commit

Permalink
Merge branch 'alpha' into feature/guides
Browse files Browse the repository at this point in the history
  • Loading branch information
alexasselin008 committed Nov 29, 2024
2 parents aca3c00 + 5a905d9 commit 88b3779
Show file tree
Hide file tree
Showing 36 changed files with 171 additions and 215 deletions.
6 changes: 5 additions & 1 deletion apps/docs/content/components/collections/Listbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ links:

A `ListBox` uses the following components.

<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Section", "Text"]}/>
<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Text"]}/>

## Usage

Expand Down Expand Up @@ -170,6 +170,10 @@ List box items can vary in sizes.

<PropTable component="ListBox" />

### ListBoxSection

<PropTable component="ListBoxSection" />

### ListBoxItem

<PropTable component="ListBoxItem" />
Expand Down
57 changes: 0 additions & 57 deletions apps/docs/content/components/collections/Section.mdx

This file was deleted.

12 changes: 11 additions & 1 deletion apps/docs/content/components/pickers/ComboBox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The Section component represents a `section` within a Hopper container.

A `ComboBox` uses the following components.

<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Section", "Text"]}/>
<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Text"]}/>

## Usage

Expand Down Expand Up @@ -197,5 +197,15 @@ A combo box item can have a description.

## Props

### ComboBox

<PropTable component="ComboBox" />

### ComboBoxSection

<PropTable component="ListBoxSection" />

### ComboBoxItem

<PropTable component="ListBoxItem" />

12 changes: 11 additions & 1 deletion apps/docs/content/components/pickers/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Section component represents a `section` within a Hopper container.

A `Select` uses the following components.

<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Section", "Text"]}/>
<ComposedComponents components={["Avatar", "Badge", "Header", "Icon", "Text"]}/>

## Usage

Expand Down Expand Up @@ -198,8 +198,18 @@ A select item can have a description.

## Props

### Select

<PropTable component="Select" />

### SelectSection

<PropTable component="ListBoxSection" />

### SelectItem

<PropTable component="ListBoxItem" />

## Migration Notes

<MigrateGuide src="Select/docs/migration-notes" />
3 changes: 0 additions & 3 deletions apps/docs/examples/Preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ export const Previews: Record<string, Preview> = {
"ListBox/docs/multipleSizes": {
component: lazy(() => import("@/../../packages/components/src/ListBox/docs/multipleSizes.tsx"))
},
"Section/docs/preview": {
component: lazy(() => import("@/../../packages/components/src/Section/docs/preview.tsx"))
},
"tag/docs/preview": {
component: lazy(() => import("@/../../packages/components/src/tag/docs/preview.tsx"))
},
Expand Down
1 change: 0 additions & 1 deletion apps/docs/examples/overview/Section.svg

This file was deleted.

2 changes: 0 additions & 2 deletions apps/docs/examples/overview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import PasswordField from "./PasswordField.svg";
import Popover from "./Popover.svg";
import RadioGroup from "./RadioGroup.svg";
import SearchField from "./SearchField.svg";
import Section from "./Section.svg";
import Select from "./Select.svg";
import Spinner from "./Spinner.svg";
import Stack from "./Stack.svg";
Expand Down Expand Up @@ -81,7 +80,6 @@ export const OverviewComponents: OverviewComponentsType = {
Popover,
RadioGroup,
SearchField,
Section,
Select,
Spinner,
Stack,
Expand Down
6 changes: 6 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @hopper-ui/components

## 1.3.35

### Patch Changes

- 865ddbe: There is no longer a generic Section component. We now have ListBoxSection, SelectSection and ComboBoxSection.

## 1.3.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hopper-ui/components",
"author": "Workleap",
"version": "1.3.34",
"version": "1.3.35",
"description": "The components package.",
"license": "Apache-2.0",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Collection, ComboBox, ComboBoxItem, Header, Inline, Section } from "@hopper-ui/components";
import { Collection, ComboBox, ComboBoxItem, ComboBoxSection, Header, Inline } from "@hopper-ui/components";

interface ListItemProps {
id: number | string;
Expand Down Expand Up @@ -57,12 +57,12 @@ export default function Example() {
const { role: sectionName, children } = section;

return (
<Section id={sectionName}>
<ComboBoxSection id={sectionName}>
<Header>{sectionName}</Header>
<Collection items={children}>
{item => <ComboBoxItem id={item.id}>{item.role}</ComboBoxItem>}
</Collection>
</Section>
</ComboBoxSection>
);
}}
</ComboBox>
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/ComboBox/docs/ComboBoxOption/section.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { ComboBox, ComboBoxItem, Header, Section } from "@hopper-ui/components";
import { ComboBox, ComboBoxItem, ComboBoxSection, Header } from "@hopper-ui/components";

export default function Example() {
return (
<ComboBox label="Roles">
<ComboBoxItem id="developer">Developer</ComboBoxItem>
<ComboBoxItem id="manager">Manager</ComboBoxItem>
<Section>
<ComboBoxSection>
<Header>Operations</Header>
<ComboBoxItem id="project-coordinator">Project Coordinator</ComboBoxItem>
<ComboBoxItem id="qa-specialist">QA Specialist</ComboBoxItem>
</Section>
<Section>
</ComboBoxSection>
<ComboBoxSection>
<Header>Creative Department</Header>
<ComboBoxItem id="designer">Designer</ComboBoxItem>
<ComboBoxItem id="copywriter">Copywriter</ComboBoxItem>
<ComboBoxItem id="ux-researcher">UX Researcher</ComboBoxItem>
</Section>
</ComboBoxSection>
</ComboBox>
);
}
6 changes: 3 additions & 3 deletions packages/components/src/ComboBox/docs/allowCustomValue.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ComboBox, ComboBoxItem, Header, Section } from "@hopper-ui/components";
import { ComboBox, ComboBoxItem, ComboBoxSection, Header } from "@hopper-ui/components";

export default function Example() {
return (
<ComboBox allowsCustomValue label="Roles">
<Section key="1">
<ComboBoxSection key="1">
<Header>Creative Department</Header>
<ComboBoxItem id="1">Designer</ComboBoxItem>
<ComboBoxItem id="2">Content creator</ComboBoxItem>
</Section>
</ComboBoxSection>
<ComboBoxItem key="2" id="3">Manager</ComboBoxItem>
</ComboBox>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/ComboBox/docs/controlled.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComboBox, ComboBoxItem, Header, type Key, Section } from "@hopper-ui/components";
import { ComboBox, ComboBoxItem, ComboBoxSection, Header, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
Expand All @@ -14,11 +14,11 @@ export default function Example() {

return (
<ComboBox selectedKey={selectedKey} onSelectionChange={handleSelectionChange} label="Roles">
<Section key="1">
<ComboBoxSection key="1">
<Header>Operations</Header>
<ComboBoxItem id="1">Project Coordinator</ComboBoxItem>
<ComboBoxItem id="2">QA Specialist</ComboBoxItem>
</Section>
</ComboBoxSection>
<ComboBoxItem key="2" id="3">Manager</ComboBoxItem>
</ComboBox>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/ComboBox/src/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useFormProps } from "../../Form/index.ts";
import { HelperMessage } from "../../HelperMessage/index.ts";
import { Footer } from "../../layout/index.ts";
import { ListBox, ListBoxItem, type ListBoxProps, type SelectionIndicator } from "../../ListBox/index.ts";
import { ListBoxSection } from "../../ListBoxSection/index.ts";
import { Popover, type PopoverProps } from "../../overlays/index.ts";
import { ToggleArrow } from "../../ToggleArrow/index.ts";
import { Label, TextContext } from "../../typography/index.ts";
Expand Down Expand Up @@ -383,4 +384,4 @@ const _ComboBox = forwardRef(ComboBox) as <T extends object>(
) => ReturnType<typeof ComboBox>;
(_ComboBox as NamedExoticComponent).displayName = "ComboBox";

export { _ComboBox as ComboBox, ListBoxItem as ComboBoxItem };
export { _ComboBox as ComboBox, ListBoxItem as ComboBoxItem, ListBoxSection as ComboBoxSection };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, ComboBox, ComboBoxItem, type ComboBoxProps, Header, Inline, Section, Stack, Text } from "@hopper-ui/components";
import { Button, ComboBox, ComboBoxItem, type ComboBoxProps, ComboBoxSection, Header, Inline, Stack, Text } from "@hopper-ui/components";
import { AddIcon, SparklesIcon } from "@hopper-ui/icons";
import { Div } from "@hopper-ui/styled-system";
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
Expand Down Expand Up @@ -62,19 +62,19 @@ export const OnlyItems = {
export const Sections = {
render: args => (
<ComboBox {...args}>
<Section>
<ComboBoxSection>
<Header>Cats</Header>
<ComboBoxItem id="1">Zoomy</ComboBoxItem>
<ComboBoxItem id="2">Voodoo</ComboBoxItem>
<ComboBoxItem id="3">Dusty</ComboBoxItem>
<ComboBoxItem id="4">Rengar</ComboBoxItem>
</Section>
<Section>
</ComboBoxSection>
<ComboBoxSection>
<Header>Dogs</Header>
<ComboBoxItem id="5">Teemo</ComboBoxItem>
<ComboBoxItem id="6">Scooter</ComboBoxItem>
<ComboBoxItem id="7">Prince</ComboBoxItem>
</Section>
</ComboBoxSection>
</ComboBox>
),
play: playFn,
Expand Down Expand Up @@ -112,19 +112,19 @@ export const FieldHelperMessage = {
export const Footer = {
render: args => (
<ComboBox {...args}>
<Section>
<ComboBoxSection>
<Header>Cats</Header>
<ComboBoxItem id="1">Zoomy</ComboBoxItem>
<ComboBoxItem id="2">Voodoo</ComboBoxItem>
<ComboBoxItem id="3">Dusty</ComboBoxItem>
<ComboBoxItem id="4">Rengar</ComboBoxItem>
</Section>
<Section>
</ComboBoxSection>
<ComboBoxSection>
<Header>Dogs</Header>
<ComboBoxItem id="5">Teemo</ComboBoxItem>
<ComboBoxItem id="6">Scooter</ComboBoxItem>
<ComboBoxItem id="7">Prince</ComboBoxItem>
</Section>
</ComboBoxSection>
</ComboBox>
),
play: playFn,
Expand All @@ -138,19 +138,19 @@ export const Small = {
play: playFn,
render: args => (
<ComboBox {...args}>
<Section>
<ComboBoxSection>
<Header>Cats</Header>
<ComboBoxItem id="1">Zoomy</ComboBoxItem>
<ComboBoxItem id="2">Voodoo</ComboBoxItem>
<ComboBoxItem id="3">Dusty</ComboBoxItem>
<ComboBoxItem id="4">Rengar</ComboBoxItem>
</Section>
<Section>
</ComboBoxSection>
<ComboBoxSection>
<Header>Dogs</Header>
<ComboBoxItem id="5">Teemo</ComboBoxItem>
<ComboBoxItem id="6">Scooter</ComboBoxItem>
<ComboBoxItem id="7">Prince</ComboBoxItem>
</Section>
</ComboBoxSection>
</ComboBox>
),
args: {
Expand All @@ -165,19 +165,19 @@ export const Medium = {
play: playFn,
render: args => (
<ComboBox {...args}>
<Section>
<ComboBoxSection>
<Header>Cats</Header>
<ComboBoxItem id="1">Zoomy</ComboBoxItem>
<ComboBoxItem id="2">Voodoo</ComboBoxItem>
<ComboBoxItem id="3">Dusty</ComboBoxItem>
<ComboBoxItem id="4">Rengar</ComboBoxItem>
</Section>
<Section>
</ComboBoxSection>
<ComboBoxSection>
<Header>Dogs</Header>
<ComboBoxItem id="5">Teemo</ComboBoxItem>
<ComboBoxItem id="6">Scooter</ComboBoxItem>
<ComboBoxItem id="7">Prince</ComboBoxItem>
</Section>
</ComboBoxSection>
</ComboBox>
),
args: {
Expand Down
Loading

0 comments on commit 88b3779

Please sign in to comment.