@oscarrf2/goo-ds 0.1.0 → 0.1.2
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/CHANGELOG.md +96 -0
- package/dist/assets/index.css +1 -0
- package/dist/components/Button/Button.js +60 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Cell/Cell.js +28 -0
- package/dist/components/Cell/Cell.js.map +1 -0
- package/dist/components/Codeblock/Codeblock.js +51 -0
- package/dist/components/Codeblock/Codeblock.js.map +1 -0
- package/dist/components/CoreText/CoreText.js +26 -0
- package/dist/components/CoreText/CoreText.js.map +1 -0
- package/dist/components/Divider/Divider.js +25 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/InputImage/InputImage.js +284 -0
- package/dist/components/InputImage/InputImage.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.js +27 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/SidebarItem/SidebarItem.js +37 -0
- package/dist/components/SidebarItem/SidebarItem.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +30 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Spacer/Spacer.js +21 -0
- package/dist/components/Spacer/Spacer.js.map +1 -0
- package/dist/components/TabItem/TabItem.js +33 -0
- package/dist/components/TabItem/TabItem.js.map +1 -0
- package/dist/components/Table/Table.js +18 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/TableRow/TableRow.js +35 -0
- package/dist/components/TableRow/TableRow.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +23 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +17 -0
- package/dist/vite.svg +1 -0
- package/package.json +19 -19
- package/src/components/Button/Button.tsx +0 -82
- package/src/components/Button/Button.types.ts +0 -62
- package/src/components/Button/index.ts +0 -3
- package/src/components/Cell/Cell.tsx +0 -42
- package/src/components/Cell/Cell.types.ts +0 -42
- package/src/components/Cell/index.ts +0 -3
- package/src/components/Codeblock/Codeblock.tsx +0 -88
- package/src/components/Codeblock/Codeblock.types.ts +0 -42
- package/src/components/Codeblock/index.ts +0 -3
- package/src/components/CoreText/CoreText.tsx +0 -43
- package/src/components/CoreText/CoreText.types.ts +0 -56
- package/src/components/CoreText/index.ts +0 -2
- package/src/components/Divider/Divider.tsx +0 -35
- package/src/components/Divider/Divider.types.ts +0 -19
- package/src/components/Divider/index.ts +0 -3
- package/src/components/InputImage/InputImage.tsx +0 -314
- package/src/components/InputImage/InputImage.types.ts +0 -86
- package/src/components/InputImage/index.ts +0 -2
- package/src/components/Sidebar/Sidebar.tsx +0 -42
- package/src/components/Sidebar/Sidebar.types.ts +0 -24
- package/src/components/Sidebar/index.ts +0 -3
- package/src/components/SidebarItem/SidebarItem.tsx +0 -55
- package/src/components/SidebarItem/SidebarItem.types.ts +0 -39
- package/src/components/SidebarItem/index.ts +0 -3
- package/src/components/Skeleton/Skeleton.tsx +0 -41
- package/src/components/Skeleton/Skeleton.types.ts +0 -65
- package/src/components/Skeleton/index.ts +0 -5
- package/src/components/Spacer/Spacer.tsx +0 -31
- package/src/components/Spacer/Spacer.types.ts +0 -58
- package/src/components/Spacer/index.ts +0 -3
- package/src/components/TabItem/TabItem.tsx +0 -45
- package/src/components/TabItem/TabItem.types.ts +0 -35
- package/src/components/TabItem/index.ts +0 -3
- package/src/components/Table/Table.tsx +0 -39
- package/src/components/Table/Table.types.ts +0 -18
- package/src/components/Table/index.ts +0 -3
- package/src/components/TableRow/TableRow.tsx +0 -53
- package/src/components/TableRow/TableRow.types.ts +0 -41
- package/src/components/TableRow/index.ts +0 -3
- package/src/components/Tabs/Tabs.tsx +0 -37
- package/src/components/Tabs/Tabs.types.ts +0 -18
- package/src/components/Tabs/index.ts +0 -3
- package/src/components/index.ts +0 -15
- package/src/compositions/index.ts +0 -3
- package/src/index.ts +0 -4
- package/src/styles.css +0 -2
- /package/{src → dist}/components/Button/Button.css +0 -0
- /package/{src → dist}/components/Cell/Cell.css +0 -0
- /package/{src → dist}/components/Codeblock/Codeblock.css +0 -0
- /package/{src → dist}/components/Divider/Divider.css +0 -0
- /package/{src → dist}/components/InputImage/InputImage.css +0 -0
- /package/{src → dist}/components/Sidebar/Sidebar.css +0 -0
- /package/{src → dist}/components/SidebarItem/SidebarItem.css +0 -0
- /package/{src → dist}/components/Skeleton/Skeleton.css +0 -0
- /package/{src → dist}/components/TabItem/TabItem.css +0 -0
- /package/{src → dist}/components/Table/Table.css +0 -0
- /package/{src → dist}/components/TableRow/TableRow.css +0 -0
- /package/{src → dist}/components/Tabs/Tabs.css +0 -0
- /package/{src → dist}/index.css +0 -0
- /package/{src → dist}/styles/component-tokens.css +0 -0
- /package/{src → dist}/styles/component-tokens.current.css +0 -0
- /package/{src → dist}/styles/fonts.css +0 -0
- /package/{src → dist}/styles/global-tokens.css +0 -0
- /package/{src → dist}/styles/index.css +0 -0
- /package/{src → dist}/styles/number-tokens.css +0 -0
- /package/{src → dist}/styles/semantic-tokens.css +0 -0
- /package/{src → dist}/styles/style-tokens.css +0 -0
- /package/{src → dist}/styles/typography-tokens.css +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* InputImage component props
|
|
5
|
-
* Provides image upload input with drag-and-drop, multiple states, and comparison slider
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type InputImageState =
|
|
9
|
-
| "Default"
|
|
10
|
-
| "Hover"
|
|
11
|
-
| "Filled"
|
|
12
|
-
| "Generating"
|
|
13
|
-
| "Generated"
|
|
14
|
-
| "Loading"
|
|
15
|
-
| "Disabled";
|
|
16
|
-
|
|
17
|
-
export interface InputImageProps {
|
|
18
|
-
/**
|
|
19
|
-
* The current state of the input
|
|
20
|
-
* @default "Default"
|
|
21
|
-
*/
|
|
22
|
-
state?: InputImageState;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Whether to show the comparison slider in Generated state
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
comparisonSlider?: boolean;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Position of the comparison slider (0-100 percentage)
|
|
32
|
-
* @default 50
|
|
33
|
-
*/
|
|
34
|
-
sliderPosition?: number;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Callback when slider is being dragged
|
|
38
|
-
*/
|
|
39
|
-
onSliderDrag?: (position: number) => void;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The image source URL for Filled, Generating, and Generated states
|
|
43
|
-
*/
|
|
44
|
-
imageSrc?: string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Alt text for the image
|
|
48
|
-
* @default ""
|
|
49
|
-
*/
|
|
50
|
-
imageAlt?: string;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Callback when the upload button is clicked
|
|
54
|
-
*/
|
|
55
|
-
onUploadClick?: () => void;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Callback when the remove/close button is clicked (in Filled state)
|
|
59
|
-
*/
|
|
60
|
-
onRemoveClick?: () => void;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Callback when drag enter occurs
|
|
64
|
-
*/
|
|
65
|
-
onDragEnter?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Callback when drag leave occurs
|
|
69
|
-
*/
|
|
70
|
-
onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Callback when drop occurs
|
|
74
|
-
*/
|
|
75
|
-
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Additional CSS class names
|
|
79
|
-
*/
|
|
80
|
-
className?: string;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Custom children to replace default content (advanced use case)
|
|
84
|
-
*/
|
|
85
|
-
children?: ReactNode;
|
|
86
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { SidebarProps } from "./Sidebar.types";
|
|
2
|
-
import "./Sidebar.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Sidebar - Sidebar container component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent sidebar layout with proper spacing and background.
|
|
8
|
-
* Designed to contain SidebarItem components, titles, and other navigation elements.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Sidebar>
|
|
14
|
-
* <CoreText style="headline-xs-bold">Navigation</CoreText>
|
|
15
|
-
* <Spacer size="16" />
|
|
16
|
-
* <SidebarItem icon={<HomeIcon />}>Home</SidebarItem>
|
|
17
|
-
* <SidebarItem icon={<SettingsIcon />}>Settings</SidebarItem>
|
|
18
|
-
* </Sidebar>
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export function Sidebar({
|
|
22
|
-
children,
|
|
23
|
-
showDivider = true,
|
|
24
|
-
className = "",
|
|
25
|
-
...props
|
|
26
|
-
}: SidebarProps) {
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
className={`gds-sidebar ${className}`.trim()}
|
|
30
|
-
data-component="Sidebar"
|
|
31
|
-
data-show-divider={showDivider}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
<div className="gds-sidebar-content">
|
|
35
|
-
{children}
|
|
36
|
-
</div>
|
|
37
|
-
{showDivider && <div className="gds-sidebar-divider" aria-hidden="true" />}
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default Sidebar;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Sidebar component props
|
|
5
|
-
* Provides sidebar container using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Sidebar content (typically title, SidebarItem components, etc.)
|
|
11
|
-
*/
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Whether to show the divider on the right edge
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
showDivider?: boolean;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Additional CSS class names
|
|
22
|
-
*/
|
|
23
|
-
className?: string;
|
|
24
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { SidebarItemProps } from "./SidebarItem.types";
|
|
2
|
-
import "./SidebarItem.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* SidebarItem - Sidebar navigation item component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent sidebar navigation item with interactive states.
|
|
8
|
-
* Supports icons and active state indication.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <SidebarItem>Dashboard</SidebarItem>
|
|
14
|
-
* <SidebarItem active icon={<HomeIcon />}>Home</SidebarItem>
|
|
15
|
-
* <SidebarItem onClick={() => navigate('/settings')}>Settings</SidebarItem>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export function SidebarItem({
|
|
19
|
-
active = false,
|
|
20
|
-
icon,
|
|
21
|
-
children,
|
|
22
|
-
className = "",
|
|
23
|
-
onClick,
|
|
24
|
-
href,
|
|
25
|
-
...props
|
|
26
|
-
}: SidebarItemProps) {
|
|
27
|
-
const isInteractive = Boolean(onClick || href);
|
|
28
|
-
|
|
29
|
-
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
30
|
-
if (onClick) {
|
|
31
|
-
onClick(event);
|
|
32
|
-
}
|
|
33
|
-
if (href && !onClick) {
|
|
34
|
-
window.location.href = href;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div
|
|
40
|
-
className={`gds-sidebar-item ${active ? "gds-sidebar-item-active" : ""} ${isInteractive ? "gds-sidebar-item-interactive" : ""} ${className}`.trim()}
|
|
41
|
-
onClick={isInteractive ? handleClick : undefined}
|
|
42
|
-
role={isInteractive ? "button" : undefined}
|
|
43
|
-
tabIndex={isInteractive ? 0 : undefined}
|
|
44
|
-
aria-current={active ? "page" : undefined}
|
|
45
|
-
data-component="SidebarItem"
|
|
46
|
-
data-active={active}
|
|
47
|
-
{...props}
|
|
48
|
-
>
|
|
49
|
-
{icon && <span className="gds-sidebar-item-icon">{icon}</span>}
|
|
50
|
-
<span className="gds-sidebar-item-text">{children}</span>
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default SidebarItem;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SidebarItem component props
|
|
5
|
-
* Provides sidebar navigation items using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface SidebarItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Whether the item is currently active/selected
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
active?: boolean;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Icon to display before the text
|
|
17
|
-
*/
|
|
18
|
-
icon?: ReactNode;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Item content (text or other elements)
|
|
22
|
-
*/
|
|
23
|
-
children?: ReactNode;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Additional CSS class names
|
|
27
|
-
*/
|
|
28
|
-
className?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Click handler for navigation
|
|
32
|
-
*/
|
|
33
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* href for link behavior (optional)
|
|
37
|
-
*/
|
|
38
|
-
href?: string;
|
|
39
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { SkeletonProps } from "./Skeleton.types";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Skeleton - Loading state placeholder component for the goo-ds design system
|
|
5
|
-
*
|
|
6
|
-
* Provides consistent loading state placeholders using design system tokens.
|
|
7
|
-
* Includes a pulse animation to indicate loading state.
|
|
8
|
-
* Token-first per Constitution (no hardcoded values).
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <Skeleton size="16" />
|
|
13
|
-
* <Skeleton size="48" width="200px" />
|
|
14
|
-
* <Skeleton size="64" animate={false} />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export function Skeleton({
|
|
18
|
-
size = "16",
|
|
19
|
-
className = "",
|
|
20
|
-
width = "100%",
|
|
21
|
-
animate = true,
|
|
22
|
-
...props
|
|
23
|
-
}: SkeletonProps) {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
className={`${animate ? "skeleton-pulse" : ""} ${className}`.trim()}
|
|
27
|
-
style={{
|
|
28
|
-
height: `var(--size-${size})`,
|
|
29
|
-
width: width,
|
|
30
|
-
backgroundColor: "var(--skeleton-background-default)",
|
|
31
|
-
borderRadius: "var(--radius-50)",
|
|
32
|
-
overflow: "clip",
|
|
33
|
-
}}
|
|
34
|
-
aria-hidden={props["aria-hidden"] !== false}
|
|
35
|
-
data-component="Skeleton"
|
|
36
|
-
data-size={size}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default Skeleton;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skeleton component props
|
|
3
|
-
* Provides loading state placeholders using design system tokens
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type SkeletonSize =
|
|
7
|
-
| "1"
|
|
8
|
-
| "2"
|
|
9
|
-
| "4"
|
|
10
|
-
| "6"
|
|
11
|
-
| "8"
|
|
12
|
-
| "12"
|
|
13
|
-
| "16"
|
|
14
|
-
| "20"
|
|
15
|
-
| "24"
|
|
16
|
-
| "28"
|
|
17
|
-
| "32"
|
|
18
|
-
| "36"
|
|
19
|
-
| "40"
|
|
20
|
-
| "44"
|
|
21
|
-
| "48"
|
|
22
|
-
| "56"
|
|
23
|
-
| "64"
|
|
24
|
-
| "80"
|
|
25
|
-
| "96"
|
|
26
|
-
| "112"
|
|
27
|
-
| "128"
|
|
28
|
-
| "144"
|
|
29
|
-
| "160"
|
|
30
|
-
| "176"
|
|
31
|
-
| "192"
|
|
32
|
-
| "208"
|
|
33
|
-
| "224"
|
|
34
|
-
| "240"
|
|
35
|
-
| "256";
|
|
36
|
-
|
|
37
|
-
export interface SkeletonProps {
|
|
38
|
-
/**
|
|
39
|
-
* The height of the skeleton, corresponding to number tokens (--size-X)
|
|
40
|
-
* @default "16"
|
|
41
|
-
*/
|
|
42
|
-
size?: SkeletonSize;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Additional CSS class names
|
|
46
|
-
*/
|
|
47
|
-
className?: string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Width of the skeleton (CSS value or percentage)
|
|
51
|
-
* @default "100%"
|
|
52
|
-
*/
|
|
53
|
-
width?: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Whether to animate the skeleton with a pulse effect
|
|
57
|
-
* @default true
|
|
58
|
-
*/
|
|
59
|
-
animate?: boolean;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* ARIA label for accessibility (optional, for screen readers)
|
|
63
|
-
*/
|
|
64
|
-
"aria-hidden"?: boolean;
|
|
65
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { SpacerProps } from "./Spacer.types";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Spacer - Layout spacing component for the goo-ds design system
|
|
5
|
-
*
|
|
6
|
-
* Provides consistent vertical spacing using number tokens from Figma.
|
|
7
|
-
* Token-first per Constitution (no hardcoded values).
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Spacer size="16" />
|
|
12
|
-
* <Spacer size="32" />
|
|
13
|
-
* <Spacer size="64" />
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export function Spacer({ size = "16", className = "", ...props }: SpacerProps) {
|
|
17
|
-
return (
|
|
18
|
-
<div
|
|
19
|
-
className={className}
|
|
20
|
-
style={{
|
|
21
|
-
height: `var(--size-${size})`,
|
|
22
|
-
width: "100%",
|
|
23
|
-
}}
|
|
24
|
-
aria-hidden={props["aria-hidden"] !== false}
|
|
25
|
-
data-component="Spacer"
|
|
26
|
-
data-size={size}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default Spacer;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spacer component props
|
|
3
|
-
* Provides vertical spacing using design system number tokens
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type SpacerSize =
|
|
7
|
-
| "1"
|
|
8
|
-
| "2"
|
|
9
|
-
| "4"
|
|
10
|
-
| "6"
|
|
11
|
-
| "8"
|
|
12
|
-
| "12"
|
|
13
|
-
| "16"
|
|
14
|
-
| "20"
|
|
15
|
-
| "24"
|
|
16
|
-
| "28"
|
|
17
|
-
| "32"
|
|
18
|
-
| "36"
|
|
19
|
-
| "40"
|
|
20
|
-
| "44"
|
|
21
|
-
| "48"
|
|
22
|
-
| "56"
|
|
23
|
-
| "64"
|
|
24
|
-
| "80"
|
|
25
|
-
| "96"
|
|
26
|
-
| "112"
|
|
27
|
-
| "128"
|
|
28
|
-
| "144"
|
|
29
|
-
| "160"
|
|
30
|
-
| "176"
|
|
31
|
-
| "192"
|
|
32
|
-
| "208"
|
|
33
|
-
| "224"
|
|
34
|
-
| "240"
|
|
35
|
-
| "256"
|
|
36
|
-
| "288"
|
|
37
|
-
| "320"
|
|
38
|
-
| "384"
|
|
39
|
-
| "448"
|
|
40
|
-
| "512";
|
|
41
|
-
|
|
42
|
-
export interface SpacerProps {
|
|
43
|
-
/**
|
|
44
|
-
* The size of the spacer, corresponding to number tokens (--size-X)
|
|
45
|
-
* @default "16"
|
|
46
|
-
*/
|
|
47
|
-
size?: SpacerSize;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Additional CSS class names
|
|
51
|
-
*/
|
|
52
|
-
className?: string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* ARIA label for accessibility (optional, for screen readers)
|
|
56
|
-
*/
|
|
57
|
-
"aria-hidden"?: boolean;
|
|
58
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { TabItemProps } from "./TabItem.types";
|
|
2
|
-
import "./TabItem.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* TabItem - Tab navigation item component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent tab item with selected/unselected states.
|
|
8
|
-
* Designed to be used within a Tabs container.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <TabItem selected>Overview</TabItem>
|
|
14
|
-
* <TabItem onClick={() => handleTabChange('details')}>Details</TabItem>
|
|
15
|
-
* <TabItem>Settings</TabItem>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export function TabItem({
|
|
19
|
-
selected = false,
|
|
20
|
-
children,
|
|
21
|
-
className = "",
|
|
22
|
-
onClick,
|
|
23
|
-
disabled = false,
|
|
24
|
-
...props
|
|
25
|
-
}: TabItemProps) {
|
|
26
|
-
return (
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
className={`gds-tab-item ${selected ? "gds-tab-item-selected" : "gds-tab-item-unselected"} ${disabled ? "gds-tab-item-disabled" : ""} ${className}`.trim()}
|
|
30
|
-
onClick={onClick}
|
|
31
|
-
disabled={disabled}
|
|
32
|
-
role="tab"
|
|
33
|
-
aria-selected={selected}
|
|
34
|
-
aria-disabled={disabled}
|
|
35
|
-
tabIndex={selected ? 0 : -1}
|
|
36
|
-
data-component="TabItem"
|
|
37
|
-
data-selected={selected}
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
40
|
-
<span className="gds-tab-item-text">{children}</span>
|
|
41
|
-
</button>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default TabItem;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* TabItem component props
|
|
5
|
-
* Provides tab navigation item using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface TabItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Whether this tab is currently selected/active
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Tab content (text or other elements)
|
|
17
|
-
*/
|
|
18
|
-
children?: ReactNode;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Additional CSS class names
|
|
22
|
-
*/
|
|
23
|
-
className?: string;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Click handler for tab selection
|
|
27
|
-
*/
|
|
28
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Whether the tab is disabled
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { TableProps } from "./Table.types";
|
|
2
|
-
import "./Table.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Table - Table container component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent table layout with background, border, and rounded corners.
|
|
8
|
-
* Designed to contain TableRow components with Cell children.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Table>
|
|
14
|
-
* <TableRow>
|
|
15
|
-
* <Cell type="header">Name</Cell>
|
|
16
|
-
* <Cell type="header">Email</Cell>
|
|
17
|
-
* </TableRow>
|
|
18
|
-
* <TableRow>
|
|
19
|
-
* <Cell>John Doe</Cell>
|
|
20
|
-
* <Cell>john@example.com</Cell>
|
|
21
|
-
* </TableRow>
|
|
22
|
-
* </Table>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export function Table({ children, className = "", ...props }: TableProps) {
|
|
26
|
-
return (
|
|
27
|
-
<table
|
|
28
|
-
className={`gds-table ${className}`.trim()}
|
|
29
|
-
data-component="Table"
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
<tbody>
|
|
33
|
-
{children}
|
|
34
|
-
</tbody>
|
|
35
|
-
</table>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default Table;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Table component props
|
|
5
|
-
* Provides table container using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface TableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Table content (typically TableRow components)
|
|
11
|
-
*/
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Additional CSS class names
|
|
16
|
-
*/
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { TableRowProps } from "./TableRow.types";
|
|
2
|
-
import "./TableRow.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* TableRow - Table row component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent table row layout with interactive states and dividers.
|
|
8
|
-
* Designed to contain Cell components.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <TableRow>
|
|
14
|
-
* <Cell>Name</Cell>
|
|
15
|
-
* <Cell>Email</Cell>
|
|
16
|
-
* </TableRow>
|
|
17
|
-
* <TableRow selected>
|
|
18
|
-
* <Cell>John</Cell>
|
|
19
|
-
* <Cell>john@example.com</Cell>
|
|
20
|
-
* </TableRow>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export function TableRow({
|
|
24
|
-
divider = true,
|
|
25
|
-
selected = false,
|
|
26
|
-
disabled = false,
|
|
27
|
-
children,
|
|
28
|
-
className = "",
|
|
29
|
-
onClick,
|
|
30
|
-
...props
|
|
31
|
-
}: TableRowProps) {
|
|
32
|
-
const isInteractive = Boolean(onClick && !disabled);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<tr
|
|
36
|
-
className={`gds-table-row ${divider ? "gds-table-row-divider" : ""} ${selected ? "gds-table-row-selected" : ""} ${disabled ? "gds-table-row-disabled" : ""} ${isInteractive ? "gds-table-row-interactive" : ""} ${className}`.trim()}
|
|
37
|
-
onClick={disabled ? undefined : onClick}
|
|
38
|
-
role={isInteractive ? "button" : undefined}
|
|
39
|
-
tabIndex={isInteractive ? 0 : undefined}
|
|
40
|
-
aria-disabled={disabled}
|
|
41
|
-
aria-selected={selected}
|
|
42
|
-
data-component="TableRow"
|
|
43
|
-
data-divider={divider}
|
|
44
|
-
data-selected={selected}
|
|
45
|
-
data-disabled={disabled}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
</tr>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default TableRow;
|