@oscarrf2/goo-ds 0.1.0 → 0.1.1
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 +74 -0
- package/dist/assets/index.css +1 -0
- package/dist/components/Button/Button.d.ts +20 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +60 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.types.d.ts +46 -0
- package/dist/components/Button/Button.types.d.ts.map +1 -0
- package/{src/components/Button/index.ts → dist/components/Button/index.d.ts} +4 -3
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Cell/Cell.d.ts +19 -0
- package/dist/components/Cell/Cell.d.ts.map +1 -0
- package/dist/components/Cell/Cell.js +28 -0
- package/dist/components/Cell/Cell.js.map +1 -0
- package/dist/components/Cell/Cell.types.d.ts +34 -0
- package/dist/components/Cell/Cell.types.d.ts.map +1 -0
- package/{src/components/Cell/index.ts → dist/components/Cell/index.d.ts} +4 -3
- package/dist/components/Cell/index.d.ts.map +1 -0
- package/dist/components/Codeblock/Codeblock.d.ts +25 -0
- package/dist/components/Codeblock/Codeblock.d.ts.map +1 -0
- package/dist/components/Codeblock/Codeblock.js +51 -0
- package/dist/components/Codeblock/Codeblock.js.map +1 -0
- package/dist/components/Codeblock/Codeblock.types.d.ts +36 -0
- package/dist/components/Codeblock/Codeblock.types.d.ts.map +1 -0
- package/{src/components/Codeblock/index.ts → dist/components/Codeblock/index.d.ts} +4 -3
- package/dist/components/Codeblock/index.d.ts.map +1 -0
- package/dist/components/CoreText/CoreText.d.ts +17 -0
- package/dist/components/CoreText/CoreText.d.ts.map +1 -0
- package/dist/components/CoreText/CoreText.js +26 -0
- package/dist/components/CoreText/CoreText.js.map +1 -0
- package/dist/components/CoreText/CoreText.types.d.ts +26 -0
- package/dist/components/CoreText/CoreText.types.d.ts.map +1 -0
- package/{src/components/CoreText/index.ts → dist/components/CoreText/index.d.ts} +3 -2
- package/dist/components/CoreText/index.d.ts.map +1 -0
- package/dist/components/Divider/Divider.d.ts +17 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/Divider.js +25 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/Divider/Divider.types.d.ts +17 -0
- package/dist/components/Divider/Divider.types.d.ts.map +1 -0
- package/{src/components/Divider/index.ts → dist/components/Divider/index.d.ts} +4 -3
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/InputImage/InputImage.d.ts +26 -0
- package/dist/components/InputImage/InputImage.d.ts.map +1 -0
- package/dist/components/InputImage/InputImage.js +284 -0
- package/dist/components/InputImage/InputImage.js.map +1 -0
- package/dist/components/InputImage/InputImage.types.d.ts +65 -0
- package/dist/components/InputImage/InputImage.types.d.ts.map +1 -0
- package/{src/components/InputImage/index.ts → dist/components/InputImage/index.d.ts} +3 -2
- package/dist/components/InputImage/index.d.ts.map +1 -0
- package/{src/components/Sidebar/Sidebar.tsx → dist/components/Sidebar/Sidebar.d.ts} +22 -42
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.js +27 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +21 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -0
- package/{src/components/Sidebar/index.ts → dist/components/Sidebar/index.d.ts} +4 -3
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarItem.d.ts +19 -0
- package/dist/components/SidebarItem/SidebarItem.d.ts.map +1 -0
- package/dist/components/SidebarItem/SidebarItem.js +37 -0
- package/dist/components/SidebarItem/SidebarItem.js.map +1 -0
- package/dist/components/SidebarItem/SidebarItem.types.d.ts +33 -0
- package/dist/components/SidebarItem/SidebarItem.types.d.ts.map +1 -0
- package/{src/components/SidebarItem/index.ts → dist/components/SidebarItem/index.d.ts} +4 -3
- package/dist/components/SidebarItem/index.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +30 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +31 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts.map +1 -0
- package/{src/components/Skeleton/index.ts → dist/components/Skeleton/index.d.ts} +5 -5
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/{src/components/Spacer/Spacer.tsx → dist/components/Spacer/Spacer.d.ts} +17 -31
- package/dist/components/Spacer/Spacer.d.ts.map +1 -0
- package/dist/components/Spacer/Spacer.js +21 -0
- package/dist/components/Spacer/Spacer.js.map +1 -0
- package/dist/components/Spacer/Spacer.types.d.ts +21 -0
- package/dist/components/Spacer/Spacer.types.d.ts.map +1 -0
- package/{src/components/Spacer/index.ts → dist/components/Spacer/index.d.ts} +4 -3
- package/dist/components/Spacer/index.d.ts.map +1 -0
- package/dist/components/TabItem/TabItem.d.ts +19 -0
- package/dist/components/TabItem/TabItem.d.ts.map +1 -0
- package/dist/components/TabItem/TabItem.js +33 -0
- package/dist/components/TabItem/TabItem.js.map +1 -0
- package/dist/components/TabItem/TabItem.types.d.ts +30 -0
- package/dist/components/TabItem/TabItem.types.d.ts.map +1 -0
- package/{src/components/TabItem/index.ts → dist/components/TabItem/index.d.ts} +4 -3
- package/dist/components/TabItem/index.d.ts.map +1 -0
- package/{src/components/Table/Table.tsx → dist/components/Table/Table.d.ts} +26 -39
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +18 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/Table.types.d.ts +16 -0
- package/dist/components/Table/Table.types.d.ts.map +1 -0
- package/{src/components/Table/index.ts → dist/components/Table/index.d.ts} +4 -3
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/TableRow/TableRow.d.ts +24 -0
- package/dist/components/TableRow/TableRow.d.ts.map +1 -0
- package/dist/components/TableRow/TableRow.js +35 -0
- package/dist/components/TableRow/TableRow.js.map +1 -0
- package/dist/components/TableRow/TableRow.types.d.ts +35 -0
- package/dist/components/TableRow/TableRow.types.d.ts.map +1 -0
- package/{src/components/TableRow/index.ts → dist/components/TableRow/index.d.ts} +4 -3
- package/dist/components/TableRow/index.d.ts.map +1 -0
- package/{src/components/Tabs/Tabs.tsx → dist/components/Tabs/Tabs.d.ts} +21 -37
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +23 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/{src/components/Tabs/Tabs.types.ts → dist/components/Tabs/Tabs.types.d.ts} +16 -18
- package/dist/components/Tabs/Tabs.types.d.ts.map +1 -0
- package/{src/components/Tabs/index.ts → dist/components/Tabs/index.d.ts} +4 -3
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/{src/components/index.ts → dist/components/index.d.ts} +15 -15
- package/dist/components/index.d.ts.map +1 -0
- package/dist/compositions/index.d.ts +2 -0
- package/dist/compositions/index.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +16 -16
- package/src/components/Button/Button.tsx +0 -82
- package/src/components/Button/Button.types.ts +0 -62
- package/src/components/Cell/Cell.tsx +0 -42
- package/src/components/Cell/Cell.types.ts +0 -42
- package/src/components/Codeblock/Codeblock.tsx +0 -88
- package/src/components/Codeblock/Codeblock.types.ts +0 -42
- package/src/components/CoreText/CoreText.tsx +0 -43
- package/src/components/CoreText/CoreText.types.ts +0 -56
- package/src/components/Divider/Divider.tsx +0 -35
- package/src/components/Divider/Divider.types.ts +0 -19
- package/src/components/InputImage/InputImage.tsx +0 -314
- package/src/components/InputImage/InputImage.types.ts +0 -86
- package/src/components/Sidebar/Sidebar.types.ts +0 -24
- package/src/components/SidebarItem/SidebarItem.tsx +0 -55
- package/src/components/SidebarItem/SidebarItem.types.ts +0 -39
- package/src/components/Skeleton/Skeleton.tsx +0 -41
- package/src/components/Skeleton/Skeleton.types.ts +0 -65
- package/src/components/Spacer/Spacer.types.ts +0 -58
- package/src/components/TabItem/TabItem.tsx +0 -45
- package/src/components/TabItem/TabItem.types.ts +0 -35
- package/src/components/Table/Table.types.ts +0 -18
- package/src/components/TableRow/TableRow.tsx +0 -53
- package/src/components/TableRow/TableRow.types.ts +0 -41
- package/src/compositions/index.ts +0 -3
- package/src/index.ts +0 -4
- /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
- /package/{src → dist}/styles.css +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../src/components/TableRow/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,OAAc,EACd,QAAgB,EAChB,QAAgB,EAChB,QAAQ,EACR,SAAc,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,aAAa,2CAoBf;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function c({
|
|
4
|
+
divider: o = !0,
|
|
5
|
+
selected: t = !1,
|
|
6
|
+
disabled: a = !1,
|
|
7
|
+
children: d,
|
|
8
|
+
className: i = "",
|
|
9
|
+
onClick: r,
|
|
10
|
+
...l
|
|
11
|
+
}) {
|
|
12
|
+
const e = !!(r && !a);
|
|
13
|
+
return /* @__PURE__ */ s(
|
|
14
|
+
"tr",
|
|
15
|
+
{
|
|
16
|
+
className: `gds-table-row ${o ? "gds-table-row-divider" : ""} ${t ? "gds-table-row-selected" : ""} ${a ? "gds-table-row-disabled" : ""} ${e ? "gds-table-row-interactive" : ""} ${i}`.trim(),
|
|
17
|
+
onClick: a ? void 0 : r,
|
|
18
|
+
role: e ? "button" : void 0,
|
|
19
|
+
tabIndex: e ? 0 : void 0,
|
|
20
|
+
"aria-disabled": a,
|
|
21
|
+
"aria-selected": t,
|
|
22
|
+
"data-component": "TableRow",
|
|
23
|
+
"data-divider": o,
|
|
24
|
+
"data-selected": t,
|
|
25
|
+
"data-disabled": a,
|
|
26
|
+
...l,
|
|
27
|
+
children: d
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
c as TableRow,
|
|
33
|
+
c as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.js","sources":["../../../src/components/TableRow/TableRow.tsx"],"sourcesContent":["import type { TableRowProps } from \"./TableRow.types\";\r\nimport \"./TableRow.css\";\r\n\r\n/**\r\n * TableRow - Table row component for the goo-ds design system\r\n *\r\n * Provides consistent table row layout with interactive states and dividers.\r\n * Designed to contain Cell components.\r\n * Token-first per Constitution (no hardcoded values).\r\n *\r\n * @example\r\n * ```tsx\r\n * <TableRow>\r\n * <Cell>Name</Cell>\r\n * <Cell>Email</Cell>\r\n * </TableRow>\r\n * <TableRow selected>\r\n * <Cell>John</Cell>\r\n * <Cell>john@example.com</Cell>\r\n * </TableRow>\r\n * ```\r\n */\r\nexport function TableRow({\r\n divider = true,\r\n selected = false,\r\n disabled = false,\r\n children,\r\n className = \"\",\r\n onClick,\r\n ...props\r\n}: TableRowProps) {\r\n const isInteractive = Boolean(onClick && !disabled);\r\n\r\n return (\r\n <tr\r\n 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()}\r\n onClick={disabled ? undefined : onClick}\r\n role={isInteractive ? \"button\" : undefined}\r\n tabIndex={isInteractive ? 0 : undefined}\r\n aria-disabled={disabled}\r\n aria-selected={selected}\r\n data-component=\"TableRow\"\r\n data-divider={divider}\r\n data-selected={selected}\r\n data-disabled={disabled}\r\n {...props}\r\n >\r\n {children}\r\n </tr>\r\n );\r\n}\r\n\r\nexport default TableRow;\r\n"],"names":["TableRow","divider","selected","disabled","children","className","onClick","props","isInteractive","jsx"],"mappings":";;AAsBO,SAASA,EAAS;AAAA,EACvB,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAgB,GAAQF,KAAW,CAACH;AAE1C,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,iBAAiBR,IAAU,0BAA0B,EAAE,IAAIC,IAAW,2BAA2B,EAAE,IAAIC,IAAW,2BAA2B,EAAE,IAAIK,IAAgB,8BAA8B,EAAE,IAAIH,CAAS,GAAG,KAAA;AAAA,MAC9N,SAASF,IAAW,SAAYG;AAAA,MAChC,MAAME,IAAgB,WAAW;AAAA,MACjC,UAAUA,IAAgB,IAAI;AAAA,MAC9B,iBAAeL;AAAA,MACf,iBAAeD;AAAA,MACf,kBAAe;AAAA,MACf,gBAAcD;AAAA,MACd,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACd,GAAGI;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* TableRow component props
|
|
4
|
+
* Provides table row layout using design system tokens
|
|
5
|
+
*/
|
|
6
|
+
export interface TableRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to show a divider border at the bottom
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
divider?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the row is selected
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the row is disabled
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Row content (typically Cell components)
|
|
24
|
+
*/
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS class names
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Click handler for interactive rows
|
|
32
|
+
*/
|
|
33
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=TableRow.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.types.d.ts","sourceRoot":"","sources":["../../../src/components/TableRow/TableRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AAEH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC7D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { TableRow } from "./TableRow";
|
|
2
|
-
export type { TableRowProps } from "./TableRow.types";
|
|
3
|
-
export { default } from "./TableRow";
|
|
1
|
+
export { TableRow } from "./TableRow";
|
|
2
|
+
export type { TableRowProps } from "./TableRow.types";
|
|
3
|
+
export { default } from "./TableRow";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TableRow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import type { TabsProps } from "./Tabs.types";
|
|
2
|
-
import "./Tabs.css";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* <TabItem
|
|
15
|
-
* <TabItem>
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
className = "",
|
|
23
|
-
...props
|
|
24
|
-
}: TabsProps) {
|
|
25
|
-
return (
|
|
26
|
-
<div
|
|
27
|
-
className={`gds-tabs ${className}`.trim()}
|
|
28
|
-
role="tablist"
|
|
29
|
-
data-component="Tabs"
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
{children}
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default Tabs;
|
|
1
|
+
import type { TabsProps } from "./Tabs.types";
|
|
2
|
+
import "./Tabs.css";
|
|
3
|
+
/**
|
|
4
|
+
* Tabs - Tab navigation container component for the goo-ds design system
|
|
5
|
+
*
|
|
6
|
+
* Provides consistent tab navigation container.
|
|
7
|
+
* Designed to contain TabItem components.
|
|
8
|
+
* Token-first per Constitution (no hardcoded values).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Tabs>
|
|
13
|
+
* <TabItem selected>Overview</TabItem>
|
|
14
|
+
* <TabItem>Details</TabItem>
|
|
15
|
+
* <TabItem>Settings</TabItem>
|
|
16
|
+
* </Tabs>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function Tabs({ children, className, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default Tabs;
|
|
21
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,SAAc,EACd,GAAG,KAAK,EACT,EAAE,SAAS,2CAWX;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function i({
|
|
4
|
+
children: t,
|
|
5
|
+
className: a = "",
|
|
6
|
+
...s
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: `gds-tabs ${a}`.trim(),
|
|
12
|
+
role: "tablist",
|
|
13
|
+
"data-component": "Tabs",
|
|
14
|
+
...s,
|
|
15
|
+
children: t
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
i as Tabs,
|
|
21
|
+
i as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import type { TabsProps } from \"./Tabs.types\";\r\nimport \"./Tabs.css\";\r\n\r\n/**\r\n * Tabs - Tab navigation container component for the goo-ds design system\r\n *\r\n * Provides consistent tab navigation container.\r\n * Designed to contain TabItem components.\r\n * Token-first per Constitution (no hardcoded values).\r\n *\r\n * @example\r\n * ```tsx\r\n * <Tabs>\r\n * <TabItem selected>Overview</TabItem>\r\n * <TabItem>Details</TabItem>\r\n * <TabItem>Settings</TabItem>\r\n * </Tabs>\r\n * ```\r\n */\r\nexport function Tabs({\r\n children,\r\n className = \"\",\r\n ...props\r\n}: TabsProps) {\r\n return (\r\n <div\r\n className={`gds-tabs ${className}`.trim()}\r\n role=\"tablist\"\r\n data-component=\"Tabs\"\r\n {...props}\r\n >\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\nexport default Tabs;\r\n"],"names":["Tabs","children","className","props","jsx"],"mappings":";;AAmBO,SAASA,EAAK;AAAA,EACnB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAc;AACZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,YAAYF,CAAS,GAAG,KAAA;AAAA,MACnC,MAAK;AAAA,MACL,kBAAe;AAAA,MACd,GAAGC;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Tabs component props
|
|
4
|
+
* Provides tab navigation container using design system tokens
|
|
5
|
+
*/
|
|
6
|
+
export interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Tab items (typically TabItem components)
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Additional CSS class names
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Tabs.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.types.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AAEH,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { Tabs } from "./Tabs";
|
|
2
|
-
export type { TabsProps } from "./Tabs.types";
|
|
3
|
-
export { default } from "./Tabs";
|
|
1
|
+
export { Tabs } from "./Tabs";
|
|
2
|
+
export type { TabsProps } from "./Tabs.types";
|
|
3
|
+
export { default } from "./Tabs";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
|
|
1
|
+
export * from "./CoreText";
|
|
2
|
+
export * from "./Spacer";
|
|
3
|
+
export * from "./Skeleton";
|
|
4
|
+
export * from "./Button";
|
|
5
|
+
export * from "./Cell";
|
|
6
|
+
export * from "./TableRow";
|
|
7
|
+
export * from "./Table";
|
|
8
|
+
export * from "./SidebarItem";
|
|
9
|
+
export * from "./Sidebar";
|
|
10
|
+
export * from "./Divider";
|
|
11
|
+
export * from "./Codeblock";
|
|
12
|
+
export * from "./InputImage";
|
|
13
|
+
export * from "./TabItem";
|
|
14
|
+
export * from "./Tabs";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compositions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CoreText as t } from "./components/CoreText/CoreText.js";
|
|
2
|
+
import { Spacer as p } from "./components/Spacer/Spacer.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Skeleton as f } from "./components/Skeleton/Skeleton.js";
|
|
5
|
+
import { Button as b } from "./components/Button/Button.js";
|
|
6
|
+
import { Cell as i } from "./components/Cell/Cell.js";
|
|
7
|
+
import { TableRow as d } from "./components/TableRow/TableRow.js";
|
|
8
|
+
import { Table as S } from "./components/Table/Table.js";
|
|
9
|
+
import { SidebarItem as C } from "./components/SidebarItem/SidebarItem.js";
|
|
10
|
+
import { Sidebar as k } from "./components/Sidebar/Sidebar.js";
|
|
11
|
+
import { Divider as g } from "./components/Divider/Divider.js";
|
|
12
|
+
import { Codeblock as v } from "./components/Codeblock/Codeblock.js";
|
|
13
|
+
import { InputImage as B } from "./components/InputImage/InputImage.js";
|
|
14
|
+
import { TabItem as R } from "./components/TabItem/TabItem.js";
|
|
15
|
+
import { Tabs as j } from "./components/Tabs/Tabs.js";
|
|
16
|
+
export {
|
|
17
|
+
b as Button,
|
|
18
|
+
i as Cell,
|
|
19
|
+
v as Codeblock,
|
|
20
|
+
t as CoreText,
|
|
21
|
+
g as Divider,
|
|
22
|
+
B as InputImage,
|
|
23
|
+
k as Sidebar,
|
|
24
|
+
C as SidebarItem,
|
|
25
|
+
f as Skeleton,
|
|
26
|
+
p as Spacer,
|
|
27
|
+
R as TabItem,
|
|
28
|
+
S as Table,
|
|
29
|
+
d as TableRow,
|
|
30
|
+
j as Tabs
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oscarrf2/goo-ds",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "./
|
|
6
|
-
"types": "./
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./styles.css": "./dist/styles.css"
|
|
10
13
|
},
|
|
11
14
|
"files": [
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"!src/**/*.test.ts",
|
|
16
|
-
"!src/**/*.test.tsx",
|
|
17
|
-
"!src/App.tsx",
|
|
18
|
-
"!src/App.css",
|
|
19
|
-
"!src/main.tsx",
|
|
20
|
-
"!src/assets",
|
|
21
|
-
"README.md"
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"CHANGELOG.md"
|
|
22
18
|
],
|
|
23
19
|
"dependencies": {
|
|
24
20
|
"react": "^19.2.0",
|
|
@@ -39,6 +35,7 @@
|
|
|
39
35
|
"eslint": "^9.39.1",
|
|
40
36
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
41
37
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
38
|
+
"glob": "^13.0.0",
|
|
42
39
|
"globals": "^16.5.0",
|
|
43
40
|
"identity-obj-proxy": "^3.0.0",
|
|
44
41
|
"jsdom": "^26.1.0",
|
|
@@ -51,7 +48,10 @@
|
|
|
51
48
|
},
|
|
52
49
|
"scripts": {
|
|
53
50
|
"dev": "vite",
|
|
54
|
-
"build": "
|
|
51
|
+
"build": "pnpm run build:types && pnpm run build:js && pnpm run build:css",
|
|
52
|
+
"build:types": "tsc --project tsconfig.build.json",
|
|
53
|
+
"build:js": "vite build",
|
|
54
|
+
"build:css": "node scripts/copy-styles.js",
|
|
55
55
|
"lint": "eslint .",
|
|
56
56
|
"preview": "vite preview",
|
|
57
57
|
"test": "vitest",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from "./Button.types";
|
|
2
|
-
import "./Button.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Button - Interactive button component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent button styles with multiple variants, sizes, and states.
|
|
8
|
-
* Supports icons, disabled state, and all standard button interactions.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Button>Click me</Button>
|
|
14
|
-
* <Button variant="secondary" size="small">Small button</Button>
|
|
15
|
-
* <Button variant="destructive" disabled>Disabled</Button>
|
|
16
|
-
* <Button iconLeft={<PlusIcon />}>With icon</Button>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export function Button({
|
|
20
|
-
variant = "primary",
|
|
21
|
-
size = "medium",
|
|
22
|
-
iconLeft,
|
|
23
|
-
iconRight,
|
|
24
|
-
disabled = false,
|
|
25
|
-
children,
|
|
26
|
-
className = "",
|
|
27
|
-
type = "button",
|
|
28
|
-
...props
|
|
29
|
-
}: ButtonProps) {
|
|
30
|
-
const hasIcons = iconLeft || iconRight;
|
|
31
|
-
const isIconOnly = hasIcons && !children;
|
|
32
|
-
|
|
33
|
-
// Build CSS custom properties for the button variant
|
|
34
|
-
const buttonVars = {
|
|
35
|
-
"--btn-background": `var(--button-${variant}-background-default)`,
|
|
36
|
-
"--btn-background-hover": `var(--button-${variant}-background-hover, var(--button-${variant}-background-default))`,
|
|
37
|
-
"--btn-background-pressed": `var(--button-${variant}-background-pressed, var(--button-${variant}-background-default))`,
|
|
38
|
-
"--btn-background-disabled": `var(--button-${variant}-background-disabled, var(--button-${variant}-background-default))`,
|
|
39
|
-
"--btn-text": `var(--button-${variant}-text-default)`,
|
|
40
|
-
"--btn-text-disabled": `var(--button-${variant}-text-disabled, var(--button-${variant}-text-default))`,
|
|
41
|
-
"--btn-icon": `var(--button-${variant}-icon-default)`,
|
|
42
|
-
"--btn-icon-disabled": `var(--button-${variant}-icon-disabled, var(--button-${variant}-icon-default))`,
|
|
43
|
-
"--btn-stroke": `var(--button-${variant}-stroke-default, transparent)`,
|
|
44
|
-
"--btn-stroke-hover": `var(--button-${variant}-stroke-hover, var(--button-${variant}-stroke-default, transparent))`,
|
|
45
|
-
"--btn-stroke-disabled": `var(--button-${variant}-stroke-disabled, var(--button-${variant}-stroke-default, transparent))`,
|
|
46
|
-
} as React.CSSProperties;
|
|
47
|
-
|
|
48
|
-
// Size-dependent layout tokens
|
|
49
|
-
const buttonType = isIconOnly ? "icon" : "cta";
|
|
50
|
-
const sizeKey = size === "extraSmall" ? "extraSmall" : size;
|
|
51
|
-
|
|
52
|
-
const layoutVars = {
|
|
53
|
-
"--btn-gap": `var(--button-${sizeKey}-${buttonType}-gap)`,
|
|
54
|
-
"--btn-padding-v": `var(--button-${sizeKey}-${buttonType}-paddingVertical)`,
|
|
55
|
-
"--btn-padding-h": `var(--button-${sizeKey}-${buttonType}-paddingHorizontal)`,
|
|
56
|
-
"--btn-min-height": `var(--button-${sizeKey}-${buttonType}-minHeight)`,
|
|
57
|
-
"--btn-radius": `var(--button-${sizeKey}-${buttonType}-radius)`,
|
|
58
|
-
"--btn-stroke-width": `var(--button-${sizeKey}-${buttonType}-strokeWidth)`,
|
|
59
|
-
"--btn-min-width": isIconOnly ? `var(--button-${sizeKey}-${buttonType}-minWidth)` : "auto",
|
|
60
|
-
"--btn-font-size": `var(--font-size-${size === "large" ? "md" : size === "medium" ? "sm" : "xs"})`,
|
|
61
|
-
"--btn-line-height": `var(--font-lineHeight-${size === "large" ? "md" : size === "medium" ? "sm" : "xs"})`,
|
|
62
|
-
} as React.CSSProperties;
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<button
|
|
66
|
-
type={type}
|
|
67
|
-
disabled={disabled}
|
|
68
|
-
className={`gds-button gds-button-${variant} gds-button-${size} ${isIconOnly ? "gds-button-icon-only" : ""} ${className}`.trim()}
|
|
69
|
-
style={{ ...buttonVars, ...layoutVars }}
|
|
70
|
-
data-component="Button"
|
|
71
|
-
data-variant={variant}
|
|
72
|
-
data-size={size}
|
|
73
|
-
{...props}
|
|
74
|
-
>
|
|
75
|
-
{iconLeft && <span className="gds-button-icon gds-button-icon-left">{iconLeft}</span>}
|
|
76
|
-
{children && <span className="gds-button-text">{children}</span>}
|
|
77
|
-
{iconRight && <span className="gds-button-icon gds-button-icon-right">{iconRight}</span>}
|
|
78
|
-
</button>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default Button;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Button component props
|
|
5
|
-
* Provides interactive buttons using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type ButtonVariant =
|
|
9
|
-
| "primary"
|
|
10
|
-
| "secondary"
|
|
11
|
-
| "destructive"
|
|
12
|
-
| "outline"
|
|
13
|
-
| "ghost"
|
|
14
|
-
| "link";
|
|
15
|
-
|
|
16
|
-
export type ButtonSize = "extraSmall" | "small" | "medium" | "large";
|
|
17
|
-
|
|
18
|
-
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
19
|
-
/**
|
|
20
|
-
* The visual style variant of the button
|
|
21
|
-
* @default "primary"
|
|
22
|
-
*/
|
|
23
|
-
variant?: ButtonVariant;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The size of the button
|
|
27
|
-
* @default "medium"
|
|
28
|
-
*/
|
|
29
|
-
size?: ButtonSize;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Icon to display before the text
|
|
33
|
-
*/
|
|
34
|
-
iconLeft?: ReactNode;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Icon to display after the text
|
|
38
|
-
*/
|
|
39
|
-
iconRight?: ReactNode;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Whether the button is disabled
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Button content (text or other elements)
|
|
49
|
-
*/
|
|
50
|
-
children?: ReactNode;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Additional CSS class names
|
|
54
|
-
*/
|
|
55
|
-
className?: string;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Button type attribute
|
|
59
|
-
* @default "button"
|
|
60
|
-
*/
|
|
61
|
-
type?: "button" | "submit" | "reset";
|
|
62
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { CellProps } from "./Cell.types";
|
|
2
|
-
import "./Cell.css";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cell - Table cell component for the goo-ds design system
|
|
6
|
-
*
|
|
7
|
-
* Provides consistent table cell layout with alignment and width presets.
|
|
8
|
-
* Designed to be used within table structures.
|
|
9
|
-
* Token-first per Constitution (no hardcoded values).
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Cell type="header">Name</Cell>
|
|
14
|
-
* <Cell>John Doe</Cell>
|
|
15
|
-
* <Cell alignment="right" width="sm">$100</Cell>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export function Cell({
|
|
19
|
-
type = "body",
|
|
20
|
-
alignment = "left",
|
|
21
|
-
width = "md",
|
|
22
|
-
children,
|
|
23
|
-
className = "",
|
|
24
|
-
...props
|
|
25
|
-
}: CellProps) {
|
|
26
|
-
const Tag = type === "header" ? "th" : "td";
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Tag
|
|
30
|
-
className={`gds-cell gds-cell-${type} gds-cell-align-${alignment} gds-cell-width-${width} ${className}`.trim()}
|
|
31
|
-
data-component="Cell"
|
|
32
|
-
data-type={type}
|
|
33
|
-
data-alignment={alignment}
|
|
34
|
-
data-width={width}
|
|
35
|
-
{...props}
|
|
36
|
-
>
|
|
37
|
-
{children}
|
|
38
|
-
</Tag>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default Cell;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Cell component props
|
|
5
|
-
* Provides table cell layout using design system tokens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type CellType = "header" | "body";
|
|
9
|
-
|
|
10
|
-
export type CellAlignment = "left" | "center" | "right";
|
|
11
|
-
|
|
12
|
-
export type CellWidth = "xs" | "sm" | "md" | "lg" | "xl" | "fill";
|
|
13
|
-
|
|
14
|
-
export interface CellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
-
/**
|
|
16
|
-
* The type of cell (header or body)
|
|
17
|
-
* @default "body"
|
|
18
|
-
*/
|
|
19
|
-
type?: CellType;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Horizontal alignment of cell content
|
|
23
|
-
* @default "left"
|
|
24
|
-
*/
|
|
25
|
-
alignment?: CellAlignment;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Width preset for the cell
|
|
29
|
-
* @default "md"
|
|
30
|
-
*/
|
|
31
|
-
width?: CellWidth;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Cell content
|
|
35
|
-
*/
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Additional CSS class names
|
|
40
|
-
*/
|
|
41
|
-
className?: string;
|
|
42
|
-
}
|