@cerberus-design/react 0.7.4-next-f357b4f → 0.7.4-next-73e6ea1
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/build/legacy/_tsup-dts-rollup.d.ts +3 -1
- package/build/legacy/chunk-3GXISGPS.js +47 -0
- package/build/legacy/chunk-3GXISGPS.js.map +1 -0
- package/build/legacy/components/Th.js +2 -1
- package/build/legacy/index.js +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +3 -1
- package/build/modern/chunk-3GXISGPS.js +47 -0
- package/build/modern/chunk-3GXISGPS.js.map +1 -0
- package/build/modern/components/Th.js +2 -1
- package/build/modern/index.js +1 -1
- package/package.json +2 -2
- package/src/components/Th.tsx +35 -5
- package/build/legacy/chunk-KFJKK2WX.js +0 -13
- package/build/legacy/chunk-KFJKK2WX.js.map +0 -1
- package/build/modern/chunk-KFJKK2WX.js +0 -13
- package/build/modern/chunk-KFJKK2WX.js.map +0 -1
|
@@ -1325,7 +1325,9 @@ export { Th as Th_alias_1 }
|
|
|
1325
1325
|
* Th component for the Table component
|
|
1326
1326
|
* @module
|
|
1327
1327
|
*/
|
|
1328
|
-
declare type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement
|
|
1328
|
+
declare type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement> & {
|
|
1329
|
+
onClick?: (e: MouseEvent_2<HTMLButtonElement>) => void;
|
|
1330
|
+
};
|
|
1329
1331
|
export { ThBaseProps }
|
|
1330
1332
|
export { ThBaseProps as ThBaseProps_alias_1 }
|
|
1331
1333
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Show
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Th.tsx
|
|
6
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { th } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function Th(props) {
|
|
10
|
+
const { size, onClick, ...nativeProps } = props;
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Show,
|
|
13
|
+
{
|
|
14
|
+
when: Boolean(onClick),
|
|
15
|
+
fallback: /* @__PURE__ */ jsx(
|
|
16
|
+
"th",
|
|
17
|
+
{
|
|
18
|
+
...nativeProps,
|
|
19
|
+
className: cx(nativeProps.className, th({ size }))
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
children: /* @__PURE__ */ jsx("th", { ...nativeProps, children: /* @__PURE__ */ jsx(
|
|
23
|
+
"button",
|
|
24
|
+
{
|
|
25
|
+
className: cx(
|
|
26
|
+
nativeProps.className,
|
|
27
|
+
th({ size }),
|
|
28
|
+
css({
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
display: "inline-flex",
|
|
31
|
+
justifyContent: "space-between",
|
|
32
|
+
userSelect: "none",
|
|
33
|
+
w: "full"
|
|
34
|
+
})
|
|
35
|
+
),
|
|
36
|
+
onClick,
|
|
37
|
+
children: props.children
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
Th
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-3GXISGPS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Th.tsx"],"sourcesContent":["import { css, cx } from '@cerberus/styled-system/css'\nimport { th, type ThVariantProps } from '@cerberus/styled-system/recipes'\nimport type { MouseEvent, TableHTMLAttributes } from 'react'\nimport { Show } from './Show'\n\n/**\n * Th component for the Table component\n * @module\n */\n\nexport type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement> & {\n onClick?: (e: MouseEvent<HTMLButtonElement>) => void\n}\nexport type ThProps = ThBaseProps & ThVariantProps\n\n/**\n * Styles for the Th component\n * @definition [Table docs](https://cerberus.digitalu.design/react/table)\n * @example\n * ```tsx\n * <Th>Header 1</Th>\n * ```\n */\nexport function Th(props: ThProps) {\n const { size, onClick, ...nativeProps } = props\n return (\n <Show\n when={Boolean(onClick)}\n fallback={\n <th\n {...nativeProps}\n className={cx(nativeProps.className, th({ size }))}\n />\n }\n >\n <th {...nativeProps}>\n <button\n className={cx(\n nativeProps.className,\n th({ size }),\n css({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'space-between',\n userSelect: 'none',\n w: 'full',\n }),\n )}\n onClick={onClick}\n >\n {props.children}\n </button>\n </th>\n </Show>\n )\n}\n"],"mappings":";;;;;AAAA,SAAS,KAAK,UAAU;AACxB,SAAS,UAA+B;AA4BhC;AAND,SAAS,GAAG,OAAgB;AACjC,QAAM,EAAE,MAAM,SAAS,GAAG,YAAY,IAAI;AAC1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,MACrB,UACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,WAAW,GAAG,YAAY,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC;AAAA;AAAA,MACnD;AAAA,MAGF,8BAAC,QAAI,GAAG,aACN;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT,YAAY;AAAA,YACZ,GAAG,EAAE,KAAK,CAAC;AAAA,YACX,IAAI;AAAA,cACF,YAAY;AAAA,cACZ,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,YAAY;AAAA,cACZ,GAAG;AAAA,YACL,CAAC;AAAA,UACH;AAAA,UACA;AAAA,UAEC,gBAAM;AAAA;AAAA,MACT,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/legacy/index.js
CHANGED
|
@@ -1325,7 +1325,9 @@ export { Th as Th_alias_1 }
|
|
|
1325
1325
|
* Th component for the Table component
|
|
1326
1326
|
* @module
|
|
1327
1327
|
*/
|
|
1328
|
-
declare type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement
|
|
1328
|
+
declare type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement> & {
|
|
1329
|
+
onClick?: (e: MouseEvent_2<HTMLButtonElement>) => void;
|
|
1330
|
+
};
|
|
1329
1331
|
export { ThBaseProps }
|
|
1330
1332
|
export { ThBaseProps as ThBaseProps_alias_1 }
|
|
1331
1333
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Show
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Th.tsx
|
|
6
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { th } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function Th(props) {
|
|
10
|
+
const { size, onClick, ...nativeProps } = props;
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Show,
|
|
13
|
+
{
|
|
14
|
+
when: Boolean(onClick),
|
|
15
|
+
fallback: /* @__PURE__ */ jsx(
|
|
16
|
+
"th",
|
|
17
|
+
{
|
|
18
|
+
...nativeProps,
|
|
19
|
+
className: cx(nativeProps.className, th({ size }))
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
children: /* @__PURE__ */ jsx("th", { ...nativeProps, children: /* @__PURE__ */ jsx(
|
|
23
|
+
"button",
|
|
24
|
+
{
|
|
25
|
+
className: cx(
|
|
26
|
+
nativeProps.className,
|
|
27
|
+
th({ size }),
|
|
28
|
+
css({
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
display: "inline-flex",
|
|
31
|
+
justifyContent: "space-between",
|
|
32
|
+
userSelect: "none",
|
|
33
|
+
w: "full"
|
|
34
|
+
})
|
|
35
|
+
),
|
|
36
|
+
onClick,
|
|
37
|
+
children: props.children
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
Th
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-3GXISGPS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Th.tsx"],"sourcesContent":["import { css, cx } from '@cerberus/styled-system/css'\nimport { th, type ThVariantProps } from '@cerberus/styled-system/recipes'\nimport type { MouseEvent, TableHTMLAttributes } from 'react'\nimport { Show } from './Show'\n\n/**\n * Th component for the Table component\n * @module\n */\n\nexport type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement> & {\n onClick?: (e: MouseEvent<HTMLButtonElement>) => void\n}\nexport type ThProps = ThBaseProps & ThVariantProps\n\n/**\n * Styles for the Th component\n * @definition [Table docs](https://cerberus.digitalu.design/react/table)\n * @example\n * ```tsx\n * <Th>Header 1</Th>\n * ```\n */\nexport function Th(props: ThProps) {\n const { size, onClick, ...nativeProps } = props\n return (\n <Show\n when={Boolean(onClick)}\n fallback={\n <th\n {...nativeProps}\n className={cx(nativeProps.className, th({ size }))}\n />\n }\n >\n <th {...nativeProps}>\n <button\n className={cx(\n nativeProps.className,\n th({ size }),\n css({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'space-between',\n userSelect: 'none',\n w: 'full',\n }),\n )}\n onClick={onClick}\n >\n {props.children}\n </button>\n </th>\n </Show>\n )\n}\n"],"mappings":";;;;;AAAA,SAAS,KAAK,UAAU;AACxB,SAAS,UAA+B;AA4BhC;AAND,SAAS,GAAG,OAAgB;AACjC,QAAM,EAAE,MAAM,SAAS,GAAG,YAAY,IAAI;AAC1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,QAAQ,OAAO;AAAA,MACrB,UACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,WAAW,GAAG,YAAY,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC;AAAA;AAAA,MACnD;AAAA,MAGF,8BAAC,QAAI,GAAG,aACN;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT,YAAY;AAAA,YACZ,GAAG,EAAE,KAAK,CAAC;AAAA,YACX,IAAI;AAAA,cACF,YAAY;AAAA,cACZ,SAAS;AAAA,cACT,gBAAgB;AAAA,cAChB,YAAY;AAAA,cACZ,GAAG;AAAA,YACL,CAAC;AAAA,UACH;AAAA,UACA;AAAA,UAEC,gBAAM;AAAA;AAAA,MACT,GACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.7.4-next-
|
|
3
|
+
"version": "0.7.4-next-73e6ea1",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-dom": "^18",
|
|
27
27
|
"tsup": "^8.1.0",
|
|
28
28
|
"@cerberus-design/configs": "0.0.0",
|
|
29
|
-
"@cerberus-design/styled-system": "0.7.4-next-
|
|
29
|
+
"@cerberus-design/styled-system": "0.7.4-next-73e6ea1"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
package/src/components/Th.tsx
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { cx } from '@cerberus/styled-system/css'
|
|
1
|
+
import { css, cx } from '@cerberus/styled-system/css'
|
|
2
2
|
import { th, type ThVariantProps } from '@cerberus/styled-system/recipes'
|
|
3
|
-
import type { TableHTMLAttributes } from 'react'
|
|
3
|
+
import type { MouseEvent, TableHTMLAttributes } from 'react'
|
|
4
|
+
import { Show } from './Show'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Th component for the Table component
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
export type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement>
|
|
11
|
+
export type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement> & {
|
|
12
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void
|
|
13
|
+
}
|
|
11
14
|
export type ThProps = ThBaseProps & ThVariantProps
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -19,8 +22,35 @@ export type ThProps = ThBaseProps & ThVariantProps
|
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
|
21
24
|
export function Th(props: ThProps) {
|
|
22
|
-
const { size, ...nativeProps } = props
|
|
25
|
+
const { size, onClick, ...nativeProps } = props
|
|
23
26
|
return (
|
|
24
|
-
<
|
|
27
|
+
<Show
|
|
28
|
+
when={Boolean(onClick)}
|
|
29
|
+
fallback={
|
|
30
|
+
<th
|
|
31
|
+
{...nativeProps}
|
|
32
|
+
className={cx(nativeProps.className, th({ size }))}
|
|
33
|
+
/>
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
<th {...nativeProps}>
|
|
37
|
+
<button
|
|
38
|
+
className={cx(
|
|
39
|
+
nativeProps.className,
|
|
40
|
+
th({ size }),
|
|
41
|
+
css({
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
display: 'inline-flex',
|
|
44
|
+
justifyContent: 'space-between',
|
|
45
|
+
userSelect: 'none',
|
|
46
|
+
w: 'full',
|
|
47
|
+
}),
|
|
48
|
+
)}
|
|
49
|
+
onClick={onClick}
|
|
50
|
+
>
|
|
51
|
+
{props.children}
|
|
52
|
+
</button>
|
|
53
|
+
</th>
|
|
54
|
+
</Show>
|
|
25
55
|
)
|
|
26
56
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/components/Th.tsx
|
|
2
|
-
import { cx } from "@cerberus/styled-system/css";
|
|
3
|
-
import { th } from "@cerberus/styled-system/recipes";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
function Th(props) {
|
|
6
|
-
const { size, ...nativeProps } = props;
|
|
7
|
-
return /* @__PURE__ */ jsx("th", { ...nativeProps, className: cx(nativeProps.className, th({ size })) });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
Th
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-KFJKK2WX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Th.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { th, type ThVariantProps } from '@cerberus/styled-system/recipes'\nimport type { TableHTMLAttributes } from 'react'\n\n/**\n * Th component for the Table component\n * @module\n */\n\nexport type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement>\nexport type ThProps = ThBaseProps & ThVariantProps\n\n/**\n * Styles for the Th component\n * @definition [Table docs](https://cerberus.digitalu.design/react/table)\n * @example\n * ```tsx\n * <Th>Header 1</Th>\n * ```\n */\nexport function Th(props: ThProps) {\n const { size, ...nativeProps } = props\n return (\n <th {...nativeProps} className={cx(nativeProps.className, th({ size }))} />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,UAA+B;AAsBpC;AAHG,SAAS,GAAG,OAAgB;AACjC,QAAM,EAAE,MAAM,GAAG,YAAY,IAAI;AACjC,SACE,oBAAC,QAAI,GAAG,aAAa,WAAW,GAAG,YAAY,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG;AAE7E;","names":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/components/Th.tsx
|
|
2
|
-
import { cx } from "@cerberus/styled-system/css";
|
|
3
|
-
import { th } from "@cerberus/styled-system/recipes";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
function Th(props) {
|
|
6
|
-
const { size, ...nativeProps } = props;
|
|
7
|
-
return /* @__PURE__ */ jsx("th", { ...nativeProps, className: cx(nativeProps.className, th({ size })) });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
Th
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-KFJKK2WX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Th.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { th, type ThVariantProps } from '@cerberus/styled-system/recipes'\nimport type { TableHTMLAttributes } from 'react'\n\n/**\n * Th component for the Table component\n * @module\n */\n\nexport type ThBaseProps = TableHTMLAttributes<HTMLTableCellElement>\nexport type ThProps = ThBaseProps & ThVariantProps\n\n/**\n * Styles for the Th component\n * @definition [Table docs](https://cerberus.digitalu.design/react/table)\n * @example\n * ```tsx\n * <Th>Header 1</Th>\n * ```\n */\nexport function Th(props: ThProps) {\n const { size, ...nativeProps } = props\n return (\n <th {...nativeProps} className={cx(nativeProps.className, th({ size }))} />\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,UAA+B;AAsBpC;AAHG,SAAS,GAAG,OAAgB;AACjC,QAAM,EAAE,MAAM,GAAG,YAAY,IAAI;AACjC,SACE,oBAAC,QAAI,GAAG,aAAa,WAAW,GAAG,YAAY,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG;AAE7E;","names":[]}
|