@cerberus-design/react 0.11.1 → 0.12.0
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 +244 -33
- package/build/legacy/components/Admonition.cjs +1 -1
- package/build/legacy/components/Admonition.cjs.map +1 -1
- package/build/legacy/components/Avatar.cjs +1 -1
- package/build/legacy/components/Avatar.cjs.map +1 -1
- package/build/legacy/components/Checkbox.cjs +1 -1
- package/build/legacy/components/Checkbox.cjs.map +1 -1
- package/build/legacy/components/FileStatus.cjs +1 -1
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/FileUploader.cjs +1 -1
- package/build/legacy/components/FileUploader.cjs.map +1 -1
- package/build/legacy/components/Input.cjs +1 -1
- package/build/legacy/components/Input.cjs.map +1 -1
- package/build/legacy/components/Menu.cjs +82 -0
- package/build/legacy/components/Menu.cjs.map +1 -0
- package/build/legacy/components/ModalHeader.cjs +2 -1
- package/build/legacy/components/ModalHeader.cjs.map +1 -1
- package/build/legacy/components/NavMenuLink.cjs.map +1 -1
- package/build/legacy/components/NavMenuList.cjs.map +1 -1
- package/build/legacy/components/NavMenuTrigger.cjs.map +1 -1
- package/build/legacy/components/Notification.cjs +3 -3
- package/build/legacy/components/Notification.cjs.map +1 -1
- package/build/legacy/components/Select.cjs +1 -1
- package/build/legacy/components/Select.cjs.map +1 -1
- package/build/legacy/components/Tag.cjs +3 -3
- package/build/legacy/components/Tag.cjs.map +1 -1
- package/build/legacy/components/Tbody.cjs.map +1 -1
- package/build/legacy/components/Td.cjs.map +1 -1
- package/build/legacy/components/Th.cjs +1 -0
- package/build/legacy/components/Th.cjs.map +1 -1
- package/build/legacy/components/Thead.cjs.map +1 -1
- package/build/legacy/components/Toggle.cjs +1 -1
- package/build/legacy/components/Toggle.cjs.map +1 -1
- package/build/legacy/config/cerbIcons.cjs +1 -1
- package/build/legacy/config/cerbIcons.cjs.map +1 -1
- package/build/legacy/config/defineIcons.cjs +1 -1
- package/build/legacy/config/defineIcons.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +3 -2
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs +567 -0
- package/build/legacy/context/cta-modal.cjs.map +1 -0
- package/build/legacy/context/navMenu.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +3 -3
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +3 -2
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +501 -324
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/utils/index.cjs +34 -0
- package/build/legacy/utils/index.cjs.map +1 -0
- package/build/modern/_tsup-dts-rollup.d.ts +244 -33
- package/build/modern/{chunk-HPM2XRWT.js → chunk-3R4TIF2X.js} +1 -1
- package/build/modern/{chunk-HPM2XRWT.js.map → chunk-3R4TIF2X.js.map} +1 -1
- package/build/modern/{chunk-RDQHHCFR.js → chunk-5OSUZUR4.js} +2 -2
- package/build/modern/{chunk-O75QAT4Z.js → chunk-6WS765J3.js} +1 -1
- package/build/modern/chunk-6WS765J3.js.map +1 -0
- package/build/modern/{chunk-KLUBAM4U.js → chunk-7SGPJM66.js} +4 -4
- package/build/modern/chunk-7SGPJM66.js.map +1 -0
- package/build/modern/{chunk-X4Y4WTRU.js → chunk-CSEHDNMJ.js} +7 -7
- package/build/modern/{chunk-TMR7JGMP.js → chunk-F27AAKQ3.js} +3 -3
- package/build/modern/chunk-F27AAKQ3.js.map +1 -0
- package/build/modern/{chunk-243VUIA6.js → chunk-F72ZABKX.js} +2 -2
- package/build/modern/chunk-F72ZABKX.js.map +1 -0
- package/build/modern/{chunk-KF6V5JLW.js → chunk-N4QTLDVM.js} +3 -3
- package/build/modern/{chunk-MDIUFBDX.js → chunk-NB6DV4VA.js} +2 -2
- package/build/modern/{chunk-UJKS4DDN.js → chunk-NKM6PISB.js} +2 -2
- package/build/modern/{chunk-YWCTMLLO.js → chunk-NMNONSHU.js} +2 -2
- package/build/modern/{chunk-OWKN5IV7.js → chunk-PM7CWT3N.js} +2 -2
- package/build/modern/chunk-PM7CWT3N.js.map +1 -0
- package/build/modern/chunk-RUR5MV54.js +52 -0
- package/build/modern/chunk-RUR5MV54.js.map +1 -0
- package/build/modern/{chunk-CO4BKT7K.js → chunk-SGKHA4EB.js} +1 -1
- package/build/modern/chunk-SGKHA4EB.js.map +1 -0
- package/build/modern/{chunk-ZX6DBC2Z.js → chunk-SPZYPRZ6.js} +2 -2
- package/build/modern/chunk-T6LS5P5W.js +155 -0
- package/build/modern/chunk-T6LS5P5W.js.map +1 -0
- package/build/modern/chunk-UTGEFJ3L.js +10 -0
- package/build/modern/chunk-UTGEFJ3L.js.map +1 -0
- package/build/modern/{chunk-5V5MBSM3.js → chunk-UZVQ4INR.js} +2 -2
- package/build/modern/chunk-UZVQ4INR.js.map +1 -0
- package/build/modern/{chunk-FT7DFRHQ.js → chunk-VERRHMW4.js} +2 -2
- package/build/modern/{chunk-3NE6C66J.js → chunk-VP5ERLAY.js} +8 -8
- package/build/modern/{chunk-HCB5NQ5J.js → chunk-W4DXACNV.js} +3 -3
- package/build/modern/{chunk-KBBASJIY.js → chunk-WPVDQRRF.js} +1 -1
- package/build/modern/chunk-WPVDQRRF.js.map +1 -0
- package/build/modern/{chunk-PA5EB7EO.js → chunk-XL4JREDT.js} +2 -2
- package/build/modern/{chunk-PKY46RRA.js → chunk-Y6QQCRQV.js} +1 -1
- package/build/modern/{chunk-PKY46RRA.js.map → chunk-Y6QQCRQV.js.map} +1 -1
- package/build/modern/{chunk-YMJMB6OP.js → chunk-ZBMA5G54.js} +6 -6
- package/build/modern/{chunk-ULYQLKWA.js → chunk-ZFAIE47A.js} +3 -2
- package/build/modern/{chunk-ULYQLKWA.js.map → chunk-ZFAIE47A.js.map} +1 -1
- package/build/modern/{chunk-PKQTTFWA.js → chunk-ZR37P4NZ.js} +1 -1
- package/build/modern/{chunk-PKQTTFWA.js.map → chunk-ZR37P4NZ.js.map} +1 -1
- package/build/modern/components/Admonition.js +4 -4
- package/build/modern/components/Avatar.js +3 -3
- package/build/modern/components/Checkbox.js +3 -3
- package/build/modern/components/FileStatus.js +5 -5
- package/build/modern/components/FileUploader.js +4 -4
- package/build/modern/components/Input.js +3 -3
- package/build/modern/components/Menu.js +19 -0
- package/build/modern/components/Menu.js.map +1 -0
- package/build/modern/components/ModalHeader.js +1 -1
- package/build/modern/components/NavMenuLink.js +1 -1
- package/build/modern/components/NavMenuList.js +2 -2
- package/build/modern/components/NavMenuTrigger.js +2 -2
- package/build/modern/components/Notification.js +3 -3
- package/build/modern/components/Select.js +3 -3
- package/build/modern/components/Tag.js +3 -3
- package/build/modern/components/Tbody.js +1 -1
- package/build/modern/components/Td.js +1 -1
- package/build/modern/components/Th.js +2 -1
- package/build/modern/components/Thead.js +1 -1
- package/build/modern/components/Toggle.js +3 -3
- package/build/modern/config/cerbIcons.js +1 -1
- package/build/modern/config/defineIcons.js +2 -2
- package/build/modern/context/confirm-modal.js +6 -6
- package/build/modern/context/cta-modal.js +25 -0
- package/build/modern/context/cta-modal.js.map +1 -0
- package/build/modern/context/navMenu.js +1 -1
- package/build/modern/context/notification-center.js +4 -4
- package/build/modern/context/prompt-modal.js +7 -7
- package/build/modern/index.js +72 -46
- package/build/modern/index.js.map +1 -1
- package/build/modern/utils/index.js +7 -0
- package/build/modern/utils/index.js.map +1 -0
- package/package.json +3 -2
- package/src/components/Menu.tsx +244 -0
- package/src/components/ModalHeader.tsx +1 -0
- package/src/components/NavMenuLink.tsx +1 -11
- package/src/components/NavMenuList.tsx +1 -3
- package/src/components/NavMenuTrigger.tsx +1 -10
- package/src/components/Notification.tsx +2 -2
- package/src/components/Tag.tsx +8 -4
- package/src/components/Tbody.tsx +1 -2
- package/src/components/Td.tsx +1 -2
- package/src/components/Th.tsx +4 -2
- package/src/components/Thead.tsx +1 -2
- package/src/config/cerbIcons.ts +2 -2
- package/src/context/cta-modal.tsx +210 -0
- package/src/context/navMenu.tsx +1 -2
- package/src/index.ts +3 -0
- package/src/utils/index.ts +19 -0
- package/build/modern/chunk-243VUIA6.js.map +0 -1
- package/build/modern/chunk-5V5MBSM3.js.map +0 -1
- package/build/modern/chunk-CO4BKT7K.js.map +0 -1
- package/build/modern/chunk-KBBASJIY.js.map +0 -1
- package/build/modern/chunk-KLUBAM4U.js.map +0 -1
- package/build/modern/chunk-O75QAT4Z.js.map +0 -1
- package/build/modern/chunk-OWKN5IV7.js.map +0 -1
- package/build/modern/chunk-TMR7JGMP.js.map +0 -1
- /package/build/modern/{chunk-RDQHHCFR.js.map → chunk-5OSUZUR4.js.map} +0 -0
- /package/build/modern/{chunk-X4Y4WTRU.js.map → chunk-CSEHDNMJ.js.map} +0 -0
- /package/build/modern/{chunk-KF6V5JLW.js.map → chunk-N4QTLDVM.js.map} +0 -0
- /package/build/modern/{chunk-MDIUFBDX.js.map → chunk-NB6DV4VA.js.map} +0 -0
- /package/build/modern/{chunk-UJKS4DDN.js.map → chunk-NKM6PISB.js.map} +0 -0
- /package/build/modern/{chunk-YWCTMLLO.js.map → chunk-NMNONSHU.js.map} +0 -0
- /package/build/modern/{chunk-ZX6DBC2Z.js.map → chunk-SPZYPRZ6.js.map} +0 -0
- /package/build/modern/{chunk-FT7DFRHQ.js.map → chunk-VERRHMW4.js.map} +0 -0
- /package/build/modern/{chunk-3NE6C66J.js.map → chunk-VP5ERLAY.js.map} +0 -0
- /package/build/modern/{chunk-HCB5NQ5J.js.map → chunk-W4DXACNV.js.map} +0 -0
- /package/build/modern/{chunk-PA5EB7EO.js.map → chunk-XL4JREDT.js.map} +0 -0
- /package/build/modern/{chunk-YMJMB6OP.js.map → chunk-ZBMA5G54.js.map} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
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/utils/index.ts
|
|
21
|
+
var utils_exports = {};
|
|
22
|
+
__export(utils_exports, {
|
|
23
|
+
formatNotifyCount: () => formatNotifyCount
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(utils_exports);
|
|
26
|
+
function formatNotifyCount(count) {
|
|
27
|
+
if (count > 99) return "99+";
|
|
28
|
+
return count.toString();
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
formatNotifyCount
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["/**\n * This module contains utility functions that are used across your app.\n * @module Utils\n */\n\n/**\n * Formats the count of notifications to be displayed in the notification badge.\n * @param count - The number of notifications.\n * @returns The formatted count of notifications.\n * @example\n * ```tsx\n * const count = formatNotifyCount(100)\n * console.log(count) // '99+'\n * ```\n */\nexport function formatNotifyCount(count: number): string {\n if (count > 99) return '99+'\n return count.toString()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,kBAAkB,OAAuB;AACvD,MAAI,QAAQ,GAAI,QAAO;AACvB,SAAO,MAAM,SAAS;AACxB;","names":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
1
3
|
import { Activator } from '@dnd-kit/core';
|
|
2
4
|
import { Activators } from '@dnd-kit/core';
|
|
3
5
|
import { Active } from '@dnd-kit/core';
|
|
@@ -80,9 +82,11 @@ import { LabelVariantProps } from '@cerberus/styled-system/recipes';
|
|
|
80
82
|
import { MeasuringConfiguration } from '@dnd-kit/core';
|
|
81
83
|
import { MeasuringFrequency } from '@dnd-kit/core';
|
|
82
84
|
import { MeasuringStrategy } from '@dnd-kit/core';
|
|
85
|
+
import { Menu as Menu_2 } from '@ark-ui/react';
|
|
83
86
|
import { Modifier } from '@dnd-kit/core';
|
|
84
87
|
import { Modifiers } from '@dnd-kit/core';
|
|
85
88
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
89
|
+
import type { MouseEventHandler } from 'react';
|
|
86
90
|
import { MouseSensor } from '@dnd-kit/core';
|
|
87
91
|
import { MouseSensorOptions } from '@dnd-kit/core';
|
|
88
92
|
import { MutableRefObject } from 'react';
|
|
@@ -443,19 +447,19 @@ declare type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
|
|
|
443
447
|
/**
|
|
444
448
|
* The action to be performed when the tag is clicked.
|
|
445
449
|
*/
|
|
446
|
-
onClick:
|
|
450
|
+
onClick: MouseEventHandler<HTMLSpanElement>;
|
|
447
451
|
/**
|
|
448
452
|
* The shape of the tag. Not available when the onClick prop is provided.
|
|
449
453
|
* @type 'pill' | 'rounded'
|
|
450
454
|
* @default 'pill'
|
|
451
455
|
*/
|
|
452
|
-
shape
|
|
456
|
+
shape?: never;
|
|
453
457
|
/**
|
|
454
458
|
* The usage of the tag. Not available when the onClick prop is provided.
|
|
455
459
|
* @type 'filled' | 'outlined'
|
|
456
460
|
* @default 'filled'
|
|
457
461
|
*/
|
|
458
|
-
usage
|
|
462
|
+
usage?: never;
|
|
459
463
|
};
|
|
460
464
|
export { ClickableTagProps }
|
|
461
465
|
export { ClickableTagProps as ClickableTagProps_alias_1 }
|
|
@@ -520,6 +524,53 @@ declare function createNavTriggerProps(values: NavTriggerAriaValues): NavTrigger
|
|
|
520
524
|
export { createNavTriggerProps }
|
|
521
525
|
export { createNavTriggerProps as createNavTriggerProps_alias_1 }
|
|
522
526
|
|
|
527
|
+
/**
|
|
528
|
+
* Provides a CTA modal to the app.
|
|
529
|
+
* @see https://cerberus.digitalu.design/react/cta-modal
|
|
530
|
+
* @example
|
|
531
|
+
* ```tsx
|
|
532
|
+
* // Wrap the Provider around the root of the feature.
|
|
533
|
+
* <CTAModal>
|
|
534
|
+
* <SomeFeatureSection />
|
|
535
|
+
* </CTAModal>
|
|
536
|
+
*
|
|
537
|
+
* // Use the hook to show the cta modal.
|
|
538
|
+
* const cta = useCTAModal()
|
|
539
|
+
*
|
|
540
|
+
* const handleClick = useCallback(async () => {
|
|
541
|
+
* const userConsent = await cta.show({
|
|
542
|
+
* heading: 'Create or copy a Cohort',
|
|
543
|
+
* description:
|
|
544
|
+
* 'Create a new cohort or copy and existing one.',
|
|
545
|
+
* icon: <Copy size={24} />,
|
|
546
|
+
* actions: [
|
|
547
|
+
* {
|
|
548
|
+
* text: 'Create Cohort',
|
|
549
|
+
* onClick: () => {},
|
|
550
|
+
* {
|
|
551
|
+
* text: 'Copy Cohort',
|
|
552
|
+
* onClick: () => {}
|
|
553
|
+
* }
|
|
554
|
+
* })
|
|
555
|
+
* setConsent(userConsent)
|
|
556
|
+
* }, [cta])
|
|
557
|
+
* ```
|
|
558
|
+
*/
|
|
559
|
+
declare function CTAModal(props: PropsWithChildren<CTAModalProviderProps>): JSX_2.Element;
|
|
560
|
+
export { CTAModal }
|
|
561
|
+
export { CTAModal as CTAModal_alias_1 }
|
|
562
|
+
|
|
563
|
+
declare interface CTAModalProviderProps {
|
|
564
|
+
}
|
|
565
|
+
export { CTAModalProviderProps }
|
|
566
|
+
export { CTAModalProviderProps as CTAModalProviderProps_alias_1 }
|
|
567
|
+
|
|
568
|
+
declare interface CTAModalValue {
|
|
569
|
+
show: (options: ShowCTAModalOptions) => void;
|
|
570
|
+
}
|
|
571
|
+
export { CTAModalValue }
|
|
572
|
+
export { CTAModalValue as CTAModalValue_alias_1 }
|
|
573
|
+
|
|
523
574
|
declare type CustomThemes<K extends string = DefaultThemes> = 'cerberus' | K;
|
|
524
575
|
export { CustomThemes }
|
|
525
576
|
export { CustomThemes as CustomThemes_alias_1 }
|
|
@@ -964,14 +1015,30 @@ declare interface FileUploaderProps extends InputHTMLAttributes<HTMLInputElement
|
|
|
964
1015
|
export { FileUploaderProps }
|
|
965
1016
|
export { FileUploaderProps as FileUploaderProps_alias_1 }
|
|
966
1017
|
|
|
1018
|
+
/**
|
|
1019
|
+
* This module contains utility functions that are used across your app.
|
|
1020
|
+
* @module Utils
|
|
1021
|
+
*/
|
|
1022
|
+
/**
|
|
1023
|
+
* Formats the count of notifications to be displayed in the notification badge.
|
|
1024
|
+
* @param count - The number of notifications.
|
|
1025
|
+
* @returns The formatted count of notifications.
|
|
1026
|
+
* @example
|
|
1027
|
+
* ```tsx
|
|
1028
|
+
* const count = formatNotifyCount(100)
|
|
1029
|
+
* console.log(count) // '99+'
|
|
1030
|
+
* ```
|
|
1031
|
+
*/
|
|
1032
|
+
declare function formatNotifyCount(count: number): string;
|
|
1033
|
+
export { formatNotifyCount }
|
|
1034
|
+
export { formatNotifyCount as formatNotifyCount_alias_1 }
|
|
1035
|
+
|
|
967
1036
|
export { getClientRect }
|
|
968
1037
|
|
|
969
1038
|
export { getFirstCollision }
|
|
970
1039
|
|
|
971
1040
|
/**
|
|
972
|
-
*
|
|
973
|
-
* @param position - The position of the NavMenuList.
|
|
974
|
-
* @returns The position of the NavMenuList.
|
|
1041
|
+
* @deprecated use the {@link Menu} family instead
|
|
975
1042
|
*/
|
|
976
1043
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
977
1044
|
export { getPosition }
|
|
@@ -1194,6 +1261,138 @@ export { MeasuringFrequency }
|
|
|
1194
1261
|
|
|
1195
1262
|
export { MeasuringStrategy }
|
|
1196
1263
|
|
|
1264
|
+
/**
|
|
1265
|
+
* The root Menu component which controls the menu.
|
|
1266
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```tsx
|
|
1269
|
+
* <Menu>
|
|
1270
|
+
* <MenuTrigger>Trigger</MenuTrigger>
|
|
1271
|
+
* </Menu>
|
|
1272
|
+
*/
|
|
1273
|
+
declare const Menu: (props: Menu_2.RootProps) => JSX_2.Element;
|
|
1274
|
+
export { Menu }
|
|
1275
|
+
export { Menu as Menu_alias_1 }
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* The MenuContent component is the container for the menu items.
|
|
1279
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1280
|
+
* @example
|
|
1281
|
+
* ```tsx
|
|
1282
|
+
* <Menu>
|
|
1283
|
+
* <MenuTrigger>
|
|
1284
|
+
* <Button>Trigger</Button>
|
|
1285
|
+
* </MenuTrigger>
|
|
1286
|
+
* <MenuContent>
|
|
1287
|
+
* <MenuItem value="item_1">Item 1</MenuItem>
|
|
1288
|
+
* <MenuItem value="item_2">Item 2</MenuItem>
|
|
1289
|
+
* </MenuContent>
|
|
1290
|
+
* </Menu>
|
|
1291
|
+
*/
|
|
1292
|
+
declare function MenuContent(props: Menu_2.ContentProps): JSX_2.Element;
|
|
1293
|
+
export { MenuContent }
|
|
1294
|
+
export { MenuContent as MenuContent_alias_1 }
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* The MenuItemGroupLabel component is the label for a group of menu items.
|
|
1298
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1299
|
+
* @example
|
|
1300
|
+
* ```tsx
|
|
1301
|
+
* <Menu>
|
|
1302
|
+
* <MenuTrigger>
|
|
1303
|
+
* <Button>Trigger</Button>
|
|
1304
|
+
* </MenuTrigger>
|
|
1305
|
+
* <MenuContent>
|
|
1306
|
+
* <MenuItemGroup>
|
|
1307
|
+
* <MenuItemGroupLabel>Group Label</MenuItemGroupLabel>
|
|
1308
|
+
* <MenuItem value="item_1">Item 1</MenuItem>
|
|
1309
|
+
* <MenuItem value="item_2">Item 2</MenuItem>
|
|
1310
|
+
* </MenuItemGroup>
|
|
1311
|
+
* </MenuContent>
|
|
1312
|
+
* </Menu>
|
|
1313
|
+
*/
|
|
1314
|
+
declare function MenuGroupLabel(props: Menu_2.ItemGroupLabelProps): JSX_2.Element;
|
|
1315
|
+
export { MenuGroupLabel }
|
|
1316
|
+
export { MenuGroupLabel as MenuGroupLabel_alias_1 }
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* The MenuItem component is a single item in the menu.
|
|
1320
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1321
|
+
* @example
|
|
1322
|
+
* ```tsx
|
|
1323
|
+
* <Menu>
|
|
1324
|
+
* <MenuTrigger>
|
|
1325
|
+
* <Button>Trigger</Button>
|
|
1326
|
+
* </MenuTrigger>
|
|
1327
|
+
* <MenuContent>
|
|
1328
|
+
* <MenuItem value="item_1">Item 1</MenuItem>
|
|
1329
|
+
* <MenuItem value="item_2">Item 2</MenuItem>
|
|
1330
|
+
* </MenuContent>
|
|
1331
|
+
* </Menu>
|
|
1332
|
+
*/
|
|
1333
|
+
declare function MenuItem(props: Menu_2.ItemProps): JSX_2.Element;
|
|
1334
|
+
export { MenuItem }
|
|
1335
|
+
export { MenuItem as MenuItem_alias_1 }
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* The MenuItemGroup component is a group of menu items.
|
|
1339
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1340
|
+
* @example
|
|
1341
|
+
* ```tsx
|
|
1342
|
+
* <Menu>
|
|
1343
|
+
* <MenuTrigger>
|
|
1344
|
+
* <Button>Trigger</Button>
|
|
1345
|
+
* </MenuTrigger>
|
|
1346
|
+
* <MenuContent>
|
|
1347
|
+
* <MenuItemGroup>
|
|
1348
|
+
* <MenuItem value="item_1">Item 1</MenuItem>
|
|
1349
|
+
* <MenuItem value="item_2">Item 2</MenuItem>
|
|
1350
|
+
* </MenuItemGroup>
|
|
1351
|
+
* </MenuContent>
|
|
1352
|
+
* </Menu>
|
|
1353
|
+
*/
|
|
1354
|
+
declare const MenuItemGroup: ForwardRefExoticComponent<Menu_2.ItemGroupProps & RefAttributes<HTMLDivElement>>;
|
|
1355
|
+
export { MenuItemGroup }
|
|
1356
|
+
export { MenuItemGroup as MenuItemGroup_alias_1 }
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* The MenuSeparator component is a visual divider between menu items.
|
|
1360
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1361
|
+
* @example
|
|
1362
|
+
* ```tsx
|
|
1363
|
+
* <Menu>
|
|
1364
|
+
* <MenuTrigger>
|
|
1365
|
+
* <Button>Trigger</Button>
|
|
1366
|
+
* </MenuTrigger>
|
|
1367
|
+
* <MenuContent>
|
|
1368
|
+
* <MenuItemGroup>
|
|
1369
|
+
* <MenuGroupLabel>Group Label</MenuGroupLabel>
|
|
1370
|
+
* <MenuSeparator />
|
|
1371
|
+
* <MenuItem value="item_1">Item 1</MenuItem>
|
|
1372
|
+
* <MenuItem value="item_2">Item 2</MenuItem>
|
|
1373
|
+
* </MenuItemGroup>
|
|
1374
|
+
* </MenuContent>
|
|
1375
|
+
* </Menu>
|
|
1376
|
+
*/
|
|
1377
|
+
declare function MenuSeparator(props: Menu_2.SeparatorProps): JSX_2.Element;
|
|
1378
|
+
export { MenuSeparator }
|
|
1379
|
+
export { MenuSeparator as MenuSeparator_alias_1 }
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* The MenuTrigger component opens/closes the Menu.
|
|
1383
|
+
* @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu)
|
|
1384
|
+
* @example
|
|
1385
|
+
* ```tsx
|
|
1386
|
+
* <Menu>
|
|
1387
|
+
* <MenuTrigger>
|
|
1388
|
+
* <Button>Trigger</Button>
|
|
1389
|
+
* </MenuTrigger>
|
|
1390
|
+
* </Menu>
|
|
1391
|
+
*/
|
|
1392
|
+
declare function MenuTrigger(props: Menu_2.TriggerProps): JSX_2.Element;
|
|
1393
|
+
export { MenuTrigger }
|
|
1394
|
+
export { MenuTrigger as MenuTrigger_alias_1 }
|
|
1395
|
+
|
|
1197
1396
|
/**
|
|
1198
1397
|
* The Modal component is the root element for a customizable modal.
|
|
1199
1398
|
* @see https://cerberus.digitalu.design/react/modal
|
|
@@ -1305,8 +1504,7 @@ export { MouseSensor }
|
|
|
1305
1504
|
export { MouseSensorOptions }
|
|
1306
1505
|
|
|
1307
1506
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
* @see https://cerberus.digitalu.design/react/nav-menu
|
|
1507
|
+
* @deprecated use the {@link Menu} family instead
|
|
1310
1508
|
*/
|
|
1311
1509
|
declare function NavMenu(props: PropsWithChildren): JSX.Element;
|
|
1312
1510
|
export { NavMenu }
|
|
@@ -1334,17 +1532,7 @@ export { NavMenuContextValue }
|
|
|
1334
1532
|
export { NavMenuContextValue as NavMenuContextValue_alias_1 }
|
|
1335
1533
|
|
|
1336
1534
|
/**
|
|
1337
|
-
*
|
|
1338
|
-
* @see https://cerberus.digitalu.design/react/nav-menu
|
|
1339
|
-
* @example
|
|
1340
|
-
* ```tsx
|
|
1341
|
-
* <NavMenu>
|
|
1342
|
-
* <NavMenuList id="nav-menu-list" position="bottom">
|
|
1343
|
-
* <NavMenuLink href="/home">Home</NavMenuLink>
|
|
1344
|
-
* <NavMenuLink href="/about">About</NavMenuLink>
|
|
1345
|
-
* </NavMenuList>
|
|
1346
|
-
* </NavMenu>
|
|
1347
|
-
* ```
|
|
1535
|
+
* @deprecated use the {@link Menu} family instead
|
|
1348
1536
|
*/
|
|
1349
1537
|
declare function NavMenuLink(props: NavMenuLinkProps): JSX.Element;
|
|
1350
1538
|
export { NavMenuLink }
|
|
@@ -1403,16 +1591,7 @@ export { NavMenuRef }
|
|
|
1403
1591
|
export { NavMenuRef as NavMenuRef_alias_1 }
|
|
1404
1592
|
|
|
1405
1593
|
/**
|
|
1406
|
-
*
|
|
1407
|
-
* @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)
|
|
1408
|
-
* @example
|
|
1409
|
-
* ```tsx
|
|
1410
|
-
* <NavMenu>
|
|
1411
|
-
* <NavMenuTrigger controls="nav-menu-list">
|
|
1412
|
-
* Menu
|
|
1413
|
-
* </NavMenuTrigger>
|
|
1414
|
-
* </NavMenu>
|
|
1415
|
-
* ```
|
|
1594
|
+
* @deprecated use the {@link Menu} family instead
|
|
1416
1595
|
*/
|
|
1417
1596
|
declare function NavMenuTrigger(props: NavMenuTriggerProps): JSX.Element;
|
|
1418
1597
|
export { NavMenuTrigger }
|
|
@@ -1942,6 +2121,34 @@ declare interface ShowConfirmModalOptions {
|
|
|
1942
2121
|
export { ShowConfirmModalOptions }
|
|
1943
2122
|
export { ShowConfirmModalOptions as ShowConfirmModalOptions_alias_1 }
|
|
1944
2123
|
|
|
2124
|
+
/**
|
|
2125
|
+
* This module provides a context and hook for the cta modal.
|
|
2126
|
+
* @module
|
|
2127
|
+
*/
|
|
2128
|
+
declare interface ShowCTAModalOptions {
|
|
2129
|
+
/**
|
|
2130
|
+
* The heading of the cta modal.
|
|
2131
|
+
*/
|
|
2132
|
+
heading: string;
|
|
2133
|
+
/**
|
|
2134
|
+
* The description of the cta modal.
|
|
2135
|
+
*/
|
|
2136
|
+
description?: string;
|
|
2137
|
+
/**
|
|
2138
|
+
* The icon used for the modal Avatar.
|
|
2139
|
+
*/
|
|
2140
|
+
icon?: ReactNode;
|
|
2141
|
+
/**
|
|
2142
|
+
* The actions for the cta modal. Max of 2 actions.
|
|
2143
|
+
*/
|
|
2144
|
+
actions: {
|
|
2145
|
+
text: string;
|
|
2146
|
+
onClick: Required<ButtonHTMLAttributes<HTMLButtonElement>['onClick']>;
|
|
2147
|
+
}[];
|
|
2148
|
+
}
|
|
2149
|
+
export { ShowCTAModalOptions }
|
|
2150
|
+
export { ShowCTAModalOptions as ShowCTAModalOptions_alias_1 }
|
|
2151
|
+
|
|
1945
2152
|
/**
|
|
1946
2153
|
* This module provides a context and hook for the prompt modal.
|
|
1947
2154
|
* @module PromptModal
|
|
@@ -2268,7 +2475,7 @@ export { Tbody as Tbody_alias_1 }
|
|
|
2268
2475
|
* This module provides a TBody component.
|
|
2269
2476
|
* @module
|
|
2270
2477
|
*/
|
|
2271
|
-
declare type TbodyBaseProps =
|
|
2478
|
+
declare type TbodyBaseProps = JSX.IntrinsicElements['tbody'];
|
|
2272
2479
|
export { TbodyBaseProps }
|
|
2273
2480
|
export { TbodyBaseProps as TbodyBaseProps_alias_1 }
|
|
2274
2481
|
|
|
@@ -2293,7 +2500,7 @@ export { Td as Td_alias_1 }
|
|
|
2293
2500
|
* Th component for the Td component
|
|
2294
2501
|
* @module
|
|
2295
2502
|
*/
|
|
2296
|
-
declare type TdBaseProps =
|
|
2503
|
+
declare type TdBaseProps = JSX.IntrinsicElements['td'];
|
|
2297
2504
|
export { TdBaseProps }
|
|
2298
2505
|
export { TdBaseProps as TdBaseProps_alias_1 }
|
|
2299
2506
|
|
|
@@ -2354,7 +2561,7 @@ export { Th as Th_alias_1 }
|
|
|
2354
2561
|
* Th component for the Table component
|
|
2355
2562
|
* @module
|
|
2356
2563
|
*/
|
|
2357
|
-
declare type ThBaseProps =
|
|
2564
|
+
declare type ThBaseProps = JSX.IntrinsicElements['th'] & {
|
|
2358
2565
|
/**
|
|
2359
2566
|
* Converts the Th into a actionable button. Called when the user clicks on
|
|
2360
2567
|
* the Th.
|
|
@@ -2383,7 +2590,7 @@ export { Thead as Thead_alias_1 }
|
|
|
2383
2590
|
* This module contains the Thead component.
|
|
2384
2591
|
* @module
|
|
2385
2592
|
*/
|
|
2386
|
-
declare type TheadProps =
|
|
2593
|
+
declare type TheadProps = JSX.IntrinsicElements['thead'];
|
|
2387
2594
|
export { TheadProps }
|
|
2388
2595
|
export { TheadProps as TheadProps_alias_1 }
|
|
2389
2596
|
|
|
@@ -2547,6 +2754,10 @@ declare function useConfirmModal(): ConfirmModalValue;
|
|
|
2547
2754
|
export { useConfirmModal }
|
|
2548
2755
|
export { useConfirmModal as useConfirmModal_alias_1 }
|
|
2549
2756
|
|
|
2757
|
+
declare function useCTAModal(): CTAModalValue;
|
|
2758
|
+
export { useCTAModal }
|
|
2759
|
+
export { useCTAModal as useCTAModal_alias_1 }
|
|
2760
|
+
|
|
2550
2761
|
export { useDndContext }
|
|
2551
2762
|
|
|
2552
2763
|
export { UseDndContextReturnValue }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Td.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { td, type TdVariantProps } from '@cerberus/styled-system/recipes'\
|
|
1
|
+
{"version":3,"sources":["../../src/components/Td.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { td, type TdVariantProps } from '@cerberus/styled-system/recipes'\n\n/**\n * Th component for the Td component\n * @module\n */\n\nexport type TdBaseProps = JSX.IntrinsicElements['td']\nexport type TdProps = TdBaseProps & TdVariantProps\n\n/**\n * Styles for the Th component\n * @see https://cerberus.digitalu.design/react/table\n * @memberof module:Table\n * @example\n * ```tsx\n * <Td>Data cell</Td>\n * ```\n */\nexport function Td(props: TdProps) {\n const { size, ...nativeProps } = props\n return (\n <td\n {...nativeProps}\n className={cx(\n nativeProps.className,\n td({\n size,\n }),\n )}\n />\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;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,GAAG;AAAA,UACD;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Notification
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7SGPJM66.js";
|
|
4
4
|
import {
|
|
5
5
|
NotificationDescription
|
|
6
6
|
} from "./chunk-XEW6TJJ4.js";
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
NotificationCenter,
|
|
160
160
|
useNotificationCenter
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-5OSUZUR4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus/styled-system/css'\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type RefObject,\n} from 'react'\n\n/**\n * This module provides a context and hook for the nav menu.\n * @module NavMenu\n */\n\nexport type NavTriggerRef = RefObject<HTMLButtonElement>\nexport type NavMenuRef = RefObject<HTMLUListElement>\n\nexport interface NavMenuContextValue {\n /**\n * The ref for the trigger button.\n */\n triggerRef: NavTriggerRef | null\n /**\n * The ref for the menu.\n */\n menuRef: NavMenuRef | null\n /**\n * Whether the menu is expanded.\n */\n expanded: boolean\n /**\n * Called when the menu button is clicked.\n */\n onToggle: () => void\n}\n\nconst NavMenuContext = createContext<NavMenuContextValue | null>(null)\n\n/**\n * @deprecated use the {@link Menu} family instead\n */\nexport function NavMenu(props: PropsWithChildren): JSX.Element {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const menuRef = useRef<HTMLUListElement>(null)\n const [expanded, setExpanded] = useState<boolean>(false)\n\n const handleToggle = useCallback(() => {\n setExpanded((prev) => !prev)\n }, [])\n\n const value = useMemo(\n () => ({\n triggerRef,\n menuRef,\n expanded,\n onToggle: handleToggle,\n }),\n [expanded, handleToggle],\n )\n\n return (\n <NavMenuContext.Provider value={value}>\n <nav\n className={css({\n position: 'relative',\n })}\n >\n {props.children}\n </nav>\n </NavMenuContext.Provider>\n )\n}\n\n/**\n * Used to access the nav menu context.\n * @returns The nav menu context.\n */\nexport function useNavMenuContext(): NavMenuContextValue {\n const context = useContext(NavMenuContext)\n if (!context) {\n throw new Error('useNavMenuContext must be used within a NavMenu.')\n }\n return context\n}\n"],"mappings":";AAEA,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAuDD;AA1BN,IAAM,iBAAiB,cAA0C,IAAI;AAK9D,SAAS,QAAQ,OAAuC;AAC7D,QAAM,aAAa,OAA0B,IAAI;AACjD,QAAM,UAAU,OAAyB,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB,KAAK;AAEvD,QAAM,eAAe,YAAY,MAAM;AACrC,gBAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC7B,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,SACE,oBAAC,eAAe,UAAf,EAAwB,OACvB;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,IAAI;AAAA,QACb,UAAU;AAAA,MACZ,CAAC;AAAA,MAEA,gBAAM;AAAA;AAAA,EACT,GACF;AAEJ;AAMO,SAAS,oBAAyC;AACvD,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-JIZQFTW6.js";
|
|
4
4
|
import {
|
|
5
5
|
$cerberusIcons
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VERRHMW4.js";
|
|
7
7
|
|
|
8
8
|
// src/components/Notification.tsx
|
|
9
9
|
import { cx } from "@cerberus/styled-system/css";
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
useRef
|
|
16
16
|
} from "react";
|
|
17
|
-
import { Close } from "@cerberus/icons";
|
|
18
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
18
|
function MatchNotificationIcon(props) {
|
|
20
19
|
const palette = props.palette || "info";
|
|
@@ -27,6 +26,7 @@ function Notification(props) {
|
|
|
27
26
|
const ref = useRef(null);
|
|
28
27
|
const onKeyDown = trapFocus(ref);
|
|
29
28
|
const styles = notification({ palette });
|
|
29
|
+
const { close: CloseIcon } = $cerberusIcons;
|
|
30
30
|
return /* @__PURE__ */ jsxs(
|
|
31
31
|
"dialog",
|
|
32
32
|
{
|
|
@@ -61,7 +61,7 @@ function Notification(props) {
|
|
|
61
61
|
className: styles.close,
|
|
62
62
|
onClick: onClose,
|
|
63
63
|
value: props.id,
|
|
64
|
-
children: /* @__PURE__ */ jsx(
|
|
64
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
]
|
|
@@ -72,4 +72,4 @@ function Notification(props) {
|
|
|
72
72
|
export {
|
|
73
73
|
Notification
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-7SGPJM66.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Notification.tsx"],"sourcesContent":["'use client'\n\nimport { cx } from '@cerberus/styled-system/css'\nimport { hstack, vstack } from '@cerberus/styled-system/patterns'\nimport {\n notification,\n type NotificationVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport {\n useRef,\n type DialogHTMLAttributes,\n type PropsWithChildren,\n type MouseEvent,\n} from 'react'\nimport { $cerberusIcons } from '../config/defineIcons'\nimport type { IconType } from '../config/cerbIcons'\nimport { trapFocus } from '../aria-helpers/trap-focus.aria'\n\n/**\n * This module exports the Notification component.\n * @module\n */\n\nfunction MatchNotificationIcon(props: NotificationVariantProps) {\n const palette = props.palette || 'info'\n const key = `${palette}Notification` as keyof typeof $cerberusIcons\n const Icon = $cerberusIcons[key] as IconType\n return <Icon />\n}\n\nexport interface NotificationBaseProps\n extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'onClose'> {\n /**\n * The unique id of the notification. Required for the onClose callback.\n */\n id: string\n /**\n * Called when the close button is clicked.\n */\n onClose?: (e: MouseEvent<HTMLButtonElement>) => void\n}\nexport type NotificationProps = NotificationBaseProps & NotificationVariantProps\n\n/**\n * A static Notification component that displays a message to the user. This\n * is typically only used when not utilizing the NotificationCenter.\n * @see https://cerberus.digitalu.design/react/notification\n * @memberof module:NotificationCenter\n * @example\n * ```tsx\n * <Notification id=\"info:1\" open>\n * <NotificationHeading>Info Notification</NotificationHeading>\n * <NotificationDescription>\n * This is a description with a <a href=\"#\">link</a> in the message.\n * </NotificationDescription>\n * </Notification>\n * ```\n */\nexport function Notification(props: PropsWithChildren<NotificationProps>) {\n const { children, palette, onClose, ...nativeProps } = props\n const ref = useRef<HTMLDialogElement>(null)\n const onKeyDown = trapFocus(ref)\n const styles = notification({ palette })\n const { close: CloseIcon } = $cerberusIcons\n\n return (\n <dialog\n {...nativeProps}\n className={cx(\n nativeProps.className,\n hstack({\n position: 'relative',\n gap: '4',\n }),\n styles.dialog,\n )}\n onKeyDown={onKeyDown}\n ref={ref}\n >\n <span className={styles.icon}>\n <MatchNotificationIcon palette={palette} />\n </span>\n\n <div\n className={vstack({\n alignItems: 'flex-start',\n gap: '0',\n py: '2',\n })}\n >\n {children}\n </div>\n\n <button\n aria-label=\"Close\"\n className={styles.close}\n onClick={onClose}\n value={props.id}\n >\n <CloseIcon />\n </button>\n </dialog>\n )\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,QAAQ,cAAc;AAC/B;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAIK;AAcE,cAuCL,YAvCK;AAJT,SAAS,sBAAsB,OAAiC;AAC9D,QAAM,UAAU,MAAM,WAAW;AACjC,QAAM,MAAM,GAAG,OAAO;AACtB,QAAM,OAAO,eAAe,GAAG;AAC/B,SAAO,oBAAC,QAAK;AACf;AA8BO,SAAS,aAAa,OAA6C;AACxE,QAAM,EAAE,UAAU,SAAS,SAAS,GAAG,YAAY,IAAI;AACvD,QAAM,MAAM,OAA0B,IAAI;AAC1C,QAAM,YAAY,UAAU,GAAG;AAC/B,QAAM,SAAS,aAAa,EAAE,QAAQ,CAAC;AACvC,QAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL,UAAU;AAAA,UACV,KAAK;AAAA,QACP,CAAC;AAAA,QACD,OAAO;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,UAAK,WAAW,OAAO,MACtB,8BAAC,yBAAsB,SAAkB,GAC3C;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,OAAO;AAAA,cAChB,YAAY;AAAA,cACZ,KAAK;AAAA,cACL,IAAI;AAAA,YACN,CAAC;AAAA,YAEA;AAAA;AAAA,QACH;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,OAAO;AAAA,YAClB,SAAS;AAAA,YACT,OAAO,MAAM;AAAA,YAEb,8BAAC,aAAU;AAAA;AAAA,QACb;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModalHeading
|
|
3
|
+
} from "./chunk-2UXE5PDG.js";
|
|
1
4
|
import {
|
|
2
5
|
Portal
|
|
3
6
|
} from "./chunk-GLY7GU5S.js";
|
|
@@ -9,13 +12,10 @@ import {
|
|
|
9
12
|
} from "./chunk-Q7BRMIBR.js";
|
|
10
13
|
import {
|
|
11
14
|
ModalHeader
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
ModalHeading
|
|
15
|
-
} from "./chunk-2UXE5PDG.js";
|
|
15
|
+
} from "./chunk-ZFAIE47A.js";
|
|
16
16
|
import {
|
|
17
17
|
Avatar
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SPZYPRZ6.js";
|
|
19
19
|
import {
|
|
20
20
|
Button
|
|
21
21
|
} from "./chunk-EXGKZGML.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-JIZQFTW6.js";
|
|
28
28
|
import {
|
|
29
29
|
$cerberusIcons
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VERRHMW4.js";
|
|
31
31
|
import {
|
|
32
32
|
useModal
|
|
33
33
|
} from "./chunk-7T3JIGM7.js";
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
ConfirmModal,
|
|
177
177
|
useConfirmModal
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-CSEHDNMJ.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Checkmark,
|
|
12
12
|
CheckmarkOutline,
|
|
13
13
|
ChevronDown,
|
|
14
|
-
|
|
14
|
+
Close,
|
|
15
15
|
CloudUpload,
|
|
16
16
|
Information,
|
|
17
17
|
Restart,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
var defaultIcons = {
|
|
25
25
|
avatar: UserFilled,
|
|
26
26
|
checkbox: CheckmarkIcon,
|
|
27
|
-
close:
|
|
27
|
+
close: Close,
|
|
28
28
|
confirmModal: Information,
|
|
29
29
|
delete: TrashCan,
|
|
30
30
|
promptModal: Information,
|
|
@@ -45,4 +45,4 @@ var defaultIcons = {
|
|
|
45
45
|
export {
|
|
46
46
|
defaultIcons
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-F27AAKQ3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n CheckmarkOutline,\n ChevronDown,\n Close,\n CloudUpload,\n Information,\n Restart,\n TrashCan,\n UserFilled,\n Warning,\n WarningAlt,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\nimport { CheckmarkIcon, IndeterminateIcon } from './icons/checkbox.icons'\nimport { AnimatingUploadIcon } from '../components/AnimatingUploadIcon'\n\nexport type IconType = CarbonIconType | ElementType\n\nexport interface DefinedIcons {\n avatar?: IconType\n checkbox?: IconType\n close?: IconType\n confirmModal?: IconType\n delete?: IconType\n promptModal?: IconType\n waitingFileUploader?: IconType\n fileUploader?: IconType\n indeterminate?: IconType\n infoNotification?: IconType\n successNotification?: IconType\n warningNotification?: IconType\n dangerNotification?: IconType\n invalid: IconType\n invalidAlt?: IconType\n redo?: IconType\n selectArrow?: IconType\n toggleChecked?: IconType\n}\n\nexport const defaultIcons: DefinedIcons = {\n avatar: UserFilled,\n checkbox: CheckmarkIcon,\n close: Close,\n confirmModal: Information,\n delete: TrashCan,\n promptModal: Information,\n waitingFileUploader: CloudUpload,\n fileUploader: AnimatingUploadIcon,\n indeterminate: IndeterminateIcon,\n infoNotification: Information,\n successNotification: CheckmarkOutline,\n warningNotification: WarningAlt,\n dangerNotification: WarningFilled,\n invalid: WarningFilled,\n invalidAlt: Warning,\n redo: Restart,\n selectArrow: ChevronDown,\n toggleChecked: Checkmark,\n}\n"],"mappings":";;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA4BA,IAAM,eAA6B;AAAA,EACxC,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,eAAe;AACjB;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-BUVVRQLZ.js";
|
|
4
4
|
import {
|
|
5
5
|
$cerberusIcons
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VERRHMW4.js";
|
|
7
7
|
|
|
8
8
|
// src/components/Tag.tsx
|
|
9
9
|
import { css, cx } from "@cerberus/styled-system/css";
|
|
@@ -61,4 +61,4 @@ var closableCss = css({
|
|
|
61
61
|
export {
|
|
62
62
|
Tag
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-F72ZABKX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type {\n HTMLAttributes,\n MouseEventHandler,\n PropsWithChildren,\n} from 'react'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport {\n iconButton,\n tag,\n type TagVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { $cerberusIcons } from '../config/defineIcons'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type StaticTagProps = HTMLAttributes<HTMLSpanElement> &\n TagVariantProps & {\n /**\n * The action to be performed when the tag is clicked. Not available when\n * the palette or gradient props are provided.\n */\n onClick?: never\n }\n\nexport type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {\n /**\n * The gradient to apply to the tag. Not available when the onClick prop is\n * provided.\n */\n gradient?: never\n /**\n * The palette to use for the tag. Not available when the onClick prop is\n * provided.\n */\n palette?: never\n /**\n * The action to be performed when the tag is clicked.\n */\n onClick: MouseEventHandler<HTMLSpanElement>\n /**\n * The shape of the tag. Not available when the onClick prop is provided.\n * @type 'pill' | 'rounded'\n * @default 'pill'\n */\n shape?: never\n /**\n * The usage of the tag. Not available when the onClick prop is provided.\n * @type 'filled' | 'outlined'\n * @default 'filled'\n */\n usage?: never\n}\n\nexport type TagProps = StaticTagProps | ClickableTagProps\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @see https://cerberus.digitalu.design/react/tag\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(props: PropsWithChildren<TagProps>): JSX.Element {\n const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props\n const palette = props?.palette ?? 'page'\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const closableStyles = isClosable ? closableCss : ''\n const { close: Close } = $cerberusIcons\n\n return (\n <span\n {...nativeProps}\n className={cx(\n nativeProps.className,\n tag({\n gradient,\n palette,\n shape,\n usage,\n }),\n closableStyles,\n )}\n >\n {props.children}\n\n <Show when={isClosable}>\n <button\n aria-label=\"Close\"\n className={iconButton({\n palette: 'action',\n usage: 'filled',\n size: 'sm',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n\nconst closableCss = css({\n bgColor: 'action.bg.active',\n color: 'action.text.initial',\n paddingInlineEnd: '0',\n})\n"],"mappings":";;;;;;;;AAMA,SAAS,KAAK,UAAU;AACxB;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAiEH,SAyBM,KAzBN;AATG,SAAS,IAAI,OAAiD;AACnE,QAAM,EAAE,OAAO,WAAW,UAAU,SAAS,OAAO,GAAG,YAAY,IAAI;AACvE,QAAM,UAAU,OAAO,WAAW;AAClC,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,iBAAiB,aAAa,cAAc;AAClD,QAAM,EAAE,OAAO,MAAM,IAAI;AAEzB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,IAAI;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MAEC;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,WAAW;AAAA,cACpB,SAAS;AAAA,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAM,cAAc,IAAI;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,kBAAkB;AACpB,CAAC;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Avatar
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SPZYPRZ6.js";
|
|
4
4
|
import {
|
|
5
5
|
Show
|
|
6
6
|
} from "./chunk-BUVVRQLZ.js";
|
|
7
7
|
import {
|
|
8
8
|
$cerberusIcons
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VERRHMW4.js";
|
|
10
10
|
|
|
11
11
|
// src/components/Admonition.tsx
|
|
12
12
|
import {
|
|
@@ -135,4 +135,4 @@ export {
|
|
|
135
135
|
AdmonitionHeading,
|
|
136
136
|
AdmonitionDescription
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-N4QTLDVM.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-BUVVRQLZ.js";
|
|
7
7
|
import {
|
|
8
8
|
$cerberusIcons
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VERRHMW4.js";
|
|
10
10
|
|
|
11
11
|
// src/components/Checkbox.tsx
|
|
12
12
|
import {
|
|
@@ -53,4 +53,4 @@ function Checkbox(props) {
|
|
|
53
53
|
export {
|
|
54
54
|
Checkbox
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-NB6DV4VA.js.map
|