@cerberus-design/react 0.0.1-next-f49bb60 → 0.1.0-next-1ab8194
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.cts +29 -0
- package/build/legacy/_tsup-dts-rollup.d.ts +29 -0
- package/build/legacy/components/Button.cjs.map +1 -1
- package/build/legacy/components/Button.js.map +1 -1
- package/build/legacy/components/IconButton.cjs +50 -0
- package/build/legacy/components/IconButton.cjs.map +1 -0
- package/build/legacy/components/IconButton.d.cts +3 -0
- package/build/legacy/components/IconButton.d.ts +3 -0
- package/build/legacy/components/IconButton.js +25 -0
- package/build/legacy/components/IconButton.js.map +1 -0
- package/build/legacy/index.cjs +2 -0
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +3 -0
- package/build/legacy/index.d.ts +3 -0
- package/build/legacy/index.js +1 -0
- package/build/legacy/index.js.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.cts +29 -0
- package/build/modern/_tsup-dts-rollup.d.ts +29 -0
- package/build/modern/components/Button.cjs.map +1 -1
- package/build/modern/components/Button.js.map +1 -1
- package/build/modern/components/IconButton.cjs +50 -0
- package/build/modern/components/IconButton.cjs.map +1 -0
- package/build/modern/components/IconButton.d.cts +3 -0
- package/build/modern/components/IconButton.d.ts +3 -0
- package/build/modern/components/IconButton.js +25 -0
- package/build/modern/components/IconButton.js.map +1 -0
- package/build/modern/index.cjs +2 -0
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +3 -0
- package/build/modern/index.d.ts +3 -0
- package/build/modern/index.js +1 -0
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +5 -0
- package/src/components/IconButton.tsx +39 -0
- package/src/index.ts +6 -0
|
@@ -14,6 +14,10 @@ declare function Button(props: ButtonProps): JSX.Element;
|
|
|
14
14
|
export { Button }
|
|
15
15
|
export { Button as Button_alias_1 }
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* This module contains the Button component.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
17
21
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
22
|
palette?: 'action' | 'danger';
|
|
19
23
|
usage?: 'filled' | 'outline' | 'text';
|
|
@@ -62,6 +66,31 @@ declare interface GetPositionResult {
|
|
|
62
66
|
bottom: string;
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A component that allows the user to perform actions using an icon
|
|
71
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
|
|
72
|
+
*/
|
|
73
|
+
declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
74
|
+
export { IconButton }
|
|
75
|
+
export { IconButton as IconButton_alias_1 }
|
|
76
|
+
|
|
77
|
+
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
palette?: ButtonProps['palette'];
|
|
80
|
+
usage?: IconButtonUsage;
|
|
81
|
+
shape?: 'circle';
|
|
82
|
+
}
|
|
83
|
+
export { IconButtonProps }
|
|
84
|
+
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This module contains the Icon Button component.
|
|
88
|
+
* @module
|
|
89
|
+
*/
|
|
90
|
+
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
91
|
+
export { IconButtonUsage }
|
|
92
|
+
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
93
|
+
|
|
65
94
|
declare const MODE_KEY = "cerberus-mode";
|
|
66
95
|
export { MODE_KEY }
|
|
67
96
|
export { MODE_KEY as MODE_KEY_alias_1 }
|
|
@@ -14,6 +14,10 @@ declare function Button(props: ButtonProps): JSX.Element;
|
|
|
14
14
|
export { Button }
|
|
15
15
|
export { Button as Button_alias_1 }
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* This module contains the Button component.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
17
21
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
22
|
palette?: 'action' | 'danger';
|
|
19
23
|
usage?: 'filled' | 'outline' | 'text';
|
|
@@ -62,6 +66,31 @@ declare interface GetPositionResult {
|
|
|
62
66
|
bottom: string;
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A component that allows the user to perform actions using an icon
|
|
71
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
|
|
72
|
+
*/
|
|
73
|
+
declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
74
|
+
export { IconButton }
|
|
75
|
+
export { IconButton as IconButton_alias_1 }
|
|
76
|
+
|
|
77
|
+
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
palette?: ButtonProps['palette'];
|
|
80
|
+
usage?: IconButtonUsage;
|
|
81
|
+
shape?: 'circle';
|
|
82
|
+
}
|
|
83
|
+
export { IconButtonProps }
|
|
84
|
+
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This module contains the Icon Button component.
|
|
88
|
+
* @module
|
|
89
|
+
*/
|
|
90
|
+
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
91
|
+
export { IconButtonUsage }
|
|
92
|
+
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
93
|
+
|
|
65
94
|
declare const MODE_KEY = "cerberus-mode";
|
|
66
95
|
export { MODE_KEY }
|
|
67
96
|
export { MODE_KEY as MODE_KEY_alias_1 }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAAuB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAAuB;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,uBAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/IconButton.tsx
|
|
21
|
+
var IconButton_exports = {};
|
|
22
|
+
__export(IconButton_exports, {
|
|
23
|
+
IconButton: () => IconButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(IconButton_exports);
|
|
26
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
27
|
+
var import_recipes = require("@cerberus/styled-system/recipes.cjs");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function IconButton(props) {
|
|
30
|
+
const { ariaLabel, palette, usage, ...nativeProps } = props;
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
...nativeProps,
|
|
35
|
+
"aria-label": ariaLabel ?? "Icon Button",
|
|
36
|
+
className: (0, import_css.cx)(
|
|
37
|
+
nativeProps.className,
|
|
38
|
+
(0, import_recipes.iconButton)({
|
|
39
|
+
palette,
|
|
40
|
+
usage
|
|
41
|
+
})
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
IconButton
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=IconButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: IconButtonUsage\n shape?: 'circle'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAA2B;AAwBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,2BAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/components/IconButton.tsx
|
|
2
|
+
import { cx } from "@cerberus/styled-system/css.js";
|
|
3
|
+
import { iconButton } from "@cerberus/styled-system/recipes.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function IconButton(props) {
|
|
6
|
+
const { ariaLabel, palette, usage, ...nativeProps } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"button",
|
|
9
|
+
{
|
|
10
|
+
...nativeProps,
|
|
11
|
+
"aria-label": ariaLabel ?? "Icon Button",
|
|
12
|
+
className: cx(
|
|
13
|
+
nativeProps.className,
|
|
14
|
+
iconButton({
|
|
15
|
+
palette,
|
|
16
|
+
usage
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
IconButton
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: IconButtonUsage\n shape?: 'circle'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAwBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/legacy/index.cjs
CHANGED
|
@@ -18,6 +18,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
18
|
var src_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(src_exports);
|
|
20
20
|
__reExport(src_exports, require("./components/Button.cjs"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./components/IconButton.cjs"), module.exports);
|
|
21
22
|
__reExport(src_exports, require("./components/NavMenuTrigger.cjs"), module.exports);
|
|
22
23
|
__reExport(src_exports, require("./components/NavMenuList.cjs"), module.exports);
|
|
23
24
|
__reExport(src_exports, require("./components/NavMenuLink.cjs"), module.exports);
|
|
@@ -31,6 +32,7 @@ __reExport(src_exports, require("./types.cjs"), module.exports);
|
|
|
31
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
33
|
0 && (module.exports = {
|
|
33
34
|
...require("./components/Button.cjs"),
|
|
35
|
+
...require("./components/IconButton.cjs"),
|
|
34
36
|
...require("./components/NavMenuTrigger.cjs"),
|
|
35
37
|
...require("./components/NavMenuList.cjs"),
|
|
36
38
|
...require("./components/NavMenuLink.cjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/IconButton'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,wBAAc,oCAPd;AAQA,wBAAc,wCARd;AASA,wBAAc,4CATd;AAUA,wBAAc,yCAVd;AAWA,wBAAc,yCAXd;AAYA,wBAAc,kCAZd;AAgBA,wBAAc,gCAhBd;AAiBA,wBAAc,kCAjBd;AAkBA,wBAAc,gCAlBd;AAsBA,wBAAc,iCAtBd;AA0BA,wBAAc,6CA1Bd;AA8BA,wBAAc,wBA9Bd;","names":[]}
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { IconButton } from './_tsup-dts-rollup';
|
|
4
|
+
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
|
+
export { IconButtonProps } from './_tsup-dts-rollup';
|
|
3
6
|
export { NavMenuTrigger } from './_tsup-dts-rollup';
|
|
4
7
|
export { NavMenuTriggerProps } from './_tsup-dts-rollup';
|
|
5
8
|
export { getPosition } from './_tsup-dts-rollup';
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { IconButton } from './_tsup-dts-rollup';
|
|
4
|
+
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
|
+
export { IconButtonProps } from './_tsup-dts-rollup';
|
|
3
6
|
export { NavMenuTrigger } from './_tsup-dts-rollup';
|
|
4
7
|
export { NavMenuTriggerProps } from './_tsup-dts-rollup';
|
|
5
8
|
export { getPosition } from './_tsup-dts-rollup';
|
package/build/legacy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/IconButton'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";AAOA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAId,cAAc;AAId,cAAc;","names":[]}
|
|
@@ -14,6 +14,10 @@ declare function Button(props: ButtonProps): JSX.Element;
|
|
|
14
14
|
export { Button }
|
|
15
15
|
export { Button as Button_alias_1 }
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* This module contains the Button component.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
17
21
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
22
|
palette?: 'action' | 'danger';
|
|
19
23
|
usage?: 'filled' | 'outline' | 'text';
|
|
@@ -62,6 +66,31 @@ declare interface GetPositionResult {
|
|
|
62
66
|
bottom: string;
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A component that allows the user to perform actions using an icon
|
|
71
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
|
|
72
|
+
*/
|
|
73
|
+
declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
74
|
+
export { IconButton }
|
|
75
|
+
export { IconButton as IconButton_alias_1 }
|
|
76
|
+
|
|
77
|
+
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
palette?: ButtonProps['palette'];
|
|
80
|
+
usage?: IconButtonUsage;
|
|
81
|
+
shape?: 'circle';
|
|
82
|
+
}
|
|
83
|
+
export { IconButtonProps }
|
|
84
|
+
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This module contains the Icon Button component.
|
|
88
|
+
* @module
|
|
89
|
+
*/
|
|
90
|
+
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
91
|
+
export { IconButtonUsage }
|
|
92
|
+
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
93
|
+
|
|
65
94
|
declare const MODE_KEY = "cerberus-mode";
|
|
66
95
|
export { MODE_KEY }
|
|
67
96
|
export { MODE_KEY as MODE_KEY_alias_1 }
|
|
@@ -14,6 +14,10 @@ declare function Button(props: ButtonProps): JSX.Element;
|
|
|
14
14
|
export { Button }
|
|
15
15
|
export { Button as Button_alias_1 }
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* This module contains the Button component.
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
17
21
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
22
|
palette?: 'action' | 'danger';
|
|
19
23
|
usage?: 'filled' | 'outline' | 'text';
|
|
@@ -62,6 +66,31 @@ declare interface GetPositionResult {
|
|
|
62
66
|
bottom: string;
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A component that allows the user to perform actions using an icon
|
|
71
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
|
|
72
|
+
*/
|
|
73
|
+
declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
74
|
+
export { IconButton }
|
|
75
|
+
export { IconButton as IconButton_alias_1 }
|
|
76
|
+
|
|
77
|
+
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
palette?: ButtonProps['palette'];
|
|
80
|
+
usage?: IconButtonUsage;
|
|
81
|
+
shape?: 'circle';
|
|
82
|
+
}
|
|
83
|
+
export { IconButtonProps }
|
|
84
|
+
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This module contains the Icon Button component.
|
|
88
|
+
* @module
|
|
89
|
+
*/
|
|
90
|
+
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
91
|
+
export { IconButtonUsage }
|
|
92
|
+
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
93
|
+
|
|
65
94
|
declare const MODE_KEY = "cerberus-mode";
|
|
66
95
|
export { MODE_KEY }
|
|
67
96
|
export { MODE_KEY as MODE_KEY_alias_1 }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAAuB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAAuB;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,uBAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outline' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/IconButton.tsx
|
|
21
|
+
var IconButton_exports = {};
|
|
22
|
+
__export(IconButton_exports, {
|
|
23
|
+
IconButton: () => IconButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(IconButton_exports);
|
|
26
|
+
var import_css = require("@cerberus/styled-system/css.cjs");
|
|
27
|
+
var import_recipes = require("@cerberus/styled-system/recipes.cjs");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function IconButton(props) {
|
|
30
|
+
const { ariaLabel, palette, usage, ...nativeProps } = props;
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
...nativeProps,
|
|
35
|
+
"aria-label": ariaLabel ?? "Icon Button",
|
|
36
|
+
className: (0, import_css.cx)(
|
|
37
|
+
nativeProps.className,
|
|
38
|
+
(0, import_recipes.iconButton)({
|
|
39
|
+
palette,
|
|
40
|
+
usage
|
|
41
|
+
})
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
IconButton
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=IconButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: IconButtonUsage\n shape?: 'circle'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAA2B;AAwBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,2BAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/components/IconButton.tsx
|
|
2
|
+
import { cx } from "@cerberus/styled-system/css.js";
|
|
3
|
+
import { iconButton } from "@cerberus/styled-system/recipes.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function IconButton(props) {
|
|
6
|
+
const { ariaLabel, palette, usage, ...nativeProps } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"button",
|
|
9
|
+
{
|
|
10
|
+
...nativeProps,
|
|
11
|
+
"aria-label": ariaLabel ?? "Icon Button",
|
|
12
|
+
className: cx(
|
|
13
|
+
nativeProps.className,
|
|
14
|
+
iconButton({
|
|
15
|
+
palette,
|
|
16
|
+
usage
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
IconButton
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: IconButtonUsage\n shape?: 'circle'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAwBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/modern/index.cjs
CHANGED
|
@@ -18,6 +18,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
18
18
|
var src_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(src_exports);
|
|
20
20
|
__reExport(src_exports, require("./components/Button.cjs"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./components/IconButton.cjs"), module.exports);
|
|
21
22
|
__reExport(src_exports, require("./components/NavMenuTrigger.cjs"), module.exports);
|
|
22
23
|
__reExport(src_exports, require("./components/NavMenuList.cjs"), module.exports);
|
|
23
24
|
__reExport(src_exports, require("./components/NavMenuLink.cjs"), module.exports);
|
|
@@ -31,6 +32,7 @@ __reExport(src_exports, require("./types.cjs"), module.exports);
|
|
|
31
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
33
|
0 && (module.exports = {
|
|
33
34
|
...require("./components/Button.cjs"),
|
|
35
|
+
...require("./components/IconButton.cjs"),
|
|
34
36
|
...require("./components/NavMenuTrigger.cjs"),
|
|
35
37
|
...require("./components/NavMenuList.cjs"),
|
|
36
38
|
...require("./components/NavMenuLink.cjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/IconButton'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,wBAAc,oCAPd;AAQA,wBAAc,wCARd;AASA,wBAAc,4CATd;AAUA,wBAAc,yCAVd;AAWA,wBAAc,yCAXd;AAYA,wBAAc,kCAZd;AAgBA,wBAAc,gCAhBd;AAiBA,wBAAc,kCAjBd;AAkBA,wBAAc,gCAlBd;AAsBA,wBAAc,iCAtBd;AA0BA,wBAAc,6CA1Bd;AA8BA,wBAAc,wBA9Bd;","names":[]}
|
package/build/modern/index.d.cts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { IconButton } from './_tsup-dts-rollup';
|
|
4
|
+
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
|
+
export { IconButtonProps } from './_tsup-dts-rollup';
|
|
3
6
|
export { NavMenuTrigger } from './_tsup-dts-rollup';
|
|
4
7
|
export { NavMenuTriggerProps } from './_tsup-dts-rollup';
|
|
5
8
|
export { getPosition } from './_tsup-dts-rollup';
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { IconButton } from './_tsup-dts-rollup';
|
|
4
|
+
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
|
+
export { IconButtonProps } from './_tsup-dts-rollup';
|
|
3
6
|
export { NavMenuTrigger } from './_tsup-dts-rollup';
|
|
4
7
|
export { NavMenuTriggerProps } from './_tsup-dts-rollup';
|
|
5
8
|
export { getPosition } from './_tsup-dts-rollup';
|
package/build/modern/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// components\n\nexport * from './components/Button'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Button'\nexport * from './components/IconButton'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\n\n// shared types\n\nexport * from './types'\n"],"mappings":";AAOA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAId,cAAc;AAId,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-next-1ab8194",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react-dom": "^18",
|
|
22
22
|
"tsup": "^8.0.2",
|
|
23
23
|
"@cerberus-design/configs": "0.0.0",
|
|
24
|
-
"@cerberus-design/styled-system": "0.0
|
|
24
|
+
"@cerberus-design/styled-system": "0.1.0-next-1ab8194"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
@@ -2,6 +2,11 @@ import type { ButtonHTMLAttributes } from 'react'
|
|
|
2
2
|
import { cx } from '@cerberus/styled-system/css'
|
|
3
3
|
import { button } from '@cerberus/styled-system/recipes'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* This module contains the Button component.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
|
|
5
10
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
11
|
palette?: 'action' | 'danger'
|
|
7
12
|
usage?: 'filled' | 'outline' | 'text'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes } from 'react'
|
|
2
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
3
|
+
import { iconButton } from '@cerberus/styled-system/recipes'
|
|
4
|
+
import type { ButtonProps } from './Button'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This module contains the Icon Button component.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>
|
|
12
|
+
export interface IconButtonProps
|
|
13
|
+
extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
|
+
ariaLabel: string
|
|
15
|
+
palette?: ButtonProps['palette']
|
|
16
|
+
usage?: IconButtonUsage
|
|
17
|
+
shape?: 'circle'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A component that allows the user to perform actions using an icon
|
|
22
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
|
|
23
|
+
*/
|
|
24
|
+
export function IconButton(props: IconButtonProps): JSX.Element {
|
|
25
|
+
const { ariaLabel, palette, usage, ...nativeProps } = props
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
{...nativeProps}
|
|
29
|
+
aria-label={ariaLabel ?? 'Icon Button'}
|
|
30
|
+
className={cx(
|
|
31
|
+
nativeProps.className,
|
|
32
|
+
iconButton({
|
|
33
|
+
palette,
|
|
34
|
+
usage,
|
|
35
|
+
}),
|
|
36
|
+
)}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module is the entry point for the Cerberus React package.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
// components
|
|
2
7
|
|
|
3
8
|
export * from './components/Button'
|
|
9
|
+
export * from './components/IconButton'
|
|
4
10
|
export * from './components/NavMenuTrigger'
|
|
5
11
|
export * from './components/NavMenuList'
|
|
6
12
|
export * from './components/NavMenuLink'
|