Skip to content

Commit 4a78986

Browse files
committed
fix: versoning
1 parent 879f08f commit 4a78986

File tree

9 files changed

+93
-21
lines changed

9 files changed

+93
-21
lines changed

packages/raystack/box/box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styles from "./box.module.css";
55
const box = cva(styles.box);
66

77
type BoxProps = PropsWithChildren<VariantProps<typeof box>> &
8-
HTMLAttributes<HTMLElement>;
8+
HTMLAttributes<HTMLDivElement>;
99

1010
export function Box({ children, className, ...props }: BoxProps) {
1111
return (

packages/raystack/flex/flex.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const flex = cva(styles.flex, {
4545
});
4646

4747
type BoxProps = PropsWithChildren<VariantProps<typeof flex>> &
48-
HTMLAttributes<HTMLElement>;
48+
HTMLAttributes<HTMLDivElement>;
4949

5050
export function Flex({
5151
children,

packages/raystack/label/label.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const label = cva(styles.label, {
1616
});
1717

1818
type LabelProps = PropsWithChildren<VariantProps<typeof label>> &
19-
HTMLAttributes<HTMLSpanElement>;
19+
HTMLAttributes<HTMLLabelElement>;
2020

2121
export function Label({ children, className, size, ...props }: LabelProps) {
2222
return (
23-
<span className={label({ size, className })} {...props}>
23+
<label className={label({ size, className })} {...props}>
2424
{children}
25-
</span>
25+
</label>
2626
);
2727
}

packages/raystack/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@raystack/apsara",
3-
"version": "0.0.1",
3+
"version": "0.10.0",
44
"types": "dist/index.d.ts",
55
"sideEffects": false,
66
"engines": {
@@ -42,6 +42,7 @@
4242
"@radix-ui/react-slot": "^1.0.2",
4343
"@radix-ui/react-switch": "^1.0.3",
4444
"@radix-ui/react-tabs": "^1.0.4",
45+
"@rollup/plugin-commonjs": "^25.0.2",
4546
"@rollup/plugin-node-resolve": "^15.1.0",
4647
"@rollup/plugin-typescript": "^11.1.1",
4748
"@tanstack/match-sorter-utils": "^8.8.4",

packages/raystack/rollup.config.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1+
import commonjs from "@rollup/plugin-commonjs";
12
import { nodeResolve } from "@rollup/plugin-node-resolve";
23
import typescript from "@rollup/plugin-typescript";
34
import postcss from "rollup-plugin-postcss";
45

6+
const defaultGlobals = {
7+
react: "React",
8+
"react-dom": "ReactDOM",
9+
};
10+
511
export default {
612
input: "index.tsx",
713
output: [
814
{
915
dir: "dist",
1016
format: "es",
11-
preserveModules: true,
12-
preserveModulesRoot: "src",
17+
1318
sourcemap: true,
19+
exports: "named",
1420
},
1521
{
1622
dir: "dist",
1723
format: "cjs",
18-
preserveModules: true,
19-
preserveModulesRoot: "src",
2024
sourcemap: true,
25+
exports: "named",
2126
entryFileNames: "[name].cjs",
2227
},
2328
],
24-
external: [/node_modules/],
29+
external: ["react", "react-dom"],
2530
plugins: [
2631
nodeResolve(),
32+
commonjs(),
2733
postcss({
2834
extract: true,
2935
modules: true,

packages/raystack/sidebar/sidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Link } from "~/link";
55
import { Text } from "~/text";
66
import styles from "./sidebar.module.css";
77

8-
type SidebarRootProps = VariantProps<typeof Flex> & { children: ReactNode };
8+
type SidebarRootProps = VariantProps<typeof Flex> & { children?: ReactNode };
99
const baseLogo = <img src="./logo.svg" alt="apsara" width={16} height={16} />;
1010

1111
const SidebarRoot = ({ children }: SidebarRootProps) => {
@@ -18,13 +18,13 @@ const SidebarRoot = ({ children }: SidebarRootProps) => {
1818

1919
type SidebarLogoProps = {
2020
img?: ReactNode;
21-
brandName?: string;
21+
name?: string;
2222
onClick?: () => void;
2323
};
2424

2525
const SidebarLogo = ({
2626
img = baseLogo,
27-
brandName = "Apsara",
27+
name = "Apsara",
2828
onClick,
2929
}: SidebarLogoProps) => {
3030
return (
@@ -36,7 +36,7 @@ const SidebarLogo = ({
3636
onClick={onClick}
3737
>
3838
{img}
39-
<Text>{brandName}</Text>
39+
<Text>{name}</Text>
4040
</Flex>
4141
);
4242
};

packages/raystack/table/datatable.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import {
1313
useReactTable,
1414
VisibilityState,
1515
} from "@tanstack/react-table";
16-
import React, { Children, ReactElement, ReactNode } from "react";
16+
import React, {
17+
Children,
18+
ComponentProps,
19+
ReactElement,
20+
ReactNode,
21+
} from "react";
1722
import { Flex } from "~/flex";
1823
import { Text } from "~/text";
1924
import styles from "./datatable.module.css";
@@ -29,17 +34,20 @@ import { Table } from "./table";
2934
import { TableContext } from "./TableContext";
3035
import { TableDetailContainer } from "./TableDetailContainer";
3136

32-
interface DataTableProps<TData, TValue> {
37+
type DataTableProps<TData, TValue> = {
3338
columns: ColumnDef<TData, TValue>[];
3439
data: TData[];
3540
multiRowSelectionEnabled?: boolean;
3641
children?: ReactNode;
37-
}
42+
emptyState?: ReactNode;
43+
} & ComponentProps<typeof Table>;
3844

3945
function DataTableRoot<TData, TValue>({
4046
columns,
4147
data,
48+
emptyState,
4249
children,
50+
...props
4351
}: DataTableProps<TData, TValue>) {
4452
const convertedChildren = Children.toArray(children) as ReactElement[];
4553
const header = convertedChildren.find(
@@ -104,7 +112,7 @@ function DataTableRoot<TData, TValue>({
104112
>
105113
<Flex direction="column" className={styles.datatable}>
106114
{header}
107-
<Table>
115+
<Table {...props}>
108116
<Table.Header>
109117
{table.getHeaderGroups().map((headerGroup) => (
110118
<Table.Row key={headerGroup.id}>
@@ -148,7 +156,9 @@ function DataTableRoot<TData, TValue>({
148156
))
149157
) : (
150158
<Table.Row>
151-
<Table.Cell colSpan={columns.length}>No results.</Table.Cell>
159+
<Table.Cell colSpan={columns.length}>
160+
{emptyState || "No results."}
161+
</Table.Cell>
152162
</Table.Row>
153163
)}
154164
</Table.Body>

packages/raystack/table/table.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@
3131

3232
.cell {
3333
font-weight: 500;
34-
vertical-align: middle;
3534
padding: 1rem;
3635
}

pnpm-lock.yaml

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)