Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into chore/rr-7
Browse files Browse the repository at this point in the history
  • Loading branch information
Niznikr committed Dec 9, 2024
2 parents dfd238f + 9225ca1 commit 37ad1c4
Show file tree
Hide file tree
Showing 110 changed files with 1,716 additions and 1,402 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-shirts-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@launchpad-ui/components": patch
---

Replace `Section` with `ListBoxSection` and `MenuSection`
5 changes: 0 additions & 5 deletions .changeset/moody-bobcats-hear.md

This file was deleted.

2 changes: 2 additions & 0 deletions .storybook/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Args, Decorator, ReactRenderer } from '@storybook/react';
import type { AnnotatedStoryFn, StoryContext } from '@storybook/types';
import type { JSX } from 'react';

import merge from 'deepmerge';
import { Fragment } from 'react';

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "nx run-many --target=clean --all",
"e2e:a11y": "STORYBOOK_URL=http://127.0.0.1:8080/ pnpm playwright test",
"generate": "plop",
"graph": "nx affected:graph",
"graph": "nx graph --affected",
"storybook": "pnpm build:transform && sb dev -p 3000",
"storybook:build": "pnpm build:transform && sb build --quiet",
"test": "pnpm build:transform && vitest run --coverage",
Expand Down Expand Up @@ -56,15 +56,15 @@
"@storybook/types": "^8.4.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.0",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/css-modules": "^1.0.5",
"@types/node": "^22.10.1",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.1",
"@vanilla-extract/css": "^1.16.0",
"@vanilla-extract/vite-plugin": "^4.0.2",
"@vitejs/plugin-react-swc": "^3.7.0",
"@vitejs/plugin-react-swc": "^3.7.2",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/ui": "^2.1.1",
"browserslist": "^4.24.0",
Expand All @@ -76,8 +76,8 @@
"lint-staged": "^15.2.0",
"nx": "20.0.7",
"plop": "^4.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router": "7.0.1",
"rollup-plugin-pure": "^0.2.1",
"storybook": "^8.4.0",
Expand All @@ -94,9 +94,9 @@
},
"peerDependencyRules": {
"allowedVersions": {
"react": "18",
"react": "19",
"rollup": "4",
"vite": "5"
"vite": "6"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions packages/alert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/banner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
},
"peerDependencies": {
"@vanilla-extract/css": "^1.14.0",
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"flat": "^6.0.1",
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 7 additions & 1 deletion packages/button/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { IconProps } from '@launchpad-ui/icons';
import type {
ButtonHTMLAttributes,
ElementType,
JSX,
KeyboardEventHandler,
MouseEvent,
ReactElement,
Expand Down Expand Up @@ -95,7 +96,12 @@ const ButtonComponent = forwardRef<HTMLButtonElement, ButtonProps>((props, ref)

const renderChildren = () => {
if (asChild && isValidElement(children)) {
return cloneElement(children, undefined, getFinalChildren(children.props.children));
return cloneElement(
children,
undefined,
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
getFinalChildren((children as ReactElement<any>).props.children),
);
}

return getFinalChildren(children);
Expand Down
8 changes: 4 additions & 4 deletions packages/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/card/src/RadioCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReactNode } from 'react';
import type { JSX, ReactNode } from 'react';

import { Radio, type RadioProps } from '@launchpad-ui/form';
import { cx } from 'classix';
Expand Down
6 changes: 3 additions & 3 deletions packages/card/stories/RadioCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StoryFn, StoryObj } from '@storybook/react';
import type { Meta, StoryObj } from '@storybook/react';

import { RadioCard } from '../src/RadioCard';

Expand All @@ -7,7 +7,7 @@ export default {
title: 'Legacy/Deprecated/Card/RadioCard',
description: 'A radio button with a label and optional image and subtext.',
decorators: [
(Story: StoryFn) => (
(Story) => (
<div style={{ display: 'flex', width: '15rem' }}>
<Story />
</div>
Expand All @@ -19,7 +19,7 @@ export default {
},
chromatic: { disableSnapshot: true },
},
};
} as Meta<typeof RadioCard>;

type Story = StoryObj<typeof RadioCard>;

Expand Down
8 changes: 4 additions & 4 deletions packages/chip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/clipboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/clipboard/src/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TooltipProps } from '@launchpad-ui/tooltip';
import type { ComponentPropsWithoutRef, KeyboardEventHandler } from 'react';
import type { ComponentPropsWithoutRef, JSX, KeyboardEventHandler } from 'react';

import { Icon } from '@launchpad-ui/icons';
import { Tooltip } from '@launchpad-ui/tooltip';
Expand Down
6 changes: 3 additions & 3 deletions packages/clipboard/stories/CopyToClipboard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StoryFn, StoryObj } from '@storybook/react';
import type { Meta, StoryObj } from '@storybook/react';
import type { CopyToClipboardHandleRef } from '../src/CopyToClipboard';

import { userEvent, within } from '@storybook/test';
Expand Down Expand Up @@ -29,7 +29,7 @@ export default {
},
},
decorators: [
(Story: StoryFn) => (
(Story) => (
<div
style={{
height: '100vh',
Expand All @@ -42,7 +42,7 @@ export default {
</div>
),
],
};
} as Meta<typeof CopyToClipboard>;

type Story = StoryObj<typeof CopyToClipboard>;

Expand Down
8 changes: 4 additions & 4 deletions packages/collapsible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/columns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"classix": "2.2.0"
},
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
}
}
10 changes: 10 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @launchpad-ui/components

