@cerberus-design/react 0.5.2-next-1cb6180 → 0.5.2-next-e2a5ae0
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 +6 -10
- package/build/legacy/aria-helpers/tabs.aria.js +1 -1
- package/build/{modern/chunk-R4H3352X.js → legacy/chunk-4O4QFF4S.js} +2 -3
- package/build/legacy/{chunk-R4H3352X.js.map → chunk-4O4QFF4S.js.map} +1 -1
- package/build/legacy/{chunk-JA4IX7GN.js → chunk-6DIGPXAD.js} +2 -2
- package/build/legacy/{chunk-WSQTX34C.js → chunk-G2QMBSK5.js} +2 -2
- package/build/{modern/chunk-NIMWIOIA.js → legacy/chunk-GQSXLQOD.js} +1 -1
- package/build/legacy/chunk-GQSXLQOD.js.map +1 -0
- package/build/{modern/chunk-LD5ZV46F.js → legacy/chunk-KO7LBJGB.js} +2 -2
- package/build/legacy/{chunk-XFWARXLU.js → chunk-LQHCCI4H.js} +1 -1
- package/build/legacy/chunk-LQHCCI4H.js.map +1 -0
- package/build/{modern/chunk-OXVNTE4A.js → legacy/chunk-PFY74S3Z.js} +2 -2
- package/build/{modern/chunk-7BXBIDZB.js → legacy/chunk-QILSE3K3.js} +2 -2
- package/build/legacy/{chunk-MJB3V6J4.js → chunk-RPZAPUCF.js} +3 -4
- package/build/legacy/{chunk-MJB3V6J4.js.map → chunk-RPZAPUCF.js.map} +1 -1
- package/build/legacy/{chunk-BT2B5C7M.js → chunk-S7HBD2A7.js} +2 -3
- package/build/legacy/{chunk-BT2B5C7M.js.map → chunk-S7HBD2A7.js.map} +1 -1
- package/build/legacy/{chunk-MYRKQVDI.js → chunk-YA2UV2AB.js} +2 -2
- package/build/legacy/{chunk-SVZU6LPF.js → chunk-YJCWUN33.js} +2 -2
- package/build/legacy/components/Button.js +1 -1
- package/build/legacy/components/IconButton.js +1 -1
- package/build/legacy/components/Input.js +2 -2
- package/build/legacy/components/Label.js +2 -2
- package/build/legacy/components/NavMenuLink.js +2 -2
- package/build/legacy/components/NavMenuList.js +2 -2
- package/build/legacy/components/NavMenuTrigger.js +2 -2
- package/build/legacy/components/Show.js +1 -1
- package/build/legacy/components/Tab.js +2 -2
- package/build/legacy/components/TabPanel.js +2 -2
- package/build/legacy/components/Tag.js +2 -2
- package/build/legacy/index.js +12 -12
- package/build/legacy/noExternals.d.ts +1 -0
- package/build/modern/_tsup-dts-rollup.d.ts +6 -10
- package/build/modern/aria-helpers/tabs.aria.js +1 -1
- package/build/{legacy/chunk-R4H3352X.js → modern/chunk-4O4QFF4S.js} +2 -3
- package/build/modern/{chunk-R4H3352X.js.map → chunk-4O4QFF4S.js.map} +1 -1
- package/build/modern/{chunk-JA4IX7GN.js → chunk-6DIGPXAD.js} +2 -2
- package/build/modern/{chunk-WSQTX34C.js → chunk-G2QMBSK5.js} +2 -2
- package/build/{legacy/chunk-NIMWIOIA.js → modern/chunk-GQSXLQOD.js} +1 -1
- package/build/modern/chunk-GQSXLQOD.js.map +1 -0
- package/build/{legacy/chunk-LD5ZV46F.js → modern/chunk-KO7LBJGB.js} +2 -2
- package/build/modern/{chunk-XFWARXLU.js → chunk-LQHCCI4H.js} +1 -1
- package/build/modern/chunk-LQHCCI4H.js.map +1 -0
- package/build/{legacy/chunk-OXVNTE4A.js → modern/chunk-PFY74S3Z.js} +2 -2
- package/build/{legacy/chunk-7BXBIDZB.js → modern/chunk-QILSE3K3.js} +2 -2
- package/build/modern/{chunk-MJB3V6J4.js → chunk-RPZAPUCF.js} +3 -4
- package/build/modern/{chunk-MJB3V6J4.js.map → chunk-RPZAPUCF.js.map} +1 -1
- package/build/modern/{chunk-BT2B5C7M.js → chunk-S7HBD2A7.js} +2 -3
- package/build/modern/{chunk-BT2B5C7M.js.map → chunk-S7HBD2A7.js.map} +1 -1
- package/build/modern/{chunk-IQP6HSC4.js → chunk-SUP7U42W.js} +2 -2
- package/build/modern/{chunk-SVZU6LPF.js → chunk-YJCWUN33.js} +2 -2
- package/build/modern/components/Button.js +1 -1
- package/build/modern/components/IconButton.js +1 -1
- package/build/modern/components/Input.js +2 -2
- package/build/modern/components/Label.js +2 -2
- package/build/modern/components/NavMenuLink.js +2 -2
- package/build/modern/components/NavMenuList.js +2 -2
- package/build/modern/components/NavMenuTrigger.js +2 -2
- package/build/modern/components/Show.js +1 -1
- package/build/modern/components/Tab.js +2 -2
- package/build/modern/components/TabPanel.js +2 -2
- package/build/modern/components/Tag.js +2 -2
- package/build/modern/index.js +12 -12
- package/build/modern/noExternals.d.ts +1 -0
- package/package.json +6 -5
- package/src/components/Button.tsx +1 -1
- package/src/components/IconButton.tsx +1 -2
- package/build/legacy/aria-helpers/nav-menu.aria.d.ts +0 -2
- package/build/legacy/aria-helpers/tabs.aria.d.ts +0 -1
- package/build/legacy/chunk-NIMWIOIA.js.map +0 -1
- package/build/legacy/chunk-XFWARXLU.js.map +0 -1
- package/build/legacy/components/Button.d.ts +0 -2
- package/build/legacy/components/FieldMessage.d.ts +0 -2
- package/build/legacy/components/IconButton.d.ts +0 -3
- package/build/legacy/components/Input.d.ts +0 -2
- package/build/legacy/components/Label.d.ts +0 -2
- package/build/legacy/components/NavMenuLink.d.ts +0 -2
- package/build/legacy/components/NavMenuList.d.ts +0 -3
- package/build/legacy/components/NavMenuTrigger.d.ts +0 -2
- package/build/legacy/components/Show.d.ts +0 -2
- package/build/legacy/components/Tab.d.ts +0 -2
- package/build/legacy/components/TabList.d.ts +0 -2
- package/build/legacy/components/TabPanel.d.ts +0 -2
- package/build/legacy/components/Tag.d.ts +0 -4
- package/build/legacy/components/Textarea.d.ts +0 -2
- package/build/legacy/context/field.d.ts +0 -3
- package/build/legacy/context/navMenu.d.ts +0 -5
- package/build/legacy/context/tabs.d.ts +0 -5
- package/build/legacy/context/theme.d.ts +0 -8
- package/build/legacy/hooks/useTheme.d.ts +0 -1
- package/build/legacy/index.d.ts +0 -58
- package/build/legacy/types.d.ts +0 -1
- package/build/modern/aria-helpers/nav-menu.aria.d.ts +0 -2
- package/build/modern/aria-helpers/tabs.aria.d.ts +0 -1
- package/build/modern/chunk-NIMWIOIA.js.map +0 -1
- package/build/modern/chunk-XFWARXLU.js.map +0 -1
- package/build/modern/components/Button.d.ts +0 -2
- package/build/modern/components/FieldMessage.d.ts +0 -2
- package/build/modern/components/IconButton.d.ts +0 -3
- package/build/modern/components/Input.d.ts +0 -2
- package/build/modern/components/Label.d.ts +0 -2
- package/build/modern/components/NavMenuLink.d.ts +0 -2
- package/build/modern/components/NavMenuList.d.ts +0 -3
- package/build/modern/components/NavMenuTrigger.d.ts +0 -2
- package/build/modern/components/Show.d.ts +0 -2
- package/build/modern/components/Tab.d.ts +0 -2
- package/build/modern/components/TabList.d.ts +0 -2
- package/build/modern/components/TabPanel.d.ts +0 -2
- package/build/modern/components/Tag.d.ts +0 -4
- package/build/modern/components/Textarea.d.ts +0 -2
- package/build/modern/context/field.d.ts +0 -3
- package/build/modern/context/navMenu.d.ts +0 -5
- package/build/modern/context/tabs.d.ts +0 -5
- package/build/modern/context/theme.d.ts +0 -8
- package/build/modern/hooks/useTheme.d.ts +0 -1
- package/build/modern/index.d.ts +0 -58
- package/build/modern/types.d.ts +0 -1
- /package/build/legacy/{chunk-JA4IX7GN.js.map → chunk-6DIGPXAD.js.map} +0 -0
- /package/build/legacy/{chunk-WSQTX34C.js.map → chunk-G2QMBSK5.js.map} +0 -0
- /package/build/legacy/{chunk-LD5ZV46F.js.map → chunk-KO7LBJGB.js.map} +0 -0
- /package/build/legacy/{chunk-OXVNTE4A.js.map → chunk-PFY74S3Z.js.map} +0 -0
- /package/build/legacy/{chunk-7BXBIDZB.js.map → chunk-QILSE3K3.js.map} +0 -0
- /package/build/legacy/{chunk-MYRKQVDI.js.map → chunk-YA2UV2AB.js.map} +0 -0
- /package/build/legacy/{chunk-SVZU6LPF.js.map → chunk-YJCWUN33.js.map} +0 -0
- /package/build/modern/{chunk-JA4IX7GN.js.map → chunk-6DIGPXAD.js.map} +0 -0
- /package/build/modern/{chunk-WSQTX34C.js.map → chunk-G2QMBSK5.js.map} +0 -0
- /package/build/modern/{chunk-LD5ZV46F.js.map → chunk-KO7LBJGB.js.map} +0 -0
- /package/build/modern/{chunk-OXVNTE4A.js.map → chunk-PFY74S3Z.js.map} +0 -0
- /package/build/modern/{chunk-7BXBIDZB.js.map → chunk-QILSE3K3.js.map} +0 -0
- /package/build/modern/{chunk-IQP6HSC4.js.map → chunk-SUP7U42W.js.map} +0 -0
- /package/build/modern/{chunk-SVZU6LPF.js.map → chunk-YJCWUN33.js.map} +0 -0
|
@@ -26,7 +26,7 @@ export { Button as Button_alias_1 }
|
|
|
26
26
|
*/
|
|
27
27
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
28
|
palette?: 'action' | 'danger';
|
|
29
|
-
usage?: 'filled' | '
|
|
29
|
+
usage?: 'filled' | 'outlined' | 'text';
|
|
30
30
|
shape?: 'sharp' | 'rounded';
|
|
31
31
|
}
|
|
32
32
|
export { ButtonProps }
|
|
@@ -117,10 +117,14 @@ declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
|
117
117
|
export { IconButton }
|
|
118
118
|
export { IconButton as IconButton_alias_1 }
|
|
119
119
|
|
|
120
|
+
/**
|
|
121
|
+
* This module contains the Icon Button component.
|
|
122
|
+
* @module
|
|
123
|
+
*/
|
|
120
124
|
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
121
125
|
ariaLabel: string;
|
|
122
126
|
palette?: ButtonProps['palette'];
|
|
123
|
-
usage?:
|
|
127
|
+
usage?: ButtonProps['usage'];
|
|
124
128
|
shape?: 'circle';
|
|
125
129
|
size?: 'sm' | 'lg';
|
|
126
130
|
tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -128,14 +132,6 @@ declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement
|
|
|
128
132
|
export { IconButtonProps }
|
|
129
133
|
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
130
134
|
|
|
131
|
-
/**
|
|
132
|
-
* This module contains the Icon Button component.
|
|
133
|
-
* @module
|
|
134
|
-
*/
|
|
135
|
-
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
136
|
-
export { IconButtonUsage }
|
|
137
|
-
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
138
|
-
|
|
139
135
|
declare function Input(props: InputProps): JSX_2.Element;
|
|
140
136
|
export { Input }
|
|
141
137
|
export { Input as Input_alias_1 }
|
|
@@ -4,8 +4,7 @@ function Show(props) {
|
|
|
4
4
|
const { when, children, fallback } = props;
|
|
5
5
|
const condition = useMemo(() => when ?? false, [when]);
|
|
6
6
|
return useMemo(() => {
|
|
7
|
-
if (condition)
|
|
8
|
-
return children;
|
|
7
|
+
if (condition) return children;
|
|
9
8
|
return fallback ?? null;
|
|
10
9
|
}, [condition, children, fallback]);
|
|
11
10
|
}
|
|
@@ -13,4 +12,4 @@ function Show(props) {
|
|
|
13
12
|
export {
|
|
14
13
|
Show
|
|
15
14
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-4O4QFF4S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI
|
|
1
|
+
{"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
|
|
5
5
|
// src/components/NavMenuLink.tsx
|
|
6
6
|
import { css, cx } from "@cerberus/styled-system/css";
|
|
@@ -45,4 +45,4 @@ function NavMenuLink(props) {
|
|
|
45
45
|
export {
|
|
46
46
|
NavMenuLink
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-6DIGPXAD.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KJUCHZHV.js";
|
|
4
4
|
import {
|
|
5
5
|
Show
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4O4QFF4S.js";
|
|
7
7
|
|
|
8
8
|
// src/components/NavMenuList.tsx
|
|
9
9
|
import { useMemo } from "react";
|
|
@@ -83,4 +83,4 @@ export {
|
|
|
83
83
|
getPosition,
|
|
84
84
|
NavMenuList
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-G2QMBSK5.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 interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: ButtonProps['usage']\n shape?: 'circle'\n size?: 'sm' | 'lg'\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\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, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAyBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
import {
|
|
5
5
|
useFieldContext
|
|
6
6
|
} from "./chunk-ZAU4JVLL.js";
|
|
@@ -32,4 +32,4 @@ function Input(props) {
|
|
|
32
32
|
export {
|
|
33
33
|
Input
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-KO7LBJGB.js.map
|
|
@@ -0,0 +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\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' | 'outlined' | '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":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
import {
|
|
5
5
|
useFieldContext
|
|
6
6
|
} from "./chunk-ZAU4JVLL.js";
|
|
@@ -45,4 +45,4 @@ function Label(props) {
|
|
|
45
45
|
export {
|
|
46
46
|
Label
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-PFY74S3Z.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
|
|
5
5
|
// src/components/Tag.tsx
|
|
6
6
|
import { Close } from "@cerberus/icons";
|
|
@@ -52,4 +52,4 @@ function Tag(props) {
|
|
|
52
52
|
export {
|
|
53
53
|
Tag
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-QILSE3K3.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KJUCHZHV.js";
|
|
4
4
|
import {
|
|
5
5
|
Show
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4O4QFF4S.js";
|
|
7
7
|
import {
|
|
8
8
|
createNavTriggerProps
|
|
9
9
|
} from "./chunk-JF76VIL3.js";
|
|
@@ -35,8 +35,7 @@ function NavMenuTrigger(props) {
|
|
|
35
35
|
const AsSub = as;
|
|
36
36
|
const handleClick = useCallback(
|
|
37
37
|
(e) => {
|
|
38
|
-
if (onClick)
|
|
39
|
-
return onClick(e);
|
|
38
|
+
if (onClick) return onClick(e);
|
|
40
39
|
onToggle();
|
|
41
40
|
},
|
|
42
41
|
[onClick, onToggle]
|
|
@@ -79,4 +78,4 @@ function NavMenuTrigger(props) {
|
|
|
79
78
|
export {
|
|
80
79
|
NavMenuTrigger
|
|
81
80
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-RPZAPUCF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\nimport {\n createNavTriggerProps,\n type NavTriggerAriaValues,\n} from '../aria-helpers/nav-menu.aria'\nimport { useNavMenuContext } from '../context/navMenu'\nimport type { ButtonProps } from './Button'\nimport { Show } from './Show'\n\nexport interface NavMenuTriggerProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonProps,\n NavTriggerAriaValues {\n as?: ElementType\n}\n\n/**\n * A component that allows the user to trigger a navigation menu.\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n * @example\n * ```tsx\n * <NavMenu>\n * <NavMenuTrigger controls=\"nav-menu-list\">\n * Menu\n * </NavMenuTrigger>\n * </NavMenu>\n * ```\n */\nexport function NavMenuTrigger(props: NavMenuTriggerProps): JSX.Element {\n const {\n as,\n palette,\n usage,\n shape,\n controls,\n expanded: propsExpanded,\n onClick,\n ...nativeProps\n } = props\n const { triggerRef, onToggle, expanded } = useNavMenuContext()\n const ariaProps = createNavTriggerProps({\n controls,\n expanded: propsExpanded ?? expanded,\n })\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n if (onClick) return onClick(e)\n onToggle()\n },\n [onClick, onToggle],\n )\n\n return (\n <Show\n when={hasAs}\n fallback={\n <button\n {...nativeProps}\n {...ariaProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n onClick={handleClick}\n ref={triggerRef}\n >\n {props.children}\n </button>\n }\n >\n {hasAs && (\n <AsSub\n {...nativeProps}\n {...ariaProps}\n onClick={handleClick}\n ref={triggerRef}\n />\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAEA;AAAA,EACE;AAAA,OAIK;AACP,SAAS,UAAU;AACnB,SAAS,cAAc;AA2Df;AA/BD,SAAS,eAAe,OAAyC;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,YAAY,UAAU,SAAS,IAAI,kBAAkB;AAC7D,QAAM,YAAY,sBAAsB;AAAA,IACtC;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC;AACD,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,QAAM,cAAc;AAAA,IAClB,CAAC,MAAqC;AACpC,UAAI
|
|
1
|
+
{"version":3,"sources":["../../src/components/NavMenuTrigger.tsx"],"sourcesContent":["'use client'\n\nimport {\n useCallback,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n} from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\nimport {\n createNavTriggerProps,\n type NavTriggerAriaValues,\n} from '../aria-helpers/nav-menu.aria'\nimport { useNavMenuContext } from '../context/navMenu'\nimport type { ButtonProps } from './Button'\nimport { Show } from './Show'\n\nexport interface NavMenuTriggerProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonProps,\n NavTriggerAriaValues {\n as?: ElementType\n}\n\n/**\n * A component that allows the user to trigger a navigation menu.\n * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)\n * @example\n * ```tsx\n * <NavMenu>\n * <NavMenuTrigger controls=\"nav-menu-list\">\n * Menu\n * </NavMenuTrigger>\n * </NavMenu>\n * ```\n */\nexport function NavMenuTrigger(props: NavMenuTriggerProps): JSX.Element {\n const {\n as,\n palette,\n usage,\n shape,\n controls,\n expanded: propsExpanded,\n onClick,\n ...nativeProps\n } = props\n const { triggerRef, onToggle, expanded } = useNavMenuContext()\n const ariaProps = createNavTriggerProps({\n controls,\n expanded: propsExpanded ?? expanded,\n })\n const hasAs = Boolean(as)\n const AsSub: ElementType = as!\n\n const handleClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n if (onClick) return onClick(e)\n onToggle()\n },\n [onClick, onToggle],\n )\n\n return (\n <Show\n when={hasAs}\n fallback={\n <button\n {...nativeProps}\n {...ariaProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n onClick={handleClick}\n ref={triggerRef}\n >\n {props.children}\n </button>\n }\n >\n {hasAs && (\n <AsSub\n {...nativeProps}\n {...ariaProps}\n onClick={handleClick}\n ref={triggerRef}\n />\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;AAEA;AAAA,EACE;AAAA,OAIK;AACP,SAAS,UAAU;AACnB,SAAS,cAAc;AA2Df;AA/BD,SAAS,eAAe,OAAyC;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,EAAE,YAAY,UAAU,SAAS,IAAI,kBAAkB;AAC7D,QAAM,YAAY,sBAAsB;AAAA,IACtC;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC;AACD,QAAM,QAAQ,QAAQ,EAAE;AACxB,QAAM,QAAqB;AAE3B,QAAM,cAAc;AAAA,IAClB,CAAC,MAAqC;AACpC,UAAI,QAAS,QAAO,QAAQ,CAAC;AAC7B,eAAS;AAAA,IACX;AAAA,IACA,CAAC,SAAS,QAAQ;AAAA,EACpB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,UACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,WAAW;AAAA,YACT,YAAY;AAAA,YACZ,OAAO;AAAA,cACL;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,UACH;AAAA,UACA,SAAS;AAAA,UACT,KAAK;AAAA,UAEJ,gBAAM;AAAA;AAAA,MACT;AAAA,MAGD,mBACC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACH,GAAG;AAAA,UACJ,SAAS;AAAA,UACT,KAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -18,8 +18,7 @@ function useTabsKeyboardNavigation() {
|
|
|
18
18
|
const index = activeTab === -1 ? tabs.current.findIndex((tab) => tab.ariaSelected === "true") : activeTab;
|
|
19
19
|
const nextIndex = getNextIndex(index, tabs.current.length);
|
|
20
20
|
const prevIndex = getPrevIndex(index, tabs.current.length);
|
|
21
|
-
if (index === -1)
|
|
22
|
-
return;
|
|
21
|
+
if (index === -1) return;
|
|
23
22
|
switch (event.key) {
|
|
24
23
|
case "ArrowLeft":
|
|
25
24
|
event.preventDefault();
|
|
@@ -62,4 +61,4 @@ function useTabsKeyboardNavigation() {
|
|
|
62
61
|
export {
|
|
63
62
|
useTabsKeyboardNavigation
|
|
64
63
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-S7HBD2A7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/aria-helpers/tabs.aria.ts"],"sourcesContent":["'use client'\n\nimport { useEffect, useState } from 'react'\nimport { useTabsContext } from '../context/tabs'\n\nfunction getNextIndex(index: number, length: number) {\n return index === length - 1 ? 0 : index + 1\n}\n\nfunction getPrevIndex(index: number, length: number) {\n return index === 0 ? length - 1 : index - 1\n}\n\nexport function useTabsKeyboardNavigation() {\n const { tabs } = useTabsContext()\n const [activeTab, setActiveTab] = useState(-1)\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const index =\n activeTab === -1\n ? tabs.current.findIndex((tab) => tab.ariaSelected === 'true')\n : activeTab\n const nextIndex = getNextIndex(index, tabs.current.length)\n const prevIndex = getPrevIndex(index, tabs.current.length)\n\n // If the active tab is not found, do nothing\n if (index === -1) return\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault()\n setActiveTab(prevIndex)\n tabs.current[prevIndex].focus()\n break\n case 'ArrowRight':\n event.preventDefault()\n setActiveTab(nextIndex)\n tabs.current[nextIndex].focus()\n break\n case 'Home':\n event.preventDefault()\n setActiveTab(0)\n tabs.current[0].focus()\n break\n case 'End':\n event.preventDefault()\n setActiveTab(tabs.current.length - 1)\n tabs.current[tabs.current.length - 1].focus()\n break\n default:\n break\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [activeTab, tabs.current])\n\n return {\n ref: (tab: HTMLButtonElement) => {\n if (tab && !tabs.current.includes(tab)) {\n tabs.current.push(tab)\n }\n },\n }\n}\n"],"mappings":";;;;;AAEA,SAAS,WAAW,gBAAgB;AAGpC,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,SAAS,IAAI,IAAI,QAAQ;AAC5C;AAEA,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,IAAI,SAAS,IAAI,QAAQ;AAC5C;AAEO,SAAS,4BAA4B;AAC1C,QAAM,EAAE,KAAK,IAAI,eAAe;AAChC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAE7C,YAAU,MAAM;AACd,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,YAAM,QACJ,cAAc,KACV,KAAK,QAAQ,UAAU,CAAC,QAAQ,IAAI,iBAAiB,MAAM,IAC3D;AACN,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AACzD,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AAGzD,UAAI,UAAU;
|
|
1
|
+
{"version":3,"sources":["../../src/aria-helpers/tabs.aria.ts"],"sourcesContent":["'use client'\n\nimport { useEffect, useState } from 'react'\nimport { useTabsContext } from '../context/tabs'\n\nfunction getNextIndex(index: number, length: number) {\n return index === length - 1 ? 0 : index + 1\n}\n\nfunction getPrevIndex(index: number, length: number) {\n return index === 0 ? length - 1 : index - 1\n}\n\nexport function useTabsKeyboardNavigation() {\n const { tabs } = useTabsContext()\n const [activeTab, setActiveTab] = useState(-1)\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const index =\n activeTab === -1\n ? tabs.current.findIndex((tab) => tab.ariaSelected === 'true')\n : activeTab\n const nextIndex = getNextIndex(index, tabs.current.length)\n const prevIndex = getPrevIndex(index, tabs.current.length)\n\n // If the active tab is not found, do nothing\n if (index === -1) return\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault()\n setActiveTab(prevIndex)\n tabs.current[prevIndex].focus()\n break\n case 'ArrowRight':\n event.preventDefault()\n setActiveTab(nextIndex)\n tabs.current[nextIndex].focus()\n break\n case 'Home':\n event.preventDefault()\n setActiveTab(0)\n tabs.current[0].focus()\n break\n case 'End':\n event.preventDefault()\n setActiveTab(tabs.current.length - 1)\n tabs.current[tabs.current.length - 1].focus()\n break\n default:\n break\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [activeTab, tabs.current])\n\n return {\n ref: (tab: HTMLButtonElement) => {\n if (tab && !tabs.current.includes(tab)) {\n tabs.current.push(tab)\n }\n },\n }\n}\n"],"mappings":";;;;;AAEA,SAAS,WAAW,gBAAgB;AAGpC,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,SAAS,IAAI,IAAI,QAAQ;AAC5C;AAEA,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,IAAI,SAAS,IAAI,QAAQ;AAC5C;AAEO,SAAS,4BAA4B;AAC1C,QAAM,EAAE,KAAK,IAAI,eAAe;AAChC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAE7C,YAAU,MAAM;AACd,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,YAAM,QACJ,cAAc,KACV,KAAK,QAAQ,UAAU,CAAC,QAAQ,IAAI,iBAAiB,MAAM,IAC3D;AACN,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AACzD,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AAGzD,UAAI,UAAU,GAAI;AAElB,cAAQ,MAAM,KAAK;AAAA,QACjB,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,eAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,eAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,CAAC;AACd,eAAK,QAAQ,CAAC,EAAE,MAAM;AACtB;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,KAAK,QAAQ,SAAS,CAAC;AACpC,eAAK,QAAQ,KAAK,QAAQ,SAAS,CAAC,EAAE,MAAM;AAC5C;AAAA,QACF;AACE;AAAA,MACJ;AAAA,IACF;AAEA,aAAS,iBAAiB,WAAW,aAAa;AAElD,WAAO,MAAM;AACX,eAAS,oBAAoB,WAAW,aAAa;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,OAAO,CAAC;AAE5B,SAAO;AAAA,IACL,KAAK,CAAC,QAA2B;AAC/B,UAAI,OAAO,CAAC,KAAK,QAAQ,SAAS,GAAG,GAAG;AACtC,aAAK,QAAQ,KAAK,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useTabsKeyboardNavigation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7HBD2A7.js";
|
|
4
4
|
import {
|
|
5
5
|
useTabsContext
|
|
6
6
|
} from "./chunk-DQOYTLGB.js";
|
|
@@ -123,4 +123,4 @@ var btnStyles = css({
|
|
|
123
123
|
export {
|
|
124
124
|
Tab
|
|
125
125
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-YA2UV2AB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
import {
|
|
5
5
|
useTabsContext
|
|
6
6
|
} from "./chunk-DQOYTLGB.js";
|
|
@@ -40,4 +40,4 @@ function TabPanel(props) {
|
|
|
40
40
|
export {
|
|
41
41
|
TabPanel
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-YJCWUN33.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
NavMenuTrigger
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RPZAPUCF.js";
|
|
5
5
|
import "../chunk-KJUCHZHV.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4O4QFF4S.js";
|
|
7
7
|
import "../chunk-JF76VIL3.js";
|
|
8
8
|
export {
|
|
9
9
|
NavMenuTrigger
|
package/build/legacy/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TabPanel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YJCWUN33.js";
|
|
4
4
|
import {
|
|
5
5
|
Tag
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QILSE3K3.js";
|
|
7
7
|
import {
|
|
8
8
|
Textarea
|
|
9
9
|
} from "./chunk-5TBINKAO.js";
|
|
10
10
|
import {
|
|
11
11
|
Input
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KO7LBJGB.js";
|
|
13
13
|
import {
|
|
14
14
|
Label
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PFY74S3Z.js";
|
|
16
16
|
import {
|
|
17
17
|
NavMenuLink
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6DIGPXAD.js";
|
|
19
19
|
import {
|
|
20
20
|
NavMenuList,
|
|
21
21
|
getPosition
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-G2QMBSK5.js";
|
|
23
23
|
import {
|
|
24
24
|
NavMenuTrigger
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RPZAPUCF.js";
|
|
26
26
|
import {
|
|
27
27
|
NavMenu,
|
|
28
28
|
useNavMenuContext
|
|
29
29
|
} from "./chunk-KJUCHZHV.js";
|
|
30
30
|
import {
|
|
31
31
|
Show
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4O4QFF4S.js";
|
|
33
33
|
import {
|
|
34
34
|
Tab
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YA2UV2AB.js";
|
|
36
36
|
import {
|
|
37
37
|
TabList
|
|
38
38
|
} from "./chunk-5GSXIYD3.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-JF76VIL3.js";
|
|
43
43
|
import {
|
|
44
44
|
useTabsKeyboardNavigation
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-S7HBD2A7.js";
|
|
46
46
|
import {
|
|
47
47
|
Tabs,
|
|
48
48
|
TabsContext,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
} from "./chunk-SXXWC6UD.js";
|
|
58
58
|
import {
|
|
59
59
|
Button
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-LQHCCI4H.js";
|
|
61
61
|
import {
|
|
62
62
|
FieldMessage
|
|
63
63
|
} from "./chunk-YVUZSAJG.js";
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
} from "./chunk-ZAU4JVLL.js";
|
|
68
68
|
import {
|
|
69
69
|
IconButton
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-GQSXLQOD.js";
|
|
71
71
|
export {
|
|
72
72
|
Button,
|
|
73
73
|
Field,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,7 @@ export { Button as Button_alias_1 }
|
|
|
26
26
|
*/
|
|
27
27
|
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
28
|
palette?: 'action' | 'danger';
|
|
29
|
-
usage?: 'filled' | '
|
|
29
|
+
usage?: 'filled' | 'outlined' | 'text';
|
|
30
30
|
shape?: 'sharp' | 'rounded';
|
|
31
31
|
}
|
|
32
32
|
export { ButtonProps }
|
|
@@ -117,10 +117,14 @@ declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
|
117
117
|
export { IconButton }
|
|
118
118
|
export { IconButton as IconButton_alias_1 }
|
|
119
119
|
|
|
120
|
+
/**
|
|
121
|
+
* This module contains the Icon Button component.
|
|
122
|
+
* @module
|
|
123
|
+
*/
|
|
120
124
|
declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
121
125
|
ariaLabel: string;
|
|
122
126
|
palette?: ButtonProps['palette'];
|
|
123
|
-
usage?:
|
|
127
|
+
usage?: ButtonProps['usage'];
|
|
124
128
|
shape?: 'circle';
|
|
125
129
|
size?: 'sm' | 'lg';
|
|
126
130
|
tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -128,14 +132,6 @@ declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement
|
|
|
128
132
|
export { IconButtonProps }
|
|
129
133
|
export { IconButtonProps as IconButtonProps_alias_1 }
|
|
130
134
|
|
|
131
|
-
/**
|
|
132
|
-
* This module contains the Icon Button component.
|
|
133
|
-
* @module
|
|
134
|
-
*/
|
|
135
|
-
declare type IconButtonUsage = Exclude<ButtonProps['usage'], 'outline'>;
|
|
136
|
-
export { IconButtonUsage }
|
|
137
|
-
export { IconButtonUsage as IconButtonUsage_alias_1 }
|
|
138
|
-
|
|
139
135
|
declare function Input(props: InputProps): JSX_2.Element;
|
|
140
136
|
export { Input }
|
|
141
137
|
export { Input as Input_alias_1 }
|
|
@@ -4,8 +4,7 @@ function Show(props) {
|
|
|
4
4
|
const { when, children, fallback } = props;
|
|
5
5
|
const condition = useMemo(() => when ?? false, [when]);
|
|
6
6
|
return useMemo(() => {
|
|
7
|
-
if (condition)
|
|
8
|
-
return children;
|
|
7
|
+
if (condition) return children;
|
|
9
8
|
return fallback ?? null;
|
|
10
9
|
}, [condition, children, fallback]);
|
|
11
10
|
}
|
|
@@ -13,4 +12,4 @@ function Show(props) {
|
|
|
13
12
|
export {
|
|
14
13
|
Show
|
|
15
14
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-4O4QFF4S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI
|
|
1
|
+
{"version":3,"sources":["../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";AAEA,SAAS,eAAuD;AAiBzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,YAAY,QAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,SAAO,QAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
|
|
5
5
|
// src/components/NavMenuLink.tsx
|
|
6
6
|
import { css, cx } from "@cerberus/styled-system/css";
|
|
@@ -45,4 +45,4 @@ function NavMenuLink(props) {
|
|
|
45
45
|
export {
|
|
46
46
|
NavMenuLink
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-6DIGPXAD.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KJUCHZHV.js";
|
|
4
4
|
import {
|
|
5
5
|
Show
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4O4QFF4S.js";
|
|
7
7
|
|
|
8
8
|
// src/components/NavMenuList.tsx
|
|
9
9
|
import { useMemo } from "react";
|
|
@@ -83,4 +83,4 @@ export {
|
|
|
83
83
|
getPosition,
|
|
84
84
|
NavMenuList
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-G2QMBSK5.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 interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: ButtonProps['usage']\n shape?: 'circle'\n size?: 'sm' | 'lg'\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\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, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAyBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Show
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O4QFF4S.js";
|
|
4
4
|
import {
|
|
5
5
|
useFieldContext
|
|
6
6
|
} from "./chunk-ZAU4JVLL.js";
|
|
@@ -32,4 +32,4 @@ function Input(props) {
|
|
|
32
32
|
export {
|
|
33
33
|
Input
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-KO7LBJGB.js.map
|
|
@@ -0,0 +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\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' | 'outlined' | '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":[]}
|