@shohojdhara/atomix 0.5.4 → 0.5.6
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/README.md +43 -21
- package/dist/atomix.css +2489 -183
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +5 -5
- package/dist/atomix.min.css.map +1 -1
- package/dist/config.js +2 -5
- package/dist/config.js.map +1 -1
- package/dist/core.d.ts +100 -8
- package/dist/core.js +89 -79
- package/dist/core.js.map +1 -1
- package/dist/forms.js +1 -7
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +7 -3
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +179 -54
- package/dist/index.esm.js +123 -105
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +128 -106
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/theme.js +0 -4
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +40 -25
- package/src/components/Breadcrumb/Breadcrumb.tsx +22 -13
- package/src/components/Button/Button.tsx +4 -5
- package/src/components/Callout/Callout.tsx +98 -96
- package/src/components/Card/Card.tsx +117 -103
- package/src/components/Card/index.ts +7 -5
- package/src/components/Dropdown/Dropdown.tsx +27 -8
- package/src/components/EdgePanel/EdgePanel.tsx +7 -2
- package/src/components/Modal/Modal.tsx +27 -8
- package/src/components/Spinner/Spinner.tsx +60 -43
- package/src/components/Tabs/Tabs.tsx +163 -149
- package/src/lib/composables/useInput.ts +11 -9
- package/src/lib/config/loader.ts +5 -2
- package/src/lib/types/components.ts +84 -0
- package/src/styles/01-settings/_settings.background.scss +35 -5
- package/src/styles/02-tools/_tools.background.scss +145 -61
- package/src/styles/06-components/_components.accordion.scss +2 -2
- package/src/styles/06-components/_components.badge.scss +1 -1
- package/src/styles/06-components/_components.button.scss +2 -2
- package/src/styles/06-components/_components.callout.scss +2 -2
- package/src/styles/06-components/_components.card.scss +3 -3
- package/src/styles/06-components/_components.dropdown.scss +1 -1
- package/src/styles/06-components/_components.dynamic-background.scss +69 -0
- package/src/styles/06-components/_components.edge-panel.scss +2 -2
- package/src/styles/06-components/_components.input.scss +3 -3
- package/src/styles/06-components/_components.messages.scss +6 -6
- package/src/styles/06-components/_components.modal.scss +1 -1
- package/src/styles/06-components/_components.navbar.scss +1 -1
- package/src/styles/06-components/_components.popover.scss +1 -1
- package/src/styles/06-components/_components.toggle.scss +1 -1
- package/src/styles/06-components/_components.tooltip.scss +3 -3
- package/src/styles/06-components/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.link.scss +4 -5
package/dist/config.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "fs";
|
|
2
|
-
|
|
3
|
-
import "path";
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* Configuration Types
|
|
7
3
|
*
|
|
@@ -9,7 +5,8 @@ import "path";
|
|
|
9
5
|
*/
|
|
10
6
|
/**
|
|
11
7
|
* Helper function to define Atomix configuration with type safety
|
|
12
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
function defineConfig(config) {
|
|
13
10
|
return config;
|
|
14
11
|
}
|
|
15
12
|
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../src/lib/config/types.ts"],"sourcesContent":[null],"names":["defineConfig","config"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../src/lib/config/types.ts"],"sourcesContent":[null],"names":["defineConfig","config"],"mappings":";;;;;;;;AAkYM,SAAUA,aAAaC;IAC3B,OAAOA;AACT;;"}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React$1, { ReactNode, HTMLAttributes, ElementType } from 'react';
|
|
1
|
+
import React$1, { ReactNode, HTMLAttributes, MouseEvent, ComponentType, AnchorHTMLAttributes, ElementType } from 'react';
|
|
2
2
|
import * as _phosphor_icons_react from '@phosphor-icons/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -897,6 +897,49 @@ interface SpinnerProps extends BaseComponentProps {
|
|
|
897
897
|
*/
|
|
898
898
|
glass?: AtomixGlassProps | boolean;
|
|
899
899
|
}
|
|
900
|
+
/**
|
|
901
|
+
* Spinner component properties
|
|
902
|
+
*/
|
|
903
|
+
interface SpinnerProps extends BaseComponentProps {
|
|
904
|
+
/**
|
|
905
|
+
* Spinner color variant
|
|
906
|
+
* @default 'primary'
|
|
907
|
+
*/
|
|
908
|
+
variant?: ThemeColor;
|
|
909
|
+
/**
|
|
910
|
+
* Spinner size
|
|
911
|
+
* @default 'md'
|
|
912
|
+
*/
|
|
913
|
+
size?: Size;
|
|
914
|
+
/**
|
|
915
|
+
* Whether the spinner should be displayed fullscreen
|
|
916
|
+
*/
|
|
917
|
+
fullscreen?: boolean;
|
|
918
|
+
/**
|
|
919
|
+
* Accessible label for screen readers
|
|
920
|
+
* @default 'Loading'
|
|
921
|
+
*/
|
|
922
|
+
'aria-label'?: string;
|
|
923
|
+
/**
|
|
924
|
+
* ARIA live property to control how updates are announced
|
|
925
|
+
* @default 'polite'
|
|
926
|
+
*/
|
|
927
|
+
'aria-live'?: 'off' | 'polite' | 'assertive';
|
|
928
|
+
/**
|
|
929
|
+
* ARIA descriptor property for additional description
|
|
930
|
+
*/
|
|
931
|
+
'aria-describe'?: string;
|
|
932
|
+
/**
|
|
933
|
+
* ARIA role for the spinner
|
|
934
|
+
* @default 'status'
|
|
935
|
+
*/
|
|
936
|
+
role?: 'status' | 'alert';
|
|
937
|
+
/**
|
|
938
|
+
* Glass morphism effect for the spinner
|
|
939
|
+
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
940
|
+
*/
|
|
941
|
+
glass?: AtomixGlassProps | boolean;
|
|
942
|
+
}
|
|
900
943
|
/**
|
|
901
944
|
* Card component props
|
|
902
945
|
*/
|
|
@@ -1261,6 +1304,11 @@ interface BreadcrumbItemData {
|
|
|
1261
1304
|
*/
|
|
1262
1305
|
className?: string;
|
|
1263
1306
|
}
|
|
1307
|
+
interface LinkComponentProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
1308
|
+
href?: string;
|
|
1309
|
+
to?: string;
|
|
1310
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
1311
|
+
}
|
|
1264
1312
|
interface BreadcrumbItemProps extends React$1.HTMLAttributes<HTMLLIElement> {
|
|
1265
1313
|
/**
|
|
1266
1314
|
* URL for the breadcrumb item
|
|
@@ -1277,15 +1325,15 @@ interface BreadcrumbItemProps extends React$1.HTMLAttributes<HTMLLIElement> {
|
|
|
1277
1325
|
/**
|
|
1278
1326
|
* Optional click handler for the link
|
|
1279
1327
|
*/
|
|
1280
|
-
onClick?: (event:
|
|
1328
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
1281
1329
|
/**
|
|
1282
1330
|
* Optional custom link component
|
|
1283
1331
|
*/
|
|
1284
|
-
linkAs?:
|
|
1332
|
+
linkAs?: ComponentType<LinkComponentProps>;
|
|
1285
1333
|
/**
|
|
1286
1334
|
* Link props to pass to the underlying anchor or linkComponent
|
|
1287
1335
|
*/
|
|
1288
|
-
linkProps?:
|
|
1336
|
+
linkProps?: Partial<LinkComponentProps>;
|
|
1289
1337
|
}
|
|
1290
1338
|
declare const BreadcrumbItem: React$1.ForwardRefExoticComponent<BreadcrumbItemProps & React$1.RefAttributes<HTMLLIElement>>;
|
|
1291
1339
|
interface BreadcrumbProps {
|
|
@@ -1329,11 +1377,55 @@ type ButtonAsProp = {
|
|
|
1329
1377
|
to?: string;
|
|
1330
1378
|
href?: string;
|
|
1331
1379
|
linkComponent?: React$1.ElementType;
|
|
1332
|
-
[key: string]: any;
|
|
1333
1380
|
};
|
|
1334
|
-
declare const Button: React$1.NamedExoticComponent<
|
|
1381
|
+
declare const Button: React$1.NamedExoticComponent<ButtonProps & ButtonAsProp & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
1335
1382
|
|
|
1336
|
-
|
|
1383
|
+
interface CardHeaderProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1384
|
+
/**
|
|
1385
|
+
* Header title
|
|
1386
|
+
*/
|
|
1387
|
+
title?: React$1.ReactNode;
|
|
1388
|
+
/**
|
|
1389
|
+
* Header subtitle
|
|
1390
|
+
*/
|
|
1391
|
+
subtitle?: React$1.ReactNode;
|
|
1392
|
+
/**
|
|
1393
|
+
* Action element (e.g., button) to display in header
|
|
1394
|
+
*/
|
|
1395
|
+
action?: React$1.ReactNode;
|
|
1396
|
+
/**
|
|
1397
|
+
* Icon to display in header
|
|
1398
|
+
*/
|
|
1399
|
+
icon?: React$1.ReactNode;
|
|
1400
|
+
}
|
|
1401
|
+
declare const CardHeader: React$1.ForwardRefExoticComponent<CardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1402
|
+
interface CardBodyProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1403
|
+
/**
|
|
1404
|
+
* Make body scrollable
|
|
1405
|
+
*/
|
|
1406
|
+
scrollable?: boolean;
|
|
1407
|
+
/**
|
|
1408
|
+
* Maximum height for scrollable body
|
|
1409
|
+
*/
|
|
1410
|
+
maxHeight?: string | number;
|
|
1411
|
+
}
|
|
1412
|
+
declare const CardBody: React$1.ForwardRefExoticComponent<CardBodyProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1413
|
+
interface CardFooterProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1414
|
+
/**
|
|
1415
|
+
* Footer alignment
|
|
1416
|
+
*/
|
|
1417
|
+
align?: 'start' | 'center' | 'end' | 'between';
|
|
1418
|
+
}
|
|
1419
|
+
declare const CardFooter: React$1.ForwardRefExoticComponent<CardFooterProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Card component with subcomponents for creating card layouts
|
|
1422
|
+
*/
|
|
1423
|
+
type CardComponent = React$1.FC<CardProps> & {
|
|
1424
|
+
Header: typeof CardHeader;
|
|
1425
|
+
Body: typeof CardBody;
|
|
1426
|
+
Footer: typeof CardFooter;
|
|
1427
|
+
};
|
|
1428
|
+
declare const Card: CardComponent;
|
|
1337
1429
|
|
|
1338
1430
|
declare const ElevationCard: React$1.FC<ElevationCardProps>;
|
|
1339
1431
|
|
|
@@ -1411,7 +1503,7 @@ declare const List: ListComponent;
|
|
|
1411
1503
|
type ListGroupProps = ListGroupProps$1;
|
|
1412
1504
|
declare const ListGroup: React$1.FC<ListGroupProps>;
|
|
1413
1505
|
|
|
1414
|
-
declare const Spinner: React$1.
|
|
1506
|
+
declare const Spinner: React$1.NamedExoticComponent<SpinnerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1415
1507
|
|
|
1416
1508
|
export { _default as Accordion, Badge, Block, Breadcrumb, Button, Callout, Card, ElevationCard, Icon, List, ListGroup, Spinner };
|
|
1417
1509
|
export type { AccordionProps, BadgeProps, BlockProps, BreadcrumbProps, ButtonProps, CalloutProps, CardProps, ElevationCardProps, IconProps, ListGroupProps, ListProps, SpinnerProps };
|
package/dist/core.js
CHANGED
|
@@ -3155,29 +3155,30 @@ const AccordionImpl = memo((({title: title, children: children, defaultOpen: de
|
|
|
3155
3155
|
}), headerClassNames = generateHeaderClassNames(), panelClassNames = ACCORDION.SELECTORS.PANEL.replace(".", ""), hasCompoundComponents = React.Children.toArray(children).some((child => {
|
|
3156
3156
|
var _context;
|
|
3157
3157
|
|
|
3158
|
-
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "AccordionHeader", "AccordionBody" ]).call(_context, child.type.displayName);
|
|
3158
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context = [ "AccordionHeader", "AccordionBody" ]).call(_context, child.type.displayName || "");
|
|
3159
3159
|
})), content = jsx("div", {
|
|
3160
3160
|
className: generateClassNames(className) + (glass ? " c-accordion--glass" : ""),
|
|
3161
3161
|
style: style,
|
|
3162
3162
|
children: hasCompoundComponents ? React.Children.map(children, (child => {
|
|
3163
3163
|
if ( React.isValidElement(child)) {
|
|
3164
|
+
const childProps = child.props;
|
|
3164
3165
|
if ("AccordionHeader" === child.type.displayName)
|
|
3165
3166
|
return React.cloneElement(child, {
|
|
3166
3167
|
id: buttonId,
|
|
3167
|
-
className: `${headerClassNames} ${
|
|
3168
|
+
className: `${headerClassNames} ${childProps.className || ""}`.trim(),
|
|
3168
3169
|
onClick: e => {
|
|
3169
|
-
toggle(),
|
|
3170
|
+
toggle(), childProps?.onClick?.(e);
|
|
3170
3171
|
},
|
|
3171
3172
|
"aria-expanded": state.isOpen,
|
|
3172
3173
|
"aria-controls": panelId,
|
|
3173
3174
|
"aria-disabled": disabled,
|
|
3174
3175
|
disabled: disabled,
|
|
3175
|
-
iconPosition:
|
|
3176
|
+
iconPosition: childProps.iconPosition || iconPosition
|
|
3176
3177
|
});
|
|
3177
3178
|
if ("AccordionBody" === child.type.displayName)
|
|
3178
3179
|
return React.cloneElement(child, {
|
|
3179
3180
|
id: panelId,
|
|
3180
|
-
className: `${panelClassNames} ${
|
|
3181
|
+
className: `${panelClassNames} ${childProps.className || ""}`.trim(),
|
|
3181
3182
|
"aria-labelledby": buttonId,
|
|
3182
3183
|
panelRef: panelRef,
|
|
3183
3184
|
contentRef: contentRef
|
|
@@ -3468,8 +3469,9 @@ const Breadcrumb = memo((function({items: items, divider: divider, className: c
|
|
|
3468
3469
|
const childrenCount = Children.count(children);
|
|
3469
3470
|
content = Children.map(children, ((child, index) => {
|
|
3470
3471
|
if ( isValidElement(child)) {
|
|
3471
|
-
const isLast = index === childrenCount - 1,
|
|
3472
|
-
|
|
3472
|
+
const isLast = index === childrenCount - 1, {active: active, linkAs: linkAs, ...otherProps} = child.props;
|
|
3473
|
+
// Extract props from the child element with proper typing
|
|
3474
|
+
|
|
3473
3475
|
return cloneElement(child, {
|
|
3474
3476
|
active: active ?? (!!isLast || void 0),
|
|
3475
3477
|
linkAs: linkAs ?? linkComponent
|
|
@@ -3490,7 +3492,7 @@ const Breadcrumb = memo((function({items: items, divider: divider, className: c
|
|
|
3490
3492
|
|
|
3491
3493
|
Breadcrumb.displayName = "Breadcrumb", Breadcrumb.Item = BreadcrumbItem;
|
|
3492
3494
|
|
|
3493
|
-
const Spinner = memo((({size: size = "md", variant: variant = "primary", fullscreen: fullscreen = !1, className: className = "", style: style, glass: glass, "aria-label": ariaLabel, role: role = "status"}) => {
|
|
3495
|
+
const Spinner = memo( forwardRef((({size: size = "md", variant: variant = "primary", fullscreen: fullscreen = !1, className: className = "", style: style, glass: glass, "aria-label": ariaLabel, role: role = "status", "aria-live": ariaLive = "polite", "aria-describe": ariaDescribe, ...rest}, ref) => {
|
|
3494
3496
|
const {generateSpinnerClass: generateSpinnerClass} =
|
|
3495
3497
|
/**
|
|
3496
3498
|
* Spinner state and functionality
|
|
@@ -3526,13 +3528,17 @@ const Spinner = memo((({size: size = "md", variant: variant = "primary", fullsc
|
|
|
3526
3528
|
fullscreen: fullscreen,
|
|
3527
3529
|
className: `${className} ${glass ? "c-spinner--glass" : ""}`.trim()
|
|
3528
3530
|
}), spinnerContent = jsx("div", {
|
|
3531
|
+
ref: ref,
|
|
3529
3532
|
className: spinnerClass,
|
|
3530
3533
|
style: style,
|
|
3531
3534
|
role: role,
|
|
3532
3535
|
"aria-label": ariaLabel || "Loading",
|
|
3536
|
+
"aria-live": ariaLive,
|
|
3537
|
+
"aria-describe": ariaDescribe,
|
|
3538
|
+
...rest,
|
|
3533
3539
|
children: jsx("span", {
|
|
3534
3540
|
className: "u-visually-hidden",
|
|
3535
|
-
children: ariaLabel || "Loading..."
|
|
3541
|
+
children: ariaLabel || "Loading content..."
|
|
3536
3542
|
})
|
|
3537
3543
|
});
|
|
3538
3544
|
if (glass) {
|
|
@@ -3551,7 +3557,7 @@ const Spinner = memo((({size: size = "md", variant: variant = "primary", fullsc
|
|
|
3551
3557
|
});
|
|
3552
3558
|
}
|
|
3553
3559
|
return spinnerContent;
|
|
3554
|
-
}));
|
|
3560
|
+
})));
|
|
3555
3561
|
|
|
3556
3562
|
Spinner.displayName = "Spinner";
|
|
3557
3563
|
|
|
@@ -3840,7 +3846,66 @@ const Button = React.memo( forwardRef((({label: label, children: children, onCl
|
|
|
3840
3846
|
|
|
3841
3847
|
Button.displayName = "Button";
|
|
3842
3848
|
|
|
3843
|
-
const
|
|
3849
|
+
const CardHeader = forwardRef((({title: title, subtitle: subtitle, action: action, icon: icon, children: children, className: className = "", ...props}, ref) => {
|
|
3850
|
+
const headerClasses = `${CARD.SELECTORS.HEADER.substring(1)} ${className}`.trim();
|
|
3851
|
+
return jsxs("div", {
|
|
3852
|
+
ref: ref,
|
|
3853
|
+
className: headerClasses,
|
|
3854
|
+
...props,
|
|
3855
|
+
children: [ icon && jsx("div", {
|
|
3856
|
+
className: CARD.SELECTORS.ICON.substring(1),
|
|
3857
|
+
children: icon
|
|
3858
|
+
}), (title || subtitle) && jsxs("div", {
|
|
3859
|
+
children: [ title && jsx("h3", {
|
|
3860
|
+
className: CARD.SELECTORS.TITLE.substring(1),
|
|
3861
|
+
children: title
|
|
3862
|
+
}), subtitle && jsx("p", {
|
|
3863
|
+
className: CARD.SELECTORS.TEXT.substring(1),
|
|
3864
|
+
children: subtitle
|
|
3865
|
+
}) ]
|
|
3866
|
+
}), action && jsx("div", {
|
|
3867
|
+
className: CARD.SELECTORS.ACTIONS.substring(1),
|
|
3868
|
+
children: action
|
|
3869
|
+
}), children ]
|
|
3870
|
+
});
|
|
3871
|
+
}));
|
|
3872
|
+
|
|
3873
|
+
CardHeader.displayName = "CardHeader";
|
|
3874
|
+
|
|
3875
|
+
const CardBody = forwardRef((({scrollable: scrollable = !1, maxHeight: maxHeight, children: children, className: className = "", style: style, ...props}, ref) => {
|
|
3876
|
+
const bodyClasses = `${CARD.SELECTORS.BODY.substring(1)} ${scrollable ? "c-card__body--scrollable" : ""} ${className}`.trim(), bodyStyle = {
|
|
3877
|
+
...style,
|
|
3878
|
+
...scrollable && maxHeight ? {
|
|
3879
|
+
maxHeight: "number" == typeof maxHeight ? `${maxHeight}px` : maxHeight,
|
|
3880
|
+
overflowY: "auto"
|
|
3881
|
+
} : {}
|
|
3882
|
+
};
|
|
3883
|
+
return jsx("div", {
|
|
3884
|
+
ref: ref,
|
|
3885
|
+
className: bodyClasses,
|
|
3886
|
+
style: bodyStyle,
|
|
3887
|
+
...props,
|
|
3888
|
+
children: children
|
|
3889
|
+
});
|
|
3890
|
+
}));
|
|
3891
|
+
|
|
3892
|
+
CardBody.displayName = "CardBody";
|
|
3893
|
+
|
|
3894
|
+
const CardFooter = forwardRef((({align: align, children: children, className: className = "", style: style, ...props}, ref) => {
|
|
3895
|
+
const footerClasses = `${CARD.SELECTORS.FOOTER.substring(1)} ${align ? `c-card__footer--align-${align}` : ""} ${className}`.trim();
|
|
3896
|
+
return jsx("div", {
|
|
3897
|
+
ref: ref,
|
|
3898
|
+
className: footerClasses,
|
|
3899
|
+
style: style,
|
|
3900
|
+
...props,
|
|
3901
|
+
children: children
|
|
3902
|
+
});
|
|
3903
|
+
}));
|
|
3904
|
+
|
|
3905
|
+
CardFooter.displayName = "CardFooter";
|
|
3906
|
+
|
|
3907
|
+
// Main Card component implementation
|
|
3908
|
+
const CardImpl = React.memo( forwardRef((({
|
|
3844
3909
|
// Variants
|
|
3845
3910
|
size: size = "md", variant: variant = "", appearance: appearance = "filled", elevation: elevation = "none", hoverable: hoverable = !1, hoverElevation: hoverElevation = "md",
|
|
3846
3911
|
// Layout
|
|
@@ -3971,75 +4036,15 @@ className: className = "", style: style, ...rest}, ref) => {
|
|
|
3971
4036
|
}) : divElement;
|
|
3972
4037
|
})));
|
|
3973
4038
|
|
|
3974
|
-
|
|
4039
|
+
CardImpl.displayName = "Card";
|
|
3975
4040
|
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
return jsxs("div", {
|
|
3979
|
-
ref: ref,
|
|
3980
|
-
className: headerClasses,
|
|
3981
|
-
...props,
|
|
3982
|
-
children: [ icon && jsx("div", {
|
|
3983
|
-
className: CARD.SELECTORS.ICON.substring(1),
|
|
3984
|
-
children: icon
|
|
3985
|
-
}), (title || subtitle) && jsxs("div", {
|
|
3986
|
-
children: [ title && jsx("h3", {
|
|
3987
|
-
className: CARD.SELECTORS.TITLE.substring(1),
|
|
3988
|
-
children: title
|
|
3989
|
-
}), subtitle && jsx("p", {
|
|
3990
|
-
className: CARD.SELECTORS.TEXT.substring(1),
|
|
3991
|
-
children: subtitle
|
|
3992
|
-
}) ]
|
|
3993
|
-
}), action && jsx("div", {
|
|
3994
|
-
className: CARD.SELECTORS.ACTIONS.substring(1),
|
|
3995
|
-
children: action
|
|
3996
|
-
}), children ]
|
|
3997
|
-
});
|
|
3998
|
-
}));
|
|
4041
|
+
// Create compound component with proper typing
|
|
4042
|
+
const CardWithSubcomponents = CardImpl;
|
|
3999
4043
|
|
|
4000
|
-
CardHeader.
|
|
4044
|
+
CardWithSubcomponents.Header = CardHeader, CardWithSubcomponents.Body = CardBody,
|
|
4045
|
+
CardWithSubcomponents.Footer = CardFooter;
|
|
4001
4046
|
|
|
4002
|
-
const
|
|
4003
|
-
const bodyClasses = `${CARD.SELECTORS.BODY.substring(1)} ${scrollable ? "c-card__body--scrollable" : ""} ${className}`.trim(), bodyStyle = {
|
|
4004
|
-
...style,
|
|
4005
|
-
...scrollable && maxHeight ? {
|
|
4006
|
-
maxHeight: "number" == typeof maxHeight ? `${maxHeight}px` : maxHeight,
|
|
4007
|
-
overflowY: "auto"
|
|
4008
|
-
} : {}
|
|
4009
|
-
};
|
|
4010
|
-
return jsx("div", {
|
|
4011
|
-
ref: ref,
|
|
4012
|
-
className: bodyClasses,
|
|
4013
|
-
style: bodyStyle,
|
|
4014
|
-
...props,
|
|
4015
|
-
children: children
|
|
4016
|
-
});
|
|
4017
|
-
}));
|
|
4018
|
-
|
|
4019
|
-
CardBody.displayName = "CardBody";
|
|
4020
|
-
|
|
4021
|
-
const CardFooter = forwardRef((({align: align, children: children, className: className = "", style: style, ...props}, ref) => {
|
|
4022
|
-
const footerClasses = `${CARD.SELECTORS.FOOTER.substring(1)} ${align ? `c-card__footer--align-${align}` : ""} ${className}`.trim();
|
|
4023
|
-
return jsx("div", {
|
|
4024
|
-
ref: ref,
|
|
4025
|
-
className: footerClasses,
|
|
4026
|
-
style: style,
|
|
4027
|
-
...props,
|
|
4028
|
-
children: children
|
|
4029
|
-
});
|
|
4030
|
-
}));
|
|
4031
|
-
|
|
4032
|
-
CardFooter.displayName = "CardFooter",
|
|
4033
|
-
// Attach subcomponents to Card
|
|
4034
|
-
Card.Header = CardHeader, Card.Body = CardBody, Card.Footer = CardFooter;
|
|
4035
|
-
|
|
4036
|
-
/**
|
|
4037
|
-
* Hook for managing Card component state and behaviors
|
|
4038
|
-
*
|
|
4039
|
-
* @param options - Configuration options for the card
|
|
4040
|
-
* @returns Card state and handlers
|
|
4041
|
-
*/
|
|
4042
|
-
const ElevationCard = ({elevationClass: elevationClass = "is-elevated", className: className = "", style: style, children: children, onClick: onClick, ...props}) => {
|
|
4047
|
+
const Card = CardWithSubcomponents, ElevationCard = ({elevationClass: elevationClass = "is-elevated", className: className = "", style: style, children: children, onClick: onClick, ...props}) => {
|
|
4043
4048
|
const {getCardProps: getCardProps} = ((options = {}) => {
|
|
4044
4049
|
const {elevationEffect: elevationEffect = !1, elevationClass: elevationClass = CARD.CLASSES.ACTIVE, flipEffect: flipEffect = !1, flipTrigger: flipTrigger = "click", focusEffect: focusEffect = !1, clickable: clickable = !1, onClick: onClick} = options, cardRef = useRef(null), frontRef = useRef(null), backRef = useRef(null), [isFlipped, setIsFlipped] = useState(!1), [isElevated, setIsElevated] = useState(!1), [isFocused, setIsFocused] = useState(!1), [isHovered, setIsHovered] = useState(!1), handleClick = useCallback((event => {
|
|
4045
4050
|
flipEffect && "click" === flipTrigger && setIsFlipped((prev => !prev)), onClick && onClick(event);
|
|
@@ -4110,7 +4115,12 @@ const ElevationCard = ({elevationClass: elevationClass = "is-elevated", classNam
|
|
|
4110
4115
|
});
|
|
4111
4116
|
};
|
|
4112
4117
|
|
|
4113
|
-
|
|
4118
|
+
/**
|
|
4119
|
+
* Hook for managing Card component state and behaviors
|
|
4120
|
+
*
|
|
4121
|
+
* @param options - Configuration options for the card
|
|
4122
|
+
* @returns Card state and handlers
|
|
4123
|
+
*/ ElevationCard.displayName = "ElevationCard";
|
|
4114
4124
|
|
|
4115
4125
|
// Subcomponents
|
|
4116
4126
|
const CalloutIcon = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
|
|
@@ -4231,7 +4241,7 @@ const Callout = memo((({title: title, children: children, icon: icon, variant:
|
|
|
4231
4241
|
}, calloutContent = React.Children.toArray(children).some((child => {
|
|
4232
4242
|
var _context3;
|
|
4233
4243
|
|
|
4234
|
-
return React.isValidElement(child) && _includesInstanceProperty(_context3 = [ "CalloutIcon", "CalloutMessage", "CalloutTitle", "CalloutText", "CalloutActions", "CalloutContent" ]).call(_context3, child.type.displayName);
|
|
4244
|
+
return React.isValidElement(child) && _includesInstanceProperty(_context3 = [ "CalloutIcon", "CalloutMessage", "CalloutTitle", "CalloutText", "CalloutActions", "CalloutContent" ]).call(_context3, child.type.displayName || "");
|
|
4235
4245
|
})) ? children : jsxs(Fragment, {
|
|
4236
4246
|
children: [ jsxs("div", {
|
|
4237
4247
|
className: "c-callout__content",
|