infinity-ui-elements 1.9.15 → 1.9.16

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/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./components/Alert";
2
2
  export * from "./components/Amount";
3
3
  export * from "./components/Avatar";
4
4
  export * from "./components/Badge";
5
+ export * from "./components/BottomSheet";
5
6
  export * from "./components/Button";
6
7
  export * from "./components/ButtonGroup";
7
8
  export * from "./components/Checkbox";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,w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Ac,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1317,6 +1317,183 @@ const Badge = React.forwardRef(({ className, variant, size, color, showDot = fal
1317
1317
  });
1318
1318
  Badge.displayName = "Badge";
1319
1319
 
1320
+ const dividerVariants = cva("", {
1321
+ variants: {
1322
+ orientation: {
1323
+ horizontal: "w-full",
1324
+ vertical: "h-full",
1325
+ },
1326
+ thickness: {
1327
+ thinner: "",
1328
+ thin: "",
1329
+ thick: "",
1330
+ thicker: "",
1331
+ },
1332
+ lineStyle: {
1333
+ solid: "border-solid",
1334
+ dashed: "border-dashed",
1335
+ },
1336
+ variant: {
1337
+ normal: "",
1338
+ subtle: "",
1339
+ muted: "",
1340
+ },
1341
+ },
1342
+ compoundVariants: [
1343
+ // Horizontal orientation with thickness
1344
+ {
1345
+ orientation: "horizontal",
1346
+ thickness: "thinner",
1347
+ class: "border-t-[0.5px]",
1348
+ },
1349
+ {
1350
+ orientation: "horizontal",
1351
+ thickness: "thin",
1352
+ class: "border-t-[1px]",
1353
+ },
1354
+ {
1355
+ orientation: "horizontal",
1356
+ thickness: "thick",
1357
+ class: "border-t-[2px]",
1358
+ },
1359
+ {
1360
+ orientation: "horizontal",
1361
+ thickness: "thicker",
1362
+ class: "border-t-[3px]",
1363
+ },
1364
+ // Vertical orientation with thickness
1365
+ {
1366
+ orientation: "vertical",
1367
+ thickness: "thinner",
1368
+ class: "border-l-[0.5px]",
1369
+ },
1370
+ {
1371
+ orientation: "vertical",
1372
+ thickness: "thin",
1373
+ class: "border-l-[1px]",
1374
+ },
1375
+ {
1376
+ orientation: "vertical",
1377
+ thickness: "thick",
1378
+ class: "border-l-[2px]",
1379
+ },
1380
+ {
1381
+ orientation: "vertical",
1382
+ thickness: "thicker",
1383
+ class: "border-l-[3px]",
1384
+ },
1385
+ // Normal variant colors
1386
+ {
1387
+ variant: "normal",
1388
+ class: "border-surface-outline-neutral-normal",
1389
+ },
1390
+ // Subtle variant colors
1391
+ {
1392
+ variant: "subtle",
1393
+ class: "border-surface-outline-neutral-subtle",
1394
+ },
1395
+ // Muted variant colors
1396
+ {
1397
+ variant: "muted",
1398
+ class: "border-surface-outline-neutral-muted",
1399
+ },
1400
+ ],
1401
+ defaultVariants: {
1402
+ orientation: "horizontal",
1403
+ thickness: "thin",
1404
+ lineStyle: "solid",
1405
+ variant: "normal",
1406
+ },
1407
+ });
1408
+ const Divider = React.forwardRef(({ className, orientation = "horizontal", thickness = "thin", lineStyle = "solid", variant = "normal", ...props }, ref) => {
1409
+ return (jsx("div", { ref: ref, role: "separator", "aria-orientation": orientation, className: cn(dividerVariants({ orientation, thickness, lineStyle, variant }), className), ...props }));
1410
+ });
1411
+ Divider.displayName = "Divider";
1412
+
1413
+ const BottomSheet = React.forwardRef(({ isOpen, onClose, title, description, footer, children, variant = "default", showCloseButton = true, showDragHandle = true, closeOnOverlayClick = true, closeOnEscape = true, closeOnSwipeDown = true, maxHeight = "90vh", className, contentClassName, headerClassName, bodyClassName, footerClassName, overlayClassName, ariaLabel, ariaDescribedBy, }, ref) => {
1414
+ const sheetRef = React.useRef(null);
1415
+ const contentRef = ref || sheetRef;
1416
+ const [isClosing, setIsClosing] = React.useState(false);
1417
+ const [touchStart, setTouchStart] = React.useState(null);
1418
+ const [touchEnd, setTouchEnd] = React.useState(null);
1419
+ // Handle escape key
1420
+ React.useEffect(() => {
1421
+ if (!isOpen || !closeOnEscape || !onClose)
1422
+ return;
1423
+ const handleEscape = (e) => {
1424
+ if (e.key === "Escape") {
1425
+ handleClose();
1426
+ }
1427
+ };
1428
+ document.addEventListener("keydown", handleEscape);
1429
+ return () => document.removeEventListener("keydown", handleEscape);
1430
+ }, [isOpen, closeOnEscape, onClose]);
1431
+ // Prevent body scroll when bottom sheet is open
1432
+ React.useEffect(() => {
1433
+ if (isOpen) {
1434
+ document.body.style.overflow = "hidden";
1435
+ }
1436
+ else {
1437
+ document.body.style.overflow = "";
1438
+ }
1439
+ return () => {
1440
+ document.body.style.overflow = "";
1441
+ };
1442
+ }, [isOpen]);
1443
+ // Reset closing state when opening
1444
+ React.useEffect(() => {
1445
+ if (isOpen) {
1446
+ setIsClosing(false);
1447
+ }
1448
+ }, [isOpen]);
1449
+ // Handle close with animation
1450
+ const handleClose = () => {
1451
+ if (!onClose)
1452
+ return;
1453
+ setIsClosing(true);
1454
+ // Wait for animation to complete before calling onClose
1455
+ setTimeout(() => {
1456
+ onClose();
1457
+ setIsClosing(false);
1458
+ }, 300); // Match animation duration
1459
+ };
1460
+ // Handle overlay click
1461
+ const handleOverlayClick = (e) => {
1462
+ if (closeOnOverlayClick && e.target === e.currentTarget) {
1463
+ handleClose();
1464
+ }
1465
+ };
1466
+ // Handle touch events for swipe down
1467
+ const handleTouchStart = (e) => {
1468
+ if (!closeOnSwipeDown)
1469
+ return;
1470
+ setTouchEnd(null);
1471
+ setTouchStart(e.targetTouches[0].clientY);
1472
+ };
1473
+ const handleTouchMove = (e) => {
1474
+ if (!closeOnSwipeDown)
1475
+ return;
1476
+ setTouchEnd(e.targetTouches[0].clientY);
1477
+ };
1478
+ const handleTouchEnd = () => {
1479
+ if (!closeOnSwipeDown || !touchStart || !touchEnd)
1480
+ return;
1481
+ const distance = touchEnd - touchStart;
1482
+ const isSwipeDown = distance > 100; // Minimum swipe distance
1483
+ if (isSwipeDown) {
1484
+ handleClose();
1485
+ }
1486
+ setTouchStart(null);
1487
+ setTouchEnd(null);
1488
+ };
1489
+ // Don't render if not open and not closing
1490
+ if (!isOpen && !isClosing)
1491
+ return null;
1492
+ const hasHeader = title || description;
1493
+ return (jsxs("div", { className: cn("fixed inset-0 z-9999 flex items-end justify-center", className), role: "dialog", "aria-modal": "true", "aria-label": ariaLabel || title, "aria-describedby": ariaDescribedBy, children: [jsx("div", { className: cn("absolute inset-0 z-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300", isClosing ? "opacity-0" : "opacity-100", overlayClassName), onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { ref: contentRef, className: cn("relative z-10 w-full transition-transform duration-300", "flex flex-col overflow-hidden", variant === "default" && "bg-white rounded-t-2xl shadow-xl", isClosing ? "animate-slide-out-bottom" : "animate-slide-in-bottom", contentClassName), style: { maxHeight }, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, children: [showDragHandle && variant === "default" && (jsx("div", { className: "flex justify-center pt-3 pb-2", children: jsx("div", { className: "w-10 h-1 bg-neutral-300 rounded-full" }) })), hasHeader && (jsxs("div", { className: cn("flex items-start justify-between gap-4", variant === "default" && "px-6", variant === "default" && !showDragHandle && "pt-6", variant === "default" && showDragHandle && "pt-2", variant === "default" && !description && "pb-4", variant === "default" && description && "pb-2", headerClassName), children: [jsxs("div", { className: "flex-1", children: [title && (jsx(Text, { as: "h2", variant: "body", size: "large", weight: "semibold", color: "default", children: title })), description && (jsx(Text, { as: "p", variant: "body", size: "small", weight: "regular", color: "subtle", className: "mt-1", children: description }))] }), showCloseButton && onClose && (jsx(IconButton, { icon: "close", onClick: handleClose, color: "neutral", size: "small", "aria-label": "Close bottom sheet", className: "shrink-0" }))] })), !hasHeader && showCloseButton && onClose && (jsx("div", { className: cn("absolute z-10", variant === "default" && "top-4 right-4"), children: jsx(IconButton, { icon: "close", onClick: handleClose, color: "neutral", size: "small", "aria-label": "Close bottom sheet" }) })), jsx("div", { className: cn("flex-1 overflow-y-auto", variant === "default" && "px-6", variant === "default" && hasHeader && "py-4", variant === "default" && !hasHeader && !showDragHandle && "pt-6 pb-4", variant === "default" && !hasHeader && showDragHandle && "pt-2 pb-4", variant === "default" && !footer && "pb-6", bodyClassName), children: children }), footer && (jsxs("div", { className: "flex flex-col", children: [variant === "default" && (jsx(Divider, { thickness: "thin", variant: "muted" })), jsx("div", { className: cn("flex items-center justify-end gap-3", variant === "default" && "px-6 py-4", footerClassName), children: footer })] }))] })] }));
1494
+ });
1495
+ BottomSheet.displayName = "BottomSheet";
1496
+
1320
1497
  const buttonGroupVariants = cva("inline-flex", {
1321
1498
  variants: {
1322
1499
  variant: {
@@ -2940,99 +3117,6 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
2940
3117
  });
2941
3118
  DateRangePicker.displayName = "DateRangePicker";
2942
3119
 
2943
- const dividerVariants = cva("", {
2944
- variants: {
2945
- orientation: {
2946
- horizontal: "w-full",
2947
- vertical: "h-full",
2948
- },
2949
- thickness: {
2950
- thinner: "",
2951
- thin: "",
2952
- thick: "",
2953
- thicker: "",
2954
- },
2955
- lineStyle: {
2956
- solid: "border-solid",
2957
- dashed: "border-dashed",
2958
- },
2959
- variant: {
2960
- normal: "",
2961
- subtle: "",
2962
- muted: "",
2963
- },
2964
- },
2965
- compoundVariants: [
2966
- // Horizontal orientation with thickness
2967
- {
2968
- orientation: "horizontal",
2969
- thickness: "thinner",
2970
- class: "border-t-[0.5px]",
2971
- },
2972
- {
2973
- orientation: "horizontal",
2974
- thickness: "thin",
2975
- class: "border-t-[1px]",
2976
- },
2977
- {
2978
- orientation: "horizontal",
2979
- thickness: "thick",
2980
- class: "border-t-[2px]",
2981
- },
2982
- {
2983
- orientation: "horizontal",
2984
- thickness: "thicker",
2985
- class: "border-t-[3px]",
2986
- },
2987
- // Vertical orientation with thickness
2988
- {
2989
- orientation: "vertical",
2990
- thickness: "thinner",
2991
- class: "border-l-[0.5px]",
2992
- },
2993
- {
2994
- orientation: "vertical",
2995
- thickness: "thin",
2996
- class: "border-l-[1px]",
2997
- },
2998
- {
2999
- orientation: "vertical",
3000
- thickness: "thick",
3001
- class: "border-l-[2px]",
3002
- },
3003
- {
3004
- orientation: "vertical",
3005
- thickness: "thicker",
3006
- class: "border-l-[3px]",
3007
- },
3008
- // Normal variant colors
3009
- {
3010
- variant: "normal",
3011
- class: "border-surface-outline-neutral-normal",
3012
- },
3013
- // Subtle variant colors
3014
- {
3015
- variant: "subtle",
3016
- class: "border-surface-outline-neutral-subtle",
3017
- },
3018
- // Muted variant colors
3019
- {
3020
- variant: "muted",
3021
- class: "border-surface-outline-neutral-muted",
3022
- },
3023
- ],
3024
- defaultVariants: {
3025
- orientation: "horizontal",
3026
- thickness: "thin",
3027
- lineStyle: "solid",
3028
- variant: "normal",
3029
- },
3030
- });
3031
- const Divider = React.forwardRef(({ className, orientation = "horizontal", thickness = "thin", lineStyle = "solid", variant = "normal", ...props }, ref) => {
3032
- return (jsx("div", { ref: ref, role: "separator", "aria-orientation": orientation, className: cn(dividerVariants({ orientation, thickness, lineStyle, variant }), className), ...props }));
3033
- });
3034
- Divider.displayName = "Divider";
3035
-
3036
3120
  const DropdownMenu = React.forwardRef(({ items = [], customContent, customContentClassName, sectionHeading, isLoading = false, isEmpty = false, emptyTitle = "No Search Results Found", emptyDescription = "Add description of what the user can search for here.", emptyLinkText = "Link to support site", onEmptyLinkClick, primaryButtonText = "Primary", secondaryButtonText = "Secondary", onPrimaryClick, onSecondaryClick, showChevron = false, emptyIcon, disableFooter = false, showFooter, footerLayout = "horizontal", onClose, focusedIndex = -1, className, width = "auto", maxHeight = "400px", }, ref) => {
3037
3121
  const renderContent = () => {
3038
3122
  if (isLoading) {
@@ -5948,5 +6032,5 @@ const UploadBox = React.forwardRef(({ label, helperText, errorText, successText,
5948
6032
  });
5949
6033
  UploadBox.displayName = "UploadBox";
5950
6034
 
5951
- export { Alert, Amount, Avatar, AvatarCell, Badge, Button, ButtonGroup, Checkbox, Counter, DatePicker, DateRangePicker, Divider, Dropdown, DropdownMenu, FormFooter, FormHeader, Icon, IconButton, IconCell, Link, ListItem, Modal, NumberCell, Pagination, Radio, RadioGroup, SearchableDropdown, Select, SelectTextField, SidePanel, Skeleton, SlotCell, SpacerCell, Switch, TabItem, Table, TableDetailPanel, Tabs, Text, TextArea, TextField, Toast, ToastProvider, Tooltip, UploadBox, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, checkboxVariants, cn, counterVariants, datePickerVariants, dateRangePickerVariants, dropdownVariants, getAvailableIcons, hasIcon, iconButtonVariants, iconRegistry, linkVariants, listItemVariants, paginationVariants, radioVariants, selectTriggerVariants, switchVariants, tableCellVariants, tableHeaderVariants, tableVariants, textAreaVariants, textFieldVariants, tooltipVariants, uploadBoxVariants, useToast };
6035
+ export { Alert, Amount, Avatar, AvatarCell, Badge, BottomSheet, Button, ButtonGroup, Checkbox, Counter, DatePicker, DateRangePicker, Divider, Dropdown, DropdownMenu, FormFooter, FormHeader, Icon, IconButton, IconCell, Link, ListItem, Modal, NumberCell, Pagination, Radio, RadioGroup, SearchableDropdown, Select, SelectTextField, SidePanel, Skeleton, SlotCell, SpacerCell, Switch, TabItem, Table, TableDetailPanel, Tabs, Text, TextArea, TextField, Toast, ToastProvider, Tooltip, UploadBox, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, checkboxVariants, cn, counterVariants, datePickerVariants, dateRangePickerVariants, dropdownVariants, getAvailableIcons, hasIcon, iconButtonVariants, iconRegistry, linkVariants, listItemVariants, paginationVariants, radioVariants, selectTriggerVariants, switchVariants, tableCellVariants, tableHeaderVariants, tableVariants, textAreaVariants, textFieldVariants, tooltipVariants, uploadBoxVariants, useToast };
5952
6036
  //# sourceMappingURL=index.esm.js.map