@boostdev/design-system-components 1.2.7 → 2.0.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/AGENTS.md +7 -5
- package/README.md +55 -37
- package/dist/client.cjs +54 -51
- package/dist/client.css +525 -524
- package/dist/client.d.cts +39 -3
- package/dist/client.d.ts +39 -3
- package/dist/client.js +53 -51
- package/dist/index.cjs +54 -51
- package/dist/index.css +525 -524
- package/dist/index.d.cts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +53 -51
- package/dist/native/index.cjs +3 -1
- package/dist/native/index.d.cts +11 -3
- package/dist/native/index.d.ts +11 -3
- package/dist/native/index.js +3 -1
- package/dist/web-components/{chunk-DZRSJGPB.js → chunk-3S42DZ7W.js} +1 -1
- package/dist/web-components/globals.js +1 -1
- package/dist/web-components/index.js +1 -1
- package/package.json +3 -3
- package/src/components/interaction/Button/Button.mdx +14 -4
- package/src/components/interaction/Button/Button.module.css +1 -1
- package/src/components/interaction/Button/Button.native.mdx +2 -2
- package/src/components/interaction/Button/Button.tsx +28 -0
- package/src/components/interaction/Command/Command.module.css +1 -1
- package/src/components/interaction/Dialog/Dialog.module.css +1 -1
- package/src/components/interaction/Dialog/Dialog.native.mdx +2 -2
- package/src/components/interaction/Drawer/Drawer.module.css +1 -1
- package/src/components/interaction/Drawer/Drawer.native.mdx +2 -2
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +1 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.native.mdx +2 -2
- package/src/components/interaction/Popover/Popover.module.css +1 -1
- package/src/components/interaction/Popover/Popover.native.mdx +2 -2
- package/src/components/interaction/Rating/Rating.module.css +1 -1
- package/src/components/interaction/Rating/Rating.native.mdx +1 -1
- package/src/components/interaction/Toast/Toast.module.css +1 -1
- package/src/components/interaction/Toast/Toast.native.mdx +3 -3
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.native.mdx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.native.mdx +1 -1
- package/src/components/interaction/form/Combobox/Combobox.module.css +1 -1
- package/src/components/interaction/form/Combobox/Combobox.native.mdx +1 -1
- package/src/components/interaction/form/FileInput/FileInput.module.css +1 -1
- package/src/components/interaction/form/FileInput/FileInput.native.mdx +1 -1
- package/src/components/interaction/form/FormInput/FormInput.module.css +1 -1
- package/src/components/interaction/form/FormInput/FormInput.native.mdx +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.native.mdx +1 -1
- package/src/components/interaction/form/Radio/Radio.module.css +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.module.css +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.native.mdx +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.native.mdx +1 -1
- package/src/components/interaction/form/Select/Select.module.css +1 -1
- package/src/components/interaction/form/Select/Select.native.mdx +1 -1
- package/src/components/interaction/form/Slider/Slider.module.css +1 -1
- package/src/components/interaction/form/Slider/Slider.native.mdx +1 -1
- package/src/components/interaction/form/Switch/Switch.module.css +1 -1
- package/src/components/interaction/form/Textarea/Textarea.module.css +1 -1
- package/src/components/interaction/form/Textarea/Textarea.native.mdx +1 -1
- package/src/components/interaction/form/atoms/InputContainer.module.css +1 -1
- package/src/components/interaction/form/atoms/Label.module.css +1 -1
- package/src/components/interaction/form/atoms/Message.module.css +1 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.mdx +5 -3
- package/src/components/layout/ButtonGroup/ButtonGroup.module.css +2 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.native.tsx +12 -2
- package/src/components/layout/ButtonGroup/ButtonGroup.spec.tsx +14 -5
- package/src/components/layout/ButtonGroup/ButtonGroup.stories.tsx +10 -10
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +12 -2
- package/src/components/layout/ButtonGroup/index.ts +2 -2
- package/src/components/layout/Card/Card.module.css +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.module.css +1 -1
- package/src/components/layout/SectionHeader/SectionHeader.module.css +1 -1
- package/src/components/ui/Accordion/Accordion.module.css +1 -1
- package/src/components/ui/Accordion/Accordion.native.mdx +1 -1
- package/src/components/ui/Accordion/Accordion.native.stories.tsx +1 -1
- package/src/components/ui/Alert/Alert.module.css +1 -1
- package/src/components/ui/Alert/Alert.native.mdx +1 -1
- package/src/components/ui/Avatar/Avatar.module.css +1 -1
- package/src/components/ui/Avatar/Avatar.native.mdx +1 -1
- package/src/components/ui/Badge/Badge.module.css +1 -1
- package/src/components/ui/Badge/Badge.native.mdx +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.module.css +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.native.mdx +1 -1
- package/src/components/ui/Calendar/Calendar.module.css +1 -1
- package/src/components/ui/Calendar/Calendar.native.mdx +1 -1
- package/src/components/ui/Carousel/Carousel.module.css +1 -1
- package/src/components/ui/Carousel/Carousel.native.mdx +1 -1
- package/src/components/ui/Collapsible/Collapsible.module.css +1 -1
- package/src/components/ui/Collapsible/Collapsible.native.mdx +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.module.css +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.native.mdx +1 -1
- package/src/components/ui/Link/Link.module.css +1 -1
- package/src/components/ui/Link/Link.native.mdx +1 -1
- package/src/components/ui/Loading/Loading.module.css +1 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +1 -1
- package/src/components/ui/Pagination/Pagination.module.css +1 -1
- package/src/components/ui/Pagination/Pagination.native.mdx +1 -1
- package/src/components/ui/Progress/Progress.module.css +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.module.css +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.native.mdx +1 -1
- package/src/components/ui/Separator/Separator.module.css +1 -1
- package/src/components/ui/Skeleton/Skeleton.module.css +1 -1
- package/src/components/ui/SkipLink/SkipLink.module.css +1 -1
- package/src/components/ui/Table/Table.module.css +1 -1
- package/src/components/ui/Table/Table.native.mdx +1 -1
- package/src/components/ui/Tabs/Tabs.module.css +1 -1
- package/src/components/ui/Tabs/Tabs.native.mdx +1 -1
- package/src/components/ui/Tooltip/Tooltip.module.css +1 -1
- package/src/components/ui/Tooltip/Tooltip.native.mdx +1 -1
- package/src/components/ui/Typography/Typography.module.css +1 -1
- package/src/components/ui/Typography/Typography.native.mdx +1 -1
- package/src/css/bdc.css +1 -1
- package/src/css/index.css +1 -1
- package/src/index.ts +2 -2
- package/src/native.ts +2 -2
- package/src/stories/DesignSystem/Borders.mdx +3 -3
- package/src/stories/DesignSystem/Colors.mdx +1 -1
- package/src/stories/DesignSystem/DarkMode.mdx +3 -3
- package/src/stories/DesignSystem/Overview.mdx +16 -5
- package/src/stories/DesignSystem/Typography.mdx +1 -1
- package/src/stories/Introduction.mdx +4 -4
- package/src/stories/ReactNative.mdx +6 -6
- package/src/web-components/globals.ts +1 -1
- package/src/web-components/interaction/BdsAccordion.mdx +3 -3
- package/src/web-components/interaction/BdsAccordion.stories.tsx +1 -1
- package/src/web-components/interaction/BdsButton.mdx +2 -2
- package/src/web-components/interaction/BdsCollapsible.mdx +2 -2
- package/src/web-components/interaction/BdsDialog.mdx +2 -2
- package/src/web-components/interaction/BdsDrawer.mdx +2 -2
- package/src/web-components/interaction/BdsDropdownMenu.mdx +2 -2
- package/src/web-components/interaction/BdsPopover.mdx +1 -1
- package/src/web-components/interaction/BdsSkipLink.mdx +2 -2
- package/src/web-components/interaction/BdsTabs.mdx +2 -2
- package/src/web-components/interaction/BdsToastProvider.mdx +3 -3
- package/src/web-components/interaction/BdsTooltip.mdx +2 -2
- package/src/web-components/interaction/form/BdsCheckbox.mdx +1 -1
- package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +1 -1
- package/src/web-components/interaction/form/BdsCombobox.mdx +1 -1
- package/src/web-components/interaction/form/BdsFileInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsFormInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsNumberInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsRadio.mdx +1 -1
- package/src/web-components/interaction/form/BdsRadioGroup.mdx +1 -1
- package/src/web-components/interaction/form/BdsSegmentedControl.mdx +1 -1
- package/src/web-components/interaction/form/BdsSelect.mdx +1 -1
- package/src/web-components/interaction/form/BdsSlider.mdx +1 -1
- package/src/web-components/interaction/form/BdsSwitch.mdx +1 -1
- package/src/web-components/interaction/form/BdsTextarea.mdx +1 -1
- package/src/web-components/ui/BdsAlert.mdx +1 -1
- package/src/web-components/ui/BdsAvatar.mdx +1 -1
- package/src/web-components/ui/BdsBadge.mdx +1 -1
- package/src/web-components/ui/BdsBreadcrumb.mdx +1 -1
- package/src/web-components/ui/BdsButtonGroup.mdx +1 -1
- package/src/web-components/ui/BdsCalendar.mdx +1 -1
- package/src/web-components/ui/BdsCard.mdx +1 -1
- package/src/web-components/ui/BdsCarousel.mdx +1 -1
- package/src/web-components/ui/BdsDescriptionList.mdx +1 -1
- package/src/web-components/ui/BdsIconWrapper.mdx +1 -1
- package/src/web-components/ui/BdsLink.mdx +1 -1
- package/src/web-components/ui/BdsLoading.mdx +1 -1
- package/src/web-components/ui/BdsNotificationBanner.mdx +1 -1
- package/src/web-components/ui/BdsPagination.mdx +1 -1
- package/src/web-components/ui/BdsProgress.mdx +1 -1
- package/src/web-components/ui/BdsProgressCircle.mdx +1 -1
- package/src/web-components/ui/BdsRating.mdx +1 -1
- package/src/web-components/ui/BdsSectionHeader.mdx +1 -1
- package/src/web-components/ui/BdsSeparator.mdx +2 -2
- package/src/web-components/ui/BdsSkeleton.mdx +1 -1
- package/src/web-components/ui/BdsTable.mdx +1 -1
- package/src/web-components/ui/BdsTypography.mdx +1 -1
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { StyleSheet, View, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { spacing } from '../../../native/tokens';
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface ButtonContainerProps {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
variant?: 'flow' | 'card' | 'modal' | 'content';
|
|
8
8
|
accessibilityLabel?: string;
|
|
@@ -21,7 +21,7 @@ const styles = StyleSheet.create({
|
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
export function
|
|
24
|
+
export function ButtonContainer({ children, variant, accessibilityLabel, style }: ButtonContainerProps) {
|
|
25
25
|
const isColumn = variant === 'card' || variant === 'modal';
|
|
26
26
|
return (
|
|
27
27
|
<View
|
|
@@ -32,3 +32,13 @@ export function ButtonGroup({ children, variant, accessibilityLabel, style }: Bu
|
|
|
32
32
|
</View>
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `ButtonContainer` instead. `ButtonGroup` will be removed in the next major version.
|
|
38
|
+
*/
|
|
39
|
+
export const ButtonGroup = ButtonContainer;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use `ButtonContainerProps` instead. `ButtonGroupProps` will be removed in the next major version.
|
|
43
|
+
*/
|
|
44
|
+
export type ButtonGroupProps = ButtonContainerProps;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { ButtonGroup } from './ButtonGroup';
|
|
2
|
+
import { ButtonContainer, ButtonGroup } from './ButtonGroup';
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('ButtonContainer', () => {
|
|
5
5
|
it('renders children', () => {
|
|
6
6
|
render(
|
|
7
|
-
<
|
|
7
|
+
<ButtonContainer>
|
|
8
8
|
<button>A</button>
|
|
9
9
|
<button>B</button>
|
|
10
|
-
</
|
|
10
|
+
</ButtonContainer>,
|
|
11
11
|
);
|
|
12
12
|
expect(screen.getByText('A')).toBeInTheDocument();
|
|
13
13
|
expect(screen.getByText('B')).toBeInTheDocument();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('accepts a custom className', () => {
|
|
17
|
-
const { container } = render(<
|
|
17
|
+
const { container } = render(<ButtonContainer className="custom"><button>X</button></ButtonContainer>);
|
|
18
18
|
expect(container.firstChild).toHaveClass('custom');
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
it('fills the full width of its parent', () => {
|
|
22
|
+
const { container } = render(<ButtonContainer><button>X</button></ButtonContainer>);
|
|
23
|
+
expect(container.firstChild).toHaveClass('buttonGroup');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('exports ButtonGroup as a deprecated alias', () => {
|
|
27
|
+
expect(ButtonGroup).toBe(ButtonContainer);
|
|
28
|
+
});
|
|
20
29
|
});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonContainer } from './ButtonGroup';
|
|
3
3
|
import { Button } from '../../interaction/Button';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: 'React/Layout/
|
|
7
|
-
component:
|
|
6
|
+
title: 'React/Layout/ButtonContainer',
|
|
7
|
+
component: ButtonContainer,
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: { control: 'select', options: ['flow', 'card', 'modal', 'content', undefined] },
|
|
10
10
|
},
|
|
11
|
-
} satisfies Meta<typeof
|
|
11
|
+
} satisfies Meta<typeof ButtonContainer>;
|
|
12
12
|
|
|
13
13
|
export default meta;
|
|
14
14
|
type Story = StoryObj<typeof meta>;
|
|
15
15
|
|
|
16
16
|
const TwoButtons = () => (
|
|
17
17
|
<>
|
|
18
|
-
<Button variant="
|
|
18
|
+
<Button variant="outline">Cancel</Button>
|
|
19
19
|
<Button variant="default">Confirm</Button>
|
|
20
20
|
</>
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
-
export const Default: Story = { render: () => <
|
|
24
|
-
export const Flow: Story = { render: () => <
|
|
25
|
-
export const Card: Story = { render: () => <
|
|
26
|
-
export const Modal: Story = { render: () => <
|
|
27
|
-
export const Content: Story = { render: () => <
|
|
23
|
+
export const Default: Story = { render: () => <ButtonContainer><TwoButtons /></ButtonContainer> };
|
|
24
|
+
export const Flow: Story = { render: () => <ButtonContainer variant="flow"><TwoButtons /></ButtonContainer> };
|
|
25
|
+
export const Card: Story = { render: () => <ButtonContainer variant="card"><TwoButtons /></ButtonContainer> };
|
|
26
|
+
export const Modal: Story = { render: () => <ButtonContainer variant="modal"><TwoButtons /></ButtonContainer> };
|
|
27
|
+
export const Content: Story = { render: () => <ButtonContainer variant="content"><TwoButtons /></ButtonContainer> };
|
|
@@ -3,11 +3,11 @@ import css from './ButtonGroup.module.css';
|
|
|
3
3
|
import { cn } from '@boostdev/design-system-foundation';
|
|
4
4
|
import type { WithClassName } from '../../../types';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface ButtonContainerProps extends WithClassName, HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
variant?: 'flow' | 'card' | 'modal' | 'content';
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function
|
|
10
|
+
export function ButtonContainer({ children, className, variant, ...rest }: ButtonContainerProps) {
|
|
11
11
|
return (
|
|
12
12
|
<div
|
|
13
13
|
{...rest}
|
|
@@ -18,3 +18,13 @@ export function ButtonGroup({ children, className, variant, ...rest }: ButtonGro
|
|
|
18
18
|
</div>
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `ButtonContainer` instead. `ButtonGroup` will be removed in the next major version.
|
|
24
|
+
*/
|
|
25
|
+
export const ButtonGroup = ButtonContainer;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `ButtonContainerProps` instead. `ButtonGroupProps` will be removed in the next major version.
|
|
29
|
+
*/
|
|
30
|
+
export type ButtonGroupProps = ButtonContainerProps;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ButtonGroup } from './ButtonGroup';
|
|
2
|
-
export type { ButtonGroupProps } from './ButtonGroup';
|
|
1
|
+
export { ButtonContainer, ButtonGroup } from './ButtonGroup';
|
|
2
|
+
export type { ButtonContainerProps, ButtonGroupProps } from './ButtonGroup';
|
|
@@ -17,7 +17,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
17
17
|
|
|
18
18
|
const sampleItems = [
|
|
19
19
|
{ id: '1', title: 'What is this library?', content: <Text>A design system component library built for React, React Native, and Web Components.</Text> },
|
|
20
|
-
{ id: '2', title: 'How do I install it?', content: <Text>Run pnpm add @boostdev/components to add it to your project.</Text> },
|
|
20
|
+
{ id: '2', title: 'How do I install it?', content: <Text>Run pnpm add @boostdev/design-system-components to add it to your project.</Text> },
|
|
21
21
|
{ id: '3', title: 'Is it production ready?', content: <Text>The React components are stable. React Native components are in alpha.</Text> },
|
|
22
22
|
];
|
|
23
23
|
|
|
@@ -12,7 +12,7 @@ React Native alert component for inline status messages. Supports four semantic
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Alert } from '@boostdev/components';
|
|
15
|
+
import { Alert } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Alert variant="success" title="Saved">
|
|
18
18
|
Your changes have been saved successfully.
|
|
@@ -12,7 +12,7 @@ React Native avatar component displaying user initials on a coloured background.
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Avatar } from '@boostdev/components';
|
|
15
|
+
import { Avatar } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Avatar name="John Doe" size="medium" />
|
|
18
18
|
```
|
|
@@ -12,7 +12,7 @@ React Native badge component for short status labels and counts. Five semantic v
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Badge } from '@boostdev/components';
|
|
15
|
+
import { Badge } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Badge variant="success">Active</Badge>
|
|
18
18
|
<Badge variant="error">3</Badge>
|
|
@@ -12,7 +12,7 @@ React Native calendar component for date selection. Renders a month grid with Pr
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Calendar } from '@boostdev/components';
|
|
15
|
+
import { Calendar } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Calendar
|
|
18
18
|
defaultValue={new Date(2026, 3, 15)}
|
|
@@ -12,7 +12,7 @@ React Native carousel component using a horizontally paging ScrollView with dot
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Carousel } from '@boostdev/components';
|
|
15
|
+
import { Carousel } from '@boostdev/design-system-components';
|
|
16
16
|
import { View, Text } from 'react-native';
|
|
17
17
|
|
|
18
18
|
<Carousel
|
|
@@ -12,7 +12,7 @@ React Native collapsible section with an animated chevron and smooth expand/coll
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Collapsible } from '@boostdev/components';
|
|
15
|
+
import { Collapsible } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Collapsible summary="More details">
|
|
18
18
|
<Text>Hidden content revealed on press.</Text>
|
|
@@ -12,7 +12,7 @@ React Native description list for displaying key-value pairs. Each item has a bo
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { DescriptionList } from '@boostdev/components';
|
|
15
|
+
import { DescriptionList } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<DescriptionList
|
|
18
18
|
items={[
|
|
@@ -12,7 +12,7 @@ React Native link component using `Pressable` + `Text`. Opens URLs via `Linking.
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Link } from '@boostdev/components';
|
|
15
|
+
import { Link } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Link href="https://example.com">Visit website</Link>
|
|
18
18
|
<Link onPress={() => navigation.navigate('Settings')}>Settings</Link>
|
|
@@ -12,7 +12,7 @@ React Native pagination component for navigating between pages of content. Shows
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Pagination } from '@boostdev/components';
|
|
15
|
+
import { Pagination } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Pagination
|
|
18
18
|
currentPage={3}
|
|
@@ -12,7 +12,7 @@ React Native circular progress indicator. Displays progress as a ring with an op
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { ProgressCircle } from '@boostdev/components';
|
|
15
|
+
import { ProgressCircle } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<ProgressCircle value={75} label="Upload progress" showValue />
|
|
18
18
|
<ProgressCircle value={50} label="Loading" size="large" />
|
|
@@ -12,7 +12,7 @@ React Native tooltip that appears on long press. Wraps children in a `Pressable`
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Tooltip } from '@boostdev/components';
|
|
15
|
+
import { Tooltip } from '@boostdev/design-system-components';
|
|
16
16
|
import { Text } from 'react-native';
|
|
17
17
|
|
|
18
18
|
<Tooltip content="Helpful information">
|
|
@@ -12,7 +12,7 @@ React Native typography component wrapping `Text` with semantic variants. Use in
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
|
-
import { Typography } from '@boostdev/components';
|
|
15
|
+
import { Typography } from '@boostdev/design-system-components';
|
|
16
16
|
|
|
17
17
|
<Typography variant="h1">Page title</Typography>
|
|
18
18
|
<Typography variant="body">Body copy text.</Typography>
|
package/src/css/bdc.css
CHANGED
package/src/css/index.css
CHANGED
package/src/index.ts
CHANGED
|
@@ -64,8 +64,8 @@ export { Switch } from './components/interaction/form/Switch';
|
|
|
64
64
|
export { Textarea } from './components/interaction/form/Textarea';
|
|
65
65
|
|
|
66
66
|
// Layout
|
|
67
|
-
export { ButtonGroup } from './components/layout/ButtonGroup';
|
|
68
|
-
export type { ButtonGroupProps } from './components/layout/ButtonGroup';
|
|
67
|
+
export { ButtonContainer, ButtonGroup } from './components/layout/ButtonGroup';
|
|
68
|
+
export type { ButtonContainerProps, ButtonGroupProps } from './components/layout/ButtonGroup';
|
|
69
69
|
export { Card } from './components/layout/Card';
|
|
70
70
|
export { SectionHeader } from './components/layout/SectionHeader';
|
|
71
71
|
export { IconWrapper } from './components/layout/IconWrapper';
|
package/src/native.ts
CHANGED
|
@@ -39,8 +39,8 @@ export { Card } from './components/layout/Card/Card.native';
|
|
|
39
39
|
export { SectionHeader } from './components/layout/SectionHeader/SectionHeader.native';
|
|
40
40
|
export { IconWrapper } from './components/layout/IconWrapper/IconWrapper.native';
|
|
41
41
|
export type { IconWrapperProps } from './components/layout/IconWrapper/IconWrapper.native';
|
|
42
|
-
export { ButtonGroup } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
43
|
-
export type { ButtonGroupProps } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
42
|
+
export { ButtonContainer, ButtonGroup } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
43
|
+
export type { ButtonContainerProps, ButtonGroupProps } from './components/layout/ButtonGroup/ButtonGroup.native';
|
|
44
44
|
|
|
45
45
|
// Interaction
|
|
46
46
|
export { Button } from './components/interaction/Button/Button.native';
|
|
@@ -127,7 +127,7 @@ Override a component's border colour for a specific context by reassigning `--bd
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/* Override globally via the token layer */
|
|
130
|
-
@layer tokens.override {
|
|
130
|
+
@layer boostdev.tokens.override {
|
|
131
131
|
:root {
|
|
132
132
|
--bdc_color: var(--bds-color_green);
|
|
133
133
|
}
|
|
@@ -151,8 +151,8 @@ The `bdc` tokens are included automatically when you import the component styles
|
|
|
151
151
|
|
|
152
152
|
```css
|
|
153
153
|
/* Included automatically with the full component CSS */
|
|
154
|
-
@import '@boostdev/components/css';
|
|
154
|
+
@import '@boostdev/design-system-components/css';
|
|
155
155
|
|
|
156
156
|
/* Or load the token layer standalone */
|
|
157
|
-
@import '@boostdev/components/css/bdc';
|
|
157
|
+
@import '@boostdev/design-system-components/css/bdc';
|
|
158
158
|
```
|
|
@@ -184,7 +184,7 @@ These `--bds-BASE__color--*` tokens are the primitive values. **Do not use them
|
|
|
184
184
|
Override `--bds-color_green` and `--bds-color_interactive` to change the primary action colour globally:
|
|
185
185
|
|
|
186
186
|
```css
|
|
187
|
-
@layer tokens.override {
|
|
187
|
+
@layer boostdev.tokens.override {
|
|
188
188
|
:root {
|
|
189
189
|
--bds-color_green: var(--bds-BASE__color--blue);
|
|
190
190
|
--bds-color_on-green: var(--bds-BASE__color--white);
|
|
@@ -85,20 +85,20 @@ function ThemeToggle() {
|
|
|
85
85
|
|
|
86
86
|
## Customising tokens in dark mode
|
|
87
87
|
|
|
88
|
-
Override any token in `@layer tokens.override` — the rule applies regardless of the active theme unless you scope it:
|
|
88
|
+
Override any token in `@layer boostdev.tokens.override` — the rule applies regardless of the active theme unless you scope it:
|
|
89
89
|
|
|
90
90
|
```css
|
|
91
91
|
@import "@boostdev/design-system-foundation/css";
|
|
92
92
|
|
|
93
93
|
/* override for all themes */
|
|
94
|
-
@layer tokens.override {
|
|
94
|
+
@layer boostdev.tokens.override {
|
|
95
95
|
:root {
|
|
96
96
|
--bds-color_green: oklch(60% 0.15 145);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/* override for dark mode only */
|
|
101
|
-
@layer tokens.override {
|
|
101
|
+
@layer boostdev.tokens.override {
|
|
102
102
|
[data-theme="dark"],
|
|
103
103
|
@media (prefers-color-scheme: dark) {
|
|
104
104
|
:root:not([data-theme="light"]) {
|
|
@@ -49,14 +49,25 @@ import '@boostdev/design-system-foundation/css';
|
|
|
49
49
|
|
|
50
50
|
## Layer architecture
|
|
51
51
|
|
|
52
|
-
All tokens live inside `@layer` declarations
|
|
52
|
+
All tokens live inside `@layer` declarations, all prefixed with `boostdev.` to prevent collisions
|
|
53
|
+
with consumer layers of the same name. The cascade order, from lowest to highest, is:
|
|
53
54
|
|
|
54
55
|
```
|
|
55
|
-
|
|
56
|
+
boostdev.tokens.base →
|
|
57
|
+
boostdev.tokens.semantic →
|
|
58
|
+
boostdev.tokens.deprecated →
|
|
59
|
+
boostdev.tokens.override →
|
|
60
|
+
boostdev.reset →
|
|
61
|
+
boostdev.base →
|
|
62
|
+
boostdev.utilities →
|
|
63
|
+
boostdev.components →
|
|
64
|
+
boostdev.component
|
|
56
65
|
```
|
|
57
66
|
|
|
58
|
-
`@layer component` — used by every component in this library — sits above the token layers,
|
|
59
|
-
so you can override any component from `@layer my-overrides` without
|
|
67
|
+
`@layer boostdev.component` — used by every component in this library — sits above the token layers,
|
|
68
|
+
so you can override any component from your own layer (e.g. `@layer my-overrides`) without
|
|
69
|
+
specificity fights. Anything written outside of any `@layer` is treated as an unlayered declaration,
|
|
70
|
+
which is the highest-priority in the cascade.
|
|
60
71
|
|
|
61
72
|
## Theming
|
|
62
73
|
|
|
@@ -78,7 +89,7 @@ Override any token in your own layer to retheme:
|
|
|
78
89
|
```css
|
|
79
90
|
@import "@boostdev/design-system-foundation/css";
|
|
80
91
|
|
|
81
|
-
@layer tokens.override {
|
|
92
|
+
@layer boostdev.tokens.override {
|
|
82
93
|
:root {
|
|
83
94
|
--bds-cta: var(--bds-BASE__color--blue);
|
|
84
95
|
--bds-color_on-green: var(--bds-BASE__color--white);
|