## 0.6.1

### Patch Changes

- [#1496](https://github.com/launchdarkly/launchpad-ui/pull/1496) [`cd85be1`](https://github.com/launchdarkly/launchpad-ui/commit/cd85be144135e2586125a957714b01d71234ee41) Thanks [@Niznikr](https://github.com/Niznikr)! - Add `ToggleButtonGroup`

- [#1489](https://github.com/launchdarkly/launchpad-ui/pull/1489) [`b7083bd`](https://github.com/launchdarkly/launchpad-ui/commit/b7083bdafce29dd82069f437fe25a3245718d182) Thanks [@Niznikr](https://github.com/Niznikr)! - Add `DropZone`

- [#1504](https://github.com/launchdarkly/launchpad-ui/pull/1504) [`99df328`](https://github.com/launchdarkly/launchpad-ui/commit/99df3284c510013f963e5ba06bce4ecfe39d9cbd) Thanks [@Niznikr](https://github.com/Niznikr)! - Add `TagButton`

## 0.6.0

### Minor Changes
Expand Down
15 changes: 12 additions & 3 deletions packages/components/__tests__/Menu.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { describe, expect, it } from 'vitest';

import { render, screen, userEvent } from '../../../test/utils';
import { Button, Header, Menu, MenuItem, MenuTrigger, Popover, Section, Separator } from '../src';
import {
Button,
Header,
Menu,
MenuItem,
MenuSection,
MenuTrigger,
Popover,
Separator,
} from '../src';

describe('Menu', () => {
it('renders', async () => {
Expand All @@ -13,11 +22,11 @@ describe('Menu', () => {
<Menu>
<MenuItem>Item one</MenuItem>
<Separator />
<Section>
<MenuSection>
<Header>Section</Header>
<MenuItem>Item two</MenuItem>
<MenuItem>Item three</MenuItem>
</Section>
</MenuSection>
</Menu>
</Popover>
</MenuTrigger>,
Expand Down
17 changes: 17 additions & 0 deletions packages/components/__tests__/ToggleButtonGroup.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest';

import { render, screen } from '../../../test/utils';
import { ToggleButton, ToggleButtonGroup } from '../src';

describe('ToggleButtonGroup', () => {
it('renders', () => {
render(
<ToggleButtonGroup>
<ToggleButton id="first">First</ToggleButton>
<ToggleButton id="second">Second</ToggleButton>
<ToggleButton id="third">Third</ToggleButton>
</ToggleButtonGroup>,
);
expect(screen.getByRole('radiogroup')).toBeVisible();
});
});
Loading

0 comments on commit 37ad1c4

Please sign in to comment.