@edwardguerra/design-system 1.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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/css/main.css +132 -0
- package/dist/css/tokens.css +318 -0
- package/dist/index.cjs +31 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +1188 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/tokens/_variables.scss +296 -0
- package/dist/tokens/tokens.d.ts +338 -0
- package/dist/tokens/tokens.js +297 -0
- package/dist/tokens/tokens.json +294 -0
- package/dist/tokens/variables.css +318 -0
- package/dist/types/components/Accordion/Accordion.d.ts +30 -0
- package/dist/types/components/Accordion/Accordion.stories.d.ts +15 -0
- package/dist/types/components/Accordion/Accordion.test.d.ts +1 -0
- package/dist/types/components/Accordion/index.d.ts +2 -0
- package/dist/types/components/Article/Article.d.ts +21 -0
- package/dist/types/components/Article/Article.stories.d.ts +13 -0
- package/dist/types/components/Article/Article.test.d.ts +1 -0
- package/dist/types/components/Article/index.d.ts +2 -0
- package/dist/types/components/Badge/Badge.d.ts +20 -0
- package/dist/types/components/Badge/Badge.stories.d.ts +20 -0
- package/dist/types/components/Badge/Badge.test.d.ts +1 -0
- package/dist/types/components/Badge/index.d.ts +2 -0
- package/dist/types/components/Button/Button.d.ts +49 -0
- package/dist/types/components/Button/Button.stories.d.ts +43 -0
- package/dist/types/components/Button/Button.test.d.ts +1 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Card/Card.d.ts +43 -0
- package/dist/types/components/Card/Card.stories.d.ts +31 -0
- package/dist/types/components/Card/Card.test.d.ts +1 -0
- package/dist/types/components/Card/index.d.ts +2 -0
- package/dist/types/components/Carousel/Carousel.d.ts +27 -0
- package/dist/types/components/Carousel/Carousel.stories.d.ts +12 -0
- package/dist/types/components/Carousel/Carousel.test.d.ts +1 -0
- package/dist/types/components/Carousel/index.d.ts +2 -0
- package/dist/types/components/DescriptionList/DescriptionList.d.ts +31 -0
- package/dist/types/components/DescriptionList/DescriptionList.stories.d.ts +12 -0
- package/dist/types/components/DescriptionList/DescriptionList.test.d.ts +1 -0
- package/dist/types/components/DescriptionList/index.d.ts +2 -0
- package/dist/types/components/Feature/Feature.d.ts +25 -0
- package/dist/types/components/Feature/Feature.stories.d.ts +19 -0
- package/dist/types/components/Feature/Feature.test.d.ts +1 -0
- package/dist/types/components/Feature/index.d.ts +2 -0
- package/dist/types/components/Icon/Icon.d.ts +24 -0
- package/dist/types/components/Icon/Icon.stories.d.ts +21 -0
- package/dist/types/components/Icon/Icon.test.d.ts +1 -0
- package/dist/types/components/Icon/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +40 -0
- package/dist/types/components/Input/Input.stories.d.ts +30 -0
- package/dist/types/components/Input/Input.test.d.ts +1 -0
- package/dist/types/components/Input/index.d.ts +2 -0
- package/dist/types/components/Link/Link.d.ts +45 -0
- package/dist/types/components/Link/Link.stories.d.ts +19 -0
- package/dist/types/components/Link/Link.test.d.ts +1 -0
- package/dist/types/components/Link/index.d.ts +2 -0
- package/dist/types/components/List/List.d.ts +35 -0
- package/dist/types/components/List/List.stories.d.ts +14 -0
- package/dist/types/components/List/List.test.d.ts +1 -0
- package/dist/types/components/List/index.d.ts +2 -0
- package/dist/types/components/Menu/Menu.d.ts +44 -0
- package/dist/types/components/Menu/Menu.stories.d.ts +19 -0
- package/dist/types/components/Menu/Menu.test.d.ts +1 -0
- package/dist/types/components/Menu/index.d.ts +2 -0
- package/dist/types/components/Modal/Modal.d.ts +44 -0
- package/dist/types/components/Modal/Modal.stories.d.ts +26 -0
- package/dist/types/components/Modal/Modal.test.d.ts +1 -0
- package/dist/types/components/Modal/index.d.ts +2 -0
- package/dist/types/components/Nav/Nav.d.ts +43 -0
- package/dist/types/components/Nav/Nav.stories.d.ts +19 -0
- package/dist/types/components/Nav/Nav.test.d.ts +1 -0
- package/dist/types/components/Nav/index.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +36 -0
- package/dist/types/components/Pagination/Pagination.stories.d.ts +15 -0
- package/dist/types/components/Pagination/Pagination.test.d.ts +1 -0
- package/dist/types/components/Pagination/index.d.ts +2 -0
- package/dist/types/components/Radio/Radio.d.ts +30 -0
- package/dist/types/components/Radio/Radio.stories.d.ts +15 -0
- package/dist/types/components/Radio/Radio.test.d.ts +1 -0
- package/dist/types/components/Radio/index.d.ts +2 -0
- package/dist/types/components/Slider/Slider.d.ts +44 -0
- package/dist/types/components/Slider/Slider.stories.d.ts +14 -0
- package/dist/types/components/Slider/Slider.test.d.ts +1 -0
- package/dist/types/components/Slider/index.d.ts +2 -0
- package/dist/types/components/Switch/Switch.d.ts +29 -0
- package/dist/types/components/Switch/Switch.stories.d.ts +16 -0
- package/dist/types/components/Switch/Switch.test.d.ts +1 -0
- package/dist/types/components/Switch/index.d.ts +2 -0
- package/dist/types/components/TOC/TOC.d.ts +37 -0
- package/dist/types/components/TOC/TOC.stories.d.ts +17 -0
- package/dist/types/components/TOC/TOC.test.d.ts +1 -0
- package/dist/types/components/TOC/index.d.ts +2 -0
- package/dist/types/components/Table/Table.d.ts +34 -0
- package/dist/types/components/Table/Table.stories.d.ts +13 -0
- package/dist/types/components/Table/Table.test.d.ts +1 -0
- package/dist/types/components/Table/index.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs.d.ts +26 -0
- package/dist/types/components/Tabs/Tabs.stories.d.ts +14 -0
- package/dist/types/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/types/components/Tabs/index.d.ts +2 -0
- package/dist/types/components/ThemeProvider/ThemeContext.d.ts +8 -0
- package/dist/types/components/ThemeProvider/ThemeProvider.d.ts +9 -0
- package/dist/types/components/ThemeProvider/ThemeProvider.stories.d.ts +17 -0
- package/dist/types/components/ThemeProvider/ThemeProvider.test.d.ts +1 -0
- package/dist/types/components/ThemeProvider/ThemeSwitcher.d.ts +13 -0
- package/dist/types/components/ThemeProvider/index.d.ts +6 -0
- package/dist/types/components/Timeline/Timeline.d.ts +31 -0
- package/dist/types/components/Timeline/Timeline.stories.d.ts +12 -0
- package/dist/types/components/Timeline/Timeline.test.d.ts +1 -0
- package/dist/types/components/Timeline/index.d.ts +2 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +25 -0
- package/dist/types/components/Tooltip/Tooltip.stories.d.ts +26 -0
- package/dist/types/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/types/components/Tooltip/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +25 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/test/setup.d.ts +1 -0
- package/package.json +85 -0
- package/tokens/brands/edward-guerra.json +9 -0
- package/tokens/brands/materialandhome.json +9 -0
- package/tokens/brands/midwest-husbands.json +9 -0
- package/tokens/config.json +45 -0
- package/tokens/core/breakpoints.json +9 -0
- package/tokens/core/colors.json +217 -0
- package/tokens/core/effects.json +37 -0
- package/tokens/core/spacing.json +24 -0
- package/tokens/core/typography.json +45 -0
- package/tokens/semantic/button.json +37 -0
- package/tokens/semantic/theme.json +26 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Radio.css';
|
|
3
|
+
export interface RadioOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface RadioProps {
|
|
9
|
+
/**
|
|
10
|
+
* Radio group name
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Available radio options
|
|
15
|
+
*/
|
|
16
|
+
options: RadioOption[];
|
|
17
|
+
/**
|
|
18
|
+
* Selected value
|
|
19
|
+
*/
|
|
20
|
+
value?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Callback when selection changes
|
|
23
|
+
*/
|
|
24
|
+
onChange?: (value: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS class
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const Radio: React.FC<RadioProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Radio").RadioProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const WithSelection: Story;
|
|
14
|
+
export declare const WithDisabled: Story;
|
|
15
|
+
export declare const YesNo: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Slider.css';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
/**
|
|
5
|
+
* Minimum value
|
|
6
|
+
*/
|
|
7
|
+
min?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Maximum value
|
|
10
|
+
*/
|
|
11
|
+
max?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Step increment
|
|
14
|
+
*/
|
|
15
|
+
step?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Current value
|
|
18
|
+
*/
|
|
19
|
+
value: number;
|
|
20
|
+
/**
|
|
21
|
+
* Callback when the value changes
|
|
22
|
+
*/
|
|
23
|
+
onChange: (value: number) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Number of evenly-spaced tick marks to render below the track
|
|
26
|
+
*/
|
|
27
|
+
ticks?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Label for the slider
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* ID for the input element
|
|
34
|
+
*/
|
|
35
|
+
id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Additional CSS class
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Slider renders a styled range input with optional tick marks
|
|
43
|
+
*/
|
|
44
|
+
export declare const Slider: React.FC<SliderProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Slider").SliderProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const WithLabel: Story;
|
|
14
|
+
export declare const WithTicks: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Switch.css';
|
|
3
|
+
export interface SwitchProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the switch is checked
|
|
6
|
+
*/
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Callback when switch state changes
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (checked: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the switch is disabled
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Label for the switch
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* ID for the input element
|
|
22
|
+
*/
|
|
23
|
+
id?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Additional CSS class
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const Switch: React.FC<SwitchProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Switch").SwitchProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Checked: Story;
|
|
14
|
+
export declare const Disabled: Story;
|
|
15
|
+
export declare const DisabledChecked: Story;
|
|
16
|
+
export declare const WithoutLabel: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './TOC.css';
|
|
3
|
+
export interface TOCProps {
|
|
4
|
+
/**
|
|
5
|
+
* TOCItem elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TOCItemProps {
|
|
14
|
+
/**
|
|
15
|
+
* Anchor target
|
|
16
|
+
*/
|
|
17
|
+
href: string;
|
|
18
|
+
/**
|
|
19
|
+
* Item label
|
|
20
|
+
*/
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Marks this item as the currently active section
|
|
24
|
+
*/
|
|
25
|
+
active?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS class
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* TOC renders a sticky table-of-contents list with a vertical rail.
|
|
33
|
+
* Active-section highlighting is CSS-only (the `active` prop) — scroll-spy
|
|
34
|
+
* tracking is left to the consumer.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TOC: React.FC<TOCProps>;
|
|
37
|
+
export declare const TOCItem: React.FC<TOCItemProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./TOC").TOCProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Table.css';
|
|
3
|
+
export interface TableProps {
|
|
4
|
+
/**
|
|
5
|
+
* thead/tbody content
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Splits each row into equal-width quarter columns, center-aligning
|
|
10
|
+
* the first column's content
|
|
11
|
+
*/
|
|
12
|
+
quarters?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const Table: React.FC<TableProps>;
|
|
19
|
+
export interface TableRowProps {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const TableRow: React.FC<TableRowProps>;
|
|
24
|
+
export interface TableHeaderCellProps {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
scope?: 'col' | 'row';
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const TableHeaderCell: React.FC<TableHeaderCellProps>;
|
|
30
|
+
export interface TableCellProps {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const TableCell: React.FC<TableCellProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Table").TableProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Quarters: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Tabs.css';
|
|
3
|
+
export interface Tab {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface TabsProps {
|
|
9
|
+
/**
|
|
10
|
+
* Array of tab items
|
|
11
|
+
*/
|
|
12
|
+
tabs: Tab[];
|
|
13
|
+
/**
|
|
14
|
+
* Default active tab ID
|
|
15
|
+
*/
|
|
16
|
+
defaultActiveId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Callback when tab changes
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (tabId: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Additional CSS class
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const Tabs: React.FC<TabsProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Tabs").TabsProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const ManyTabs: Story;
|
|
14
|
+
export declare const DefaultActive: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Theme = 'eg' | 'materialandhome' | 'midwest-husbands';
|
|
2
|
+
interface ThemeContextType {
|
|
3
|
+
theme: Theme;
|
|
4
|
+
setTheme: (theme: Theme) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ThemeContext: import("react").Context<ThemeContextType | undefined>;
|
|
7
|
+
export declare const useTheme: () => ThemeContextType;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Theme } from './ThemeContext';
|
|
3
|
+
export type { Theme };
|
|
4
|
+
export interface ThemeProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
defaultTheme?: Theme;
|
|
7
|
+
forceTheme?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./ThemeProvider").ThemeProviderProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const ComponentShowcase: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ThemeSwitcher.css';
|
|
3
|
+
export interface ThemeSwitcherProps {
|
|
4
|
+
/**
|
|
5
|
+
* Display as slider, buttons, or dropdown
|
|
6
|
+
*/
|
|
7
|
+
variant?: 'slider' | 'buttons' | 'dropdown';
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThemeSwitcher: React.FC<ThemeSwitcherProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ThemeProvider } from './ThemeProvider';
|
|
2
|
+
export type { ThemeProviderProps } from './ThemeProvider';
|
|
3
|
+
export { useTheme } from './ThemeContext';
|
|
4
|
+
export type { Theme } from './ThemeContext';
|
|
5
|
+
export { ThemeSwitcher } from './ThemeSwitcher';
|
|
6
|
+
export type { ThemeSwitcherProps } from './ThemeSwitcher';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Timeline.css';
|
|
3
|
+
export interface TimelineProps {
|
|
4
|
+
/**
|
|
5
|
+
* TimelineItem elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TimelineItemProps {
|
|
14
|
+
/**
|
|
15
|
+
* Item content
|
|
16
|
+
*/
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Optional timestamp shown to the right
|
|
20
|
+
*/
|
|
21
|
+
timestamp?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS class
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Timeline renders a vertical list of connected events
|
|
29
|
+
*/
|
|
30
|
+
export declare const Timeline: React.FC<TimelineProps>;
|
|
31
|
+
export declare const TimelineItem: React.FC<TimelineItemProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Timeline").TimelineProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Tooltip.css';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tooltip text
|
|
6
|
+
*/
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Element that triggers the tooltip on hover/focus
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactElement;
|
|
12
|
+
/**
|
|
13
|
+
* Which side of the trigger the tooltip appears on
|
|
14
|
+
*/
|
|
15
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
16
|
+
/**
|
|
17
|
+
* Additional CSS class
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Tooltip component. Not present on any live site yet — a minimal,
|
|
23
|
+
* CSS-only implementation consistent with the rest of the token system.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import("./Tooltip").TooltipProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
argTypes: {
|
|
15
|
+
position: {
|
|
16
|
+
control: string;
|
|
17
|
+
options: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
export declare const Top: Story;
|
|
24
|
+
export declare const Bottom: Story;
|
|
25
|
+
export declare const Left: Story;
|
|
26
|
+
export declare const Right: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './Button';
|
|
2
|
+
export * from './Card';
|
|
3
|
+
export * from './Input';
|
|
4
|
+
export * from './Badge';
|
|
5
|
+
export * from './Modal';
|
|
6
|
+
export * from './Tabs';
|
|
7
|
+
export * from './Accordion';
|
|
8
|
+
export * from './Switch';
|
|
9
|
+
export * from './Radio';
|
|
10
|
+
export * from './ThemeProvider';
|
|
11
|
+
export * from './Pagination';
|
|
12
|
+
export * from './Icon';
|
|
13
|
+
export * from './Tooltip';
|
|
14
|
+
export * from './DescriptionList';
|
|
15
|
+
export * from './Timeline';
|
|
16
|
+
export * from './Carousel';
|
|
17
|
+
export * from './List';
|
|
18
|
+
export * from './Nav';
|
|
19
|
+
export * from './Article';
|
|
20
|
+
export * from './Feature';
|
|
21
|
+
export * from './TOC';
|
|
22
|
+
export * from './Slider';
|
|
23
|
+
export * from './Table';
|
|
24
|
+
export * from './Menu';
|
|
25
|
+
export * from './Link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edwardguerra/design-system",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Design tokens and React components shared across Edward Guerra, Material and Home, and Midwest Husbands",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./tokens.css": "./dist/css/tokens.css",
|
|
15
|
+
"./brand-themes.css": "./dist/css/main.css",
|
|
16
|
+
"./components.css": "./dist/style.css",
|
|
17
|
+
"./dist/*": "./dist/*",
|
|
18
|
+
"./tokens/*": "./tokens/*"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"tokens",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "npm run build:tokens && npm run build:css && npm run build:components && npm run build:types",
|
|
27
|
+
"build:tokens": "node scripts/build-tokens.js",
|
|
28
|
+
"build:css": "sass src/styles:dist/css --no-source-map",
|
|
29
|
+
"build:components": "tsc && vite build",
|
|
30
|
+
"build:types": "tsc --noEmit false --emitDeclarationOnly --declarationMap false --outDir dist/types",
|
|
31
|
+
"prepublishOnly": "npm run build && npm run test -- --run",
|
|
32
|
+
"dev": "vite",
|
|
33
|
+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
34
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,json,css,scss}\"",
|
|
35
|
+
"test": "vitest",
|
|
36
|
+
"storybook": "storybook dev -p 6006",
|
|
37
|
+
"build-storybook": "storybook build"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/edwardguerra/design-system.git"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"design-system",
|
|
45
|
+
"components",
|
|
46
|
+
"ui",
|
|
47
|
+
"tokens"
|
|
48
|
+
],
|
|
49
|
+
"author": "Edward Guerra",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@storybook/addon-essentials": "^7.6.0",
|
|
53
|
+
"@storybook/addon-interactions": "^7.6.0",
|
|
54
|
+
"@storybook/addon-links": "^7.6.0",
|
|
55
|
+
"@storybook/blocks": "^7.6.0",
|
|
56
|
+
"@storybook/react": "^7.6.0",
|
|
57
|
+
"@storybook/react-vite": "^7.6.0",
|
|
58
|
+
"@storybook/testing-library": "^0.2.2",
|
|
59
|
+
"@testing-library/jest-dom": "^6.1.5",
|
|
60
|
+
"@testing-library/react": "^14.1.2",
|
|
61
|
+
"@testing-library/user-event": "^14.5.1",
|
|
62
|
+
"@types/react": "^18.2.43",
|
|
63
|
+
"@types/react-dom": "^18.2.17",
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
65
|
+
"@typescript-eslint/parser": "^6.14.0",
|
|
66
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
67
|
+
"eslint": "^8.55.0",
|
|
68
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
69
|
+
"eslint-plugin-react-refresh": "^0.4.5",
|
|
70
|
+
"jsdom": "^23.0.1",
|
|
71
|
+
"prettier": "^3.1.1",
|
|
72
|
+
"react": "^18.2.0",
|
|
73
|
+
"react-dom": "^18.2.0",
|
|
74
|
+
"sass": "^1.69.5",
|
|
75
|
+
"storybook": "^7.6.0",
|
|
76
|
+
"style-dictionary": "^3.9.0",
|
|
77
|
+
"typescript": "^5.2.2",
|
|
78
|
+
"vite": "^5.0.8",
|
|
79
|
+
"vitest": "^1.0.4"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"react": "^18.0.0",
|
|
83
|
+
"react-dom": "^18.0.0"
|
|
84
|
+
}
|
|
85
|
+
}
|