@ttoss/ui 5.11.0 → 6.0.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/dist/esm/index.js +140 -129
- package/dist/index.d.ts +63 -16
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -384,7 +384,6 @@ var InfiniteLinearProgress = /* @__PURE__ */__name(() => {
|
|
|
384
384
|
}, "InfiniteLinearProgress");
|
|
385
385
|
|
|
386
386
|
// src/components/Input.tsx
|
|
387
|
-
import { Icon as Icon4 } from "@ttoss/react-icons";
|
|
388
387
|
import { Input as InputUI } from "theme-ui";
|
|
389
388
|
var isInputIconConfig = /* @__PURE__ */__name(icon => {
|
|
390
389
|
return icon !== void 0 && typeof icon === "object" && "icon" in icon && (typeof icon.icon === "string" || typeof icon.icon === "object" && "body" in icon.icon);
|
|
@@ -425,24 +424,17 @@ var Input = /* @__PURE__ */__name(({
|
|
|
425
424
|
padding: 0,
|
|
426
425
|
border: "none"
|
|
427
426
|
}
|
|
428
|
-
}, normalizedLeadingIcon && /* @__PURE__ */React.createElement(
|
|
427
|
+
}, normalizedLeadingIcon && /* @__PURE__ */React.createElement(TooltipIcon, {
|
|
428
|
+
...normalizedLeadingIcon,
|
|
429
429
|
"data-testid": "input-leading-icon",
|
|
430
|
-
|
|
430
|
+
variant: normalizedLeadingIcon.variant ?? "info",
|
|
431
431
|
sx: {
|
|
432
432
|
position: "absolute",
|
|
433
433
|
alignSelf: "center",
|
|
434
434
|
left: "1rem",
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
variant: "leading-icon"
|
|
439
|
-
}, /* @__PURE__ */React.createElement(Icon4, {
|
|
440
|
-
inline: true,
|
|
441
|
-
icon: normalizedLeadingIcon.icon
|
|
442
|
-
})), normalizedLeadingIcon.tooltip && /* @__PURE__ */React.createElement(Tooltip, {
|
|
443
|
-
id: "input-leading-icon-tooltip",
|
|
444
|
-
...normalizedLeadingIcon.tooltipProps
|
|
445
|
-
}, normalizedLeadingIcon.tooltip)), /* @__PURE__ */React.createElement(InputUI, {
|
|
435
|
+
...normalizedLeadingIcon.sx
|
|
436
|
+
}
|
|
437
|
+
}), /* @__PURE__ */React.createElement(InputUI, {
|
|
446
438
|
sx: {
|
|
447
439
|
fontFamily: "body",
|
|
448
440
|
paddingY: "3",
|
|
@@ -454,30 +446,23 @@ var Input = /* @__PURE__ */__name(({
|
|
|
454
446
|
},
|
|
455
447
|
className,
|
|
456
448
|
...inputProps
|
|
457
|
-
}), trailingIcon && /* @__PURE__ */React.createElement(
|
|
449
|
+
}), trailingIcon && /* @__PURE__ */React.createElement(TooltipIcon, {
|
|
450
|
+
...trailingIcon,
|
|
458
451
|
"data-testid": "input-trailing-icon",
|
|
459
|
-
|
|
452
|
+
variant: trailingIcon.variant ?? "info",
|
|
460
453
|
sx: {
|
|
461
454
|
position: "absolute",
|
|
462
455
|
right: "1rem",
|
|
463
456
|
alignSelf: "center",
|
|
464
457
|
color: isWarning ? "feedback.text.caution.default" : void 0,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
onClick: trailingIcon.onClick
|
|
470
|
-
}, /* @__PURE__ */React.createElement(Icon4, {
|
|
471
|
-
inline: true,
|
|
472
|
-
icon: trailingIcon.icon
|
|
473
|
-
})), trailingIcon.tooltip && /* @__PURE__ */React.createElement(Tooltip, {
|
|
474
|
-
id: "input-trailing-icon-tooltip",
|
|
475
|
-
...trailingIcon.tooltipProps
|
|
476
|
-
}, trailingIcon.tooltip)));
|
|
458
|
+
fontSize: "xl",
|
|
459
|
+
...trailingIcon.sx
|
|
460
|
+
}
|
|
461
|
+
}));
|
|
477
462
|
}, "Input");
|
|
478
463
|
|
|
479
464
|
// src/components/InputNumber.tsx
|
|
480
|
-
import { Icon as
|
|
465
|
+
import { Icon as Icon4 } from "@ttoss/react-icons";
|
|
481
466
|
import * as React7 from "react";
|
|
482
467
|
import { Input as Input2 } from "theme-ui";
|
|
483
468
|
var InputNumber = /* @__PURE__ */React7.forwardRef(({
|
|
@@ -569,7 +554,7 @@ var InputNumber = /* @__PURE__ */React7.forwardRef(({
|
|
|
569
554
|
cursor: "pointer"
|
|
570
555
|
},
|
|
571
556
|
onClick: handleChangeUp
|
|
572
|
-
}, /* @__PURE__ */React7.createElement(
|
|
557
|
+
}, /* @__PURE__ */React7.createElement(Icon4, {
|
|
573
558
|
icon: "picker-down"
|
|
574
559
|
})), infoIcon && /* @__PURE__ */React7.createElement(Text, {
|
|
575
560
|
sx: {
|
|
@@ -580,7 +565,7 @@ var InputNumber = /* @__PURE__ */React7.forwardRef(({
|
|
|
580
565
|
cursor: onClickInfoIcon ? "pointer" : "default"
|
|
581
566
|
},
|
|
582
567
|
onClick: onClickInfoIcon
|
|
583
|
-
}, /* @__PURE__ */React7.createElement(
|
|
568
|
+
}, /* @__PURE__ */React7.createElement(Icon4, {
|
|
584
569
|
icon: "info"
|
|
585
570
|
})), /* @__PURE__ */React7.createElement(Text, {
|
|
586
571
|
sx: {
|
|
@@ -591,7 +576,7 @@ var InputNumber = /* @__PURE__ */React7.forwardRef(({
|
|
|
591
576
|
cursor: "pointer"
|
|
592
577
|
},
|
|
593
578
|
onClick: handleChangeDown
|
|
594
|
-
}, /* @__PURE__ */React7.createElement(
|
|
579
|
+
}, /* @__PURE__ */React7.createElement(Icon4, {
|
|
595
580
|
icon: "picker-up"
|
|
596
581
|
})));
|
|
597
582
|
});
|
|
@@ -629,9 +614,82 @@ var InputPassword = /* @__PURE__ */__name(({
|
|
|
629
614
|
}, "InputPassword");
|
|
630
615
|
|
|
631
616
|
// src/components/Label.tsx
|
|
632
|
-
import { Icon as
|
|
617
|
+
import { Icon as Icon5 } from "@ttoss/react-icons";
|
|
633
618
|
import * as React9 from "react";
|
|
634
619
|
import { Label as LabelUi } from "theme-ui";
|
|
620
|
+
|
|
621
|
+
// src/components/Tooltip.tsx
|
|
622
|
+
import { Tooltip as TooltipReact } from "react-tooltip";
|
|
623
|
+
var Tooltip = /* @__PURE__ */__name(({
|
|
624
|
+
variant = "info",
|
|
625
|
+
sx,
|
|
626
|
+
...props
|
|
627
|
+
}) => {
|
|
628
|
+
const className = `tooltip-component tooltip-${variant}`;
|
|
629
|
+
const getVariantStyles = /* @__PURE__ */__name(variantType => {
|
|
630
|
+
const variants = {
|
|
631
|
+
info: {
|
|
632
|
+
backgroundColor: "input.background.secondary.default",
|
|
633
|
+
color: "feedback.text.secondary.default",
|
|
634
|
+
borderColor: "feedback.border.secondary.default"
|
|
635
|
+
},
|
|
636
|
+
success: {
|
|
637
|
+
backgroundColor: "feedback.background.positive.default",
|
|
638
|
+
color: "feedback.text.positive.default",
|
|
639
|
+
borderColor: "feedback.border.positive.default"
|
|
640
|
+
},
|
|
641
|
+
warning: {
|
|
642
|
+
backgroundColor: "feedback.background.caution.default",
|
|
643
|
+
color: "feedback.text.caution.default",
|
|
644
|
+
borderColor: "feedback.border.caution.default"
|
|
645
|
+
},
|
|
646
|
+
error: {
|
|
647
|
+
backgroundColor: "feedback.background.negative.default",
|
|
648
|
+
color: "feedback.text.negative.default",
|
|
649
|
+
borderColor: "feedback.border.negative.default"
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
return variants[variantType] || variants.info;
|
|
653
|
+
}, "getVariantStyles");
|
|
654
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
655
|
+
sx: /* @__PURE__ */__name(({
|
|
656
|
+
fonts
|
|
657
|
+
}) => {
|
|
658
|
+
const variantStyles = getVariantStyles(variant);
|
|
659
|
+
return {
|
|
660
|
+
".example-arrow": {
|
|
661
|
+
display: "none"
|
|
662
|
+
},
|
|
663
|
+
".tooltip-component": {
|
|
664
|
+
fontFamily: fonts?.body,
|
|
665
|
+
paddingY: "2",
|
|
666
|
+
paddingX: "3",
|
|
667
|
+
border: "sm",
|
|
668
|
+
borderRadius: "xl",
|
|
669
|
+
zIndex: "tooltip",
|
|
670
|
+
opacity: "1",
|
|
671
|
+
lineHeight: "shorter",
|
|
672
|
+
letterSpacing: "wide",
|
|
673
|
+
a: {
|
|
674
|
+
color: "feedback.text.secondary.default",
|
|
675
|
+
fontFamily: "body",
|
|
676
|
+
textDecorationLine: "underline",
|
|
677
|
+
lineHeight: "normal"
|
|
678
|
+
},
|
|
679
|
+
...variantStyles,
|
|
680
|
+
...sx
|
|
681
|
+
},
|
|
682
|
+
[`&.tooltip-${variant}`]: variantStyles
|
|
683
|
+
};
|
|
684
|
+
}, "sx")
|
|
685
|
+
}, /* @__PURE__ */React.createElement(TooltipReact, {
|
|
686
|
+
className,
|
|
687
|
+
...props,
|
|
688
|
+
classNameArrow: "example-arrow"
|
|
689
|
+
}, props.children));
|
|
690
|
+
}, "Tooltip");
|
|
691
|
+
|
|
692
|
+
// src/components/Label.tsx
|
|
635
693
|
var TOOLTIP_LABEL = "tooltip";
|
|
636
694
|
var Label = /* @__PURE__ */__name(({
|
|
637
695
|
children,
|
|
@@ -642,7 +700,6 @@ var Label = /* @__PURE__ */__name(({
|
|
|
642
700
|
const id = React9.useId();
|
|
643
701
|
const tooltipId = `${id}-tooltip`;
|
|
644
702
|
return /* @__PURE__ */React9.createElement(LabelUi, {
|
|
645
|
-
"data-tooltip-id": tooltipId,
|
|
646
703
|
sx: {
|
|
647
704
|
alignItems: "center",
|
|
648
705
|
fontSize: "sm",
|
|
@@ -653,27 +710,19 @@ var Label = /* @__PURE__ */__name(({
|
|
|
653
710
|
},
|
|
654
711
|
...props
|
|
655
712
|
}, children, tooltip && /* @__PURE__ */React9.createElement(Text, {
|
|
713
|
+
"data-tooltip-id": tooltipId,
|
|
656
714
|
sx: {
|
|
657
715
|
color: "currentcolor",
|
|
658
|
-
cursor: "pointer"
|
|
716
|
+
cursor: "pointer",
|
|
717
|
+
marginLeft: "1"
|
|
659
718
|
},
|
|
660
719
|
"aria-label": TOOLTIP_LABEL
|
|
661
|
-
},
|
|
662
|
-
|
|
663
|
-
icon: tooltip.icon
|
|
664
|
-
}) : /* @__PURE__ */React9.createElement(Icon6, {
|
|
665
|
-
inline: true,
|
|
666
|
-
icon: "fluent:info-24-regular"
|
|
720
|
+
}, /* @__PURE__ */React9.createElement(Icon5, {
|
|
721
|
+
icon: "info"
|
|
667
722
|
}), /* @__PURE__ */React9.createElement(Tooltip, {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
place: tooltip.place,
|
|
672
|
-
hidden: tooltip.hidden,
|
|
673
|
-
variant: tooltip.variant,
|
|
674
|
-
setIsOpen: tooltip.setIsOpen,
|
|
675
|
-
isOpen: tooltip.isOpen
|
|
676
|
-
}, tooltip.render)));
|
|
723
|
+
...tooltip,
|
|
724
|
+
id: tooltipId
|
|
725
|
+
})));
|
|
677
726
|
}, "Label");
|
|
678
727
|
|
|
679
728
|
// src/components/Link.tsx
|
|
@@ -867,7 +916,7 @@ var SegmentedControl = /* @__PURE__ */__name(({
|
|
|
867
916
|
}, "SegmentedControl");
|
|
868
917
|
|
|
869
918
|
// src/components/Select.tsx
|
|
870
|
-
import { Icon as
|
|
919
|
+
import { Icon as Icon6 } from "@ttoss/react-icons";
|
|
871
920
|
import * as React12 from "react";
|
|
872
921
|
import ReactSelect, { components } from "react-select";
|
|
873
922
|
var Control = /* @__PURE__ */__name(props => {
|
|
@@ -915,7 +964,7 @@ var DropdownIndicator = /* @__PURE__ */__name(props => {
|
|
|
915
964
|
display: "flex",
|
|
916
965
|
alignItems: "center"
|
|
917
966
|
}
|
|
918
|
-
}, /* @__PURE__ */React12.createElement(
|
|
967
|
+
}, /* @__PURE__ */React12.createElement(Icon6, {
|
|
919
968
|
icon: "picker-down"
|
|
920
969
|
}));
|
|
921
970
|
}, "DropdownIndicator");
|
|
@@ -991,7 +1040,7 @@ var ValueContainer = /* @__PURE__ */__name(({
|
|
|
991
1040
|
lineHeight: 0,
|
|
992
1041
|
fontSize: "md"
|
|
993
1042
|
}
|
|
994
|
-
}, /* @__PURE__ */React12.createElement(
|
|
1043
|
+
}, /* @__PURE__ */React12.createElement(Icon6, {
|
|
995
1044
|
icon: finalLeadingIcon
|
|
996
1045
|
})), /* @__PURE__ */React12.createElement(Flex, {
|
|
997
1046
|
sx: {
|
|
@@ -1007,7 +1056,7 @@ var ValueContainer = /* @__PURE__ */__name(({
|
|
|
1007
1056
|
fontSize: "md",
|
|
1008
1057
|
color: trailingIconColor
|
|
1009
1058
|
}
|
|
1010
|
-
}, /* @__PURE__ */React12.createElement(
|
|
1059
|
+
}, /* @__PURE__ */React12.createElement(Icon6, {
|
|
1011
1060
|
icon: hasError ? "warning-alt" : trailingIcon
|
|
1012
1061
|
})));
|
|
1013
1062
|
}, "ValueContainer");
|
|
@@ -1193,7 +1242,7 @@ var Tag = /* @__PURE__ */__name(({
|
|
|
1193
1242
|
}, "Tag");
|
|
1194
1243
|
|
|
1195
1244
|
// src/components/Textarea.tsx
|
|
1196
|
-
import { Icon as
|
|
1245
|
+
import { Icon as Icon7 } from "@ttoss/react-icons";
|
|
1197
1246
|
import * as React14 from "react";
|
|
1198
1247
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
1199
1248
|
var Textarea = /* @__PURE__ */React14.forwardRef(({
|
|
@@ -1228,97 +1277,59 @@ var Textarea = /* @__PURE__ */React14.forwardRef(({
|
|
|
1228
1277
|
right: "1.25rem",
|
|
1229
1278
|
top: "0.75rem"
|
|
1230
1279
|
}
|
|
1231
|
-
}, /* @__PURE__ */React14.createElement(
|
|
1280
|
+
}, /* @__PURE__ */React14.createElement(Icon7, {
|
|
1232
1281
|
inline: true,
|
|
1233
1282
|
icon: trailingIcon
|
|
1234
1283
|
})));
|
|
1235
1284
|
});
|
|
1236
1285
|
Textarea.displayName = "Textarea";
|
|
1237
1286
|
|
|
1238
|
-
// src/components/
|
|
1239
|
-
import {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1287
|
+
// src/components/TooltipIcon.tsx
|
|
1288
|
+
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
1289
|
+
import * as React15 from "react";
|
|
1290
|
+
var TooltipIcon = /* @__PURE__ */__name(({
|
|
1291
|
+
icon,
|
|
1292
|
+
onClick,
|
|
1293
|
+
tooltip,
|
|
1294
|
+
tooltipProps,
|
|
1295
|
+
"data-testid": dataTestId,
|
|
1296
|
+
variant,
|
|
1297
|
+
sx
|
|
1244
1298
|
}) => {
|
|
1245
|
-
const
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
color: "feedback.text.negative.default",
|
|
1266
|
-
borderColor: "feedback.border.negative.default"
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
return variants[variantType] || variants.info;
|
|
1270
|
-
}, "getVariantStyles");
|
|
1271
|
-
return /* @__PURE__ */React.createElement(Box, {
|
|
1272
|
-
sx: /* @__PURE__ */__name(({
|
|
1273
|
-
fonts
|
|
1274
|
-
}) => {
|
|
1275
|
-
const variantStyles = getVariantStyles(variant);
|
|
1276
|
-
return {
|
|
1277
|
-
".example-arrow": {
|
|
1278
|
-
display: "none"
|
|
1279
|
-
},
|
|
1280
|
-
".tooltip-component": {
|
|
1281
|
-
fontFamily: fonts?.body,
|
|
1282
|
-
paddingY: "2",
|
|
1283
|
-
paddingX: "3",
|
|
1284
|
-
border: "sm",
|
|
1285
|
-
borderRadius: "xl",
|
|
1286
|
-
zIndex: "tooltip",
|
|
1287
|
-
opacity: "1",
|
|
1288
|
-
lineHeight: "shorter",
|
|
1289
|
-
letterSpacing: "wide",
|
|
1290
|
-
a: {
|
|
1291
|
-
color: "feedback.text.secondary.default",
|
|
1292
|
-
fontFamily: "body",
|
|
1293
|
-
textDecorationLine: "underline",
|
|
1294
|
-
lineHeight: "normal"
|
|
1295
|
-
},
|
|
1296
|
-
...variantStyles,
|
|
1297
|
-
...sx
|
|
1298
|
-
},
|
|
1299
|
-
[`&.tooltip-${variant}`]: variantStyles
|
|
1300
|
-
};
|
|
1301
|
-
}, "sx")
|
|
1302
|
-
}, /* @__PURE__ */React.createElement(TooltipReact, {
|
|
1303
|
-
className,
|
|
1304
|
-
...props,
|
|
1305
|
-
classNameArrow: "example-arrow"
|
|
1306
|
-
}, props.children));
|
|
1307
|
-
}, "Tooltip");
|
|
1299
|
+
const id = React15.useId();
|
|
1300
|
+
const tooltipId = `${id}-tooltip`;
|
|
1301
|
+
return /* @__PURE__ */React15.createElement(React15.Fragment, null, /* @__PURE__ */React15.createElement(Text, {
|
|
1302
|
+
"data-testid": dataTestId,
|
|
1303
|
+
"data-tooltip-id": tooltip ? tooltipId : void 0,
|
|
1304
|
+
sx: {
|
|
1305
|
+
cursor: onClick ? "pointer" : "default",
|
|
1306
|
+
...sx
|
|
1307
|
+
},
|
|
1308
|
+
onClick,
|
|
1309
|
+
variant
|
|
1310
|
+
}, /* @__PURE__ */React15.createElement(Icon8, {
|
|
1311
|
+
inline: true,
|
|
1312
|
+
icon
|
|
1313
|
+
})), tooltip && /* @__PURE__ */React15.createElement(Tooltip, {
|
|
1314
|
+
id: tooltipId,
|
|
1315
|
+
...tooltipProps,
|
|
1316
|
+
variant
|
|
1317
|
+
}, tooltip));
|
|
1318
|
+
}, "TooltipIcon");
|
|
1308
1319
|
|
|
1309
1320
|
// src/theme/ThemeProvider.tsx
|
|
1310
1321
|
import { css, Global } from "@emotion/react";
|
|
1311
1322
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
1312
|
-
import * as
|
|
1323
|
+
import * as React16 from "react";
|
|
1313
1324
|
import { ThemeUIProvider } from "theme-ui";
|
|
1314
1325
|
var ThemeProvider = /* @__PURE__ */__name(({
|
|
1315
1326
|
children,
|
|
1316
1327
|
theme = BruttalTheme,
|
|
1317
1328
|
fonts = BruttalFonts
|
|
1318
1329
|
}) => {
|
|
1319
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */React16.createElement(React16.Fragment, null, /* @__PURE__ */React16.createElement(ThemeUIProvider, {
|
|
1320
1331
|
theme
|
|
1321
|
-
}, /* @__PURE__ */
|
|
1332
|
+
}, /* @__PURE__ */React16.createElement(Global, {
|
|
1322
1333
|
styles: css`
|
|
1323
1334
|
${fonts.map(url => {
|
|
1324
1335
|
return `@import url('${url}');`;
|
|
@@ -1335,4 +1346,4 @@ var useTheme = useThemeUI;
|
|
|
1335
1346
|
import { keyframes } from "@emotion/react";
|
|
1336
1347
|
import { useBreakpointIndex, useResponsiveValue } from "@theme-ui/match-media";
|
|
1337
1348
|
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
1338
|
-
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, SegmentedControl, Select, Slider, Spinner, Stack, Switch, Tag, Text, Textarea, ThemeProvider, Tooltip, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
|
1349
|
+
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, SegmentedControl, Select, Slider, Spinner, Stack, Switch, Tag, Text, Textarea, ThemeProvider, Tooltip, TooltipIcon, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -64,15 +64,72 @@ declare const InfiniteLinearProgress: () => react_jsx_runtime.JSX.Element;
|
|
|
64
64
|
type TooltipProps = ITooltip & SxProp;
|
|
65
65
|
declare const Tooltip: ({ variant, sx, ...props }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Props for the TooltipIcon component.
|
|
69
|
+
*/
|
|
70
|
+
interface TooltipIconProps {
|
|
71
|
+
/**
|
|
72
|
+
* The icon to display. Can be a string identifier or an icon object from @ttoss/react-icons.
|
|
73
|
+
*/
|
|
68
74
|
icon: IconType;
|
|
75
|
+
/**
|
|
76
|
+
* Optional click handler for the icon.
|
|
77
|
+
*/
|
|
69
78
|
onClick?: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Optional tooltip text to display when hovering over the icon.
|
|
81
|
+
*/
|
|
70
82
|
tooltip?: string;
|
|
71
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Additional props to pass to the Tooltip component.
|
|
85
|
+
* Excludes 'children', 'anchorSelect', and 'variant' which are managed internally.
|
|
86
|
+
*/
|
|
87
|
+
tooltipProps?: Omit<TooltipProps, 'children' | 'anchorSelect' | 'variant'>;
|
|
88
|
+
/**
|
|
89
|
+
* Test ID for testing purposes.
|
|
90
|
+
*/
|
|
91
|
+
'data-testid'?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Visual variant for both the text wrapper and tooltip.
|
|
94
|
+
* @default 'info'
|
|
95
|
+
*/
|
|
96
|
+
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
97
|
+
/**
|
|
98
|
+
* Additional styles to apply to the Text wrapper component.
|
|
99
|
+
*/
|
|
100
|
+
sx?: Record<string, unknown>;
|
|
72
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* TooltipIcon component renders an icon with an optional tooltip.
|
|
104
|
+
*
|
|
105
|
+
* This component is useful for displaying icons with explanatory tooltips,
|
|
106
|
+
* especially in contexts where space is limited or additional information
|
|
107
|
+
* should be revealed on hover.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```tsx
|
|
111
|
+
* <TooltipIcon
|
|
112
|
+
* icon="info-circle"
|
|
113
|
+
* tooltip="Additional information"
|
|
114
|
+
* variant="info"
|
|
115
|
+
* />
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* <TooltipIcon
|
|
121
|
+
* icon="warning-alt"
|
|
122
|
+
* tooltip="Warning message"
|
|
123
|
+
* variant="warning"
|
|
124
|
+
* onClick={() => console.log('Clicked')}
|
|
125
|
+
* />
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
declare const TooltipIcon: ({ icon, onClick, tooltip, tooltipProps, "data-testid": dataTestId, variant, sx, }: TooltipIconProps) => react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
73
130
|
interface InputProps extends InputProps$1 {
|
|
74
|
-
leadingIcon?:
|
|
75
|
-
trailingIcon?:
|
|
131
|
+
leadingIcon?: TooltipIconProps | IconType;
|
|
132
|
+
trailingIcon?: TooltipIconProps | IconType;
|
|
76
133
|
}
|
|
77
134
|
declare const Input: ({ leadingIcon, trailingIcon: trailingIconProp, className, sx, ...inputProps }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
78
135
|
|
|
@@ -90,17 +147,7 @@ type InputPasswordProps = Omit<InputProps, 'trailingIcon' | 'type'> & {
|
|
|
90
147
|
declare const InputPassword: ({ showPasswordByDefault, ...inputPasswordProps }: InputPasswordProps) => react_jsx_runtime.JSX.Element;
|
|
91
148
|
|
|
92
149
|
type LabelProps = LabelProps$1 & {
|
|
93
|
-
tooltip?:
|
|
94
|
-
render: string | React.ReactNode;
|
|
95
|
-
place: 'top' | 'right' | 'bottom' | 'left';
|
|
96
|
-
openOnClick?: boolean;
|
|
97
|
-
clickable?: boolean;
|
|
98
|
-
variant?: 'dark' | 'light' | 'success' | 'warning' | 'error' | 'info';
|
|
99
|
-
hidden?: boolean;
|
|
100
|
-
setIsOpen?: (value: boolean) => void;
|
|
101
|
-
isOpen?: boolean;
|
|
102
|
-
icon?: string;
|
|
103
|
-
};
|
|
150
|
+
tooltip?: TooltipProps;
|
|
104
151
|
};
|
|
105
152
|
declare const Label: ({ children, tooltip, sx, ...props }: LabelProps) => react_jsx_runtime.JSX.Element;
|
|
106
153
|
|
|
@@ -191,4 +238,4 @@ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) =
|
|
|
191
238
|
|
|
192
239
|
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
193
240
|
|
|
194
|
-
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, SegmentedControl, type SegmentedControlProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Tag, type TagProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, useTheme };
|
|
241
|
+
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, SegmentedControl, type SegmentedControlProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Tag, type TagProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipIcon, type TooltipIconProps, type TooltipProps, useTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"react-select": "^5.10.2",
|
|
30
30
|
"react-tooltip": "^5.30.0",
|
|
31
31
|
"theme-ui": "^0.17.2",
|
|
32
|
-
"@ttoss/theme": "^2.7.
|
|
32
|
+
"@ttoss/theme": "^2.7.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@emotion/react": "^11",
|
|
36
36
|
"react": ">=16.8.0",
|
|
37
|
-
"@ttoss/react-icons": "^0.5.
|
|
37
|
+
"@ttoss/react-icons": "^0.5.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@emotion/react": "^11.14.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"jest": "^30.2.0",
|
|
45
45
|
"react": "^19.2.0",
|
|
46
46
|
"tsup": "^8.5.1",
|
|
47
|
-
"@ttoss/
|
|
48
|
-
"@ttoss/react-icons": "^0.5.
|
|
49
|
-
"@ttoss/
|
|
47
|
+
"@ttoss/config": "^1.35.12",
|
|
48
|
+
"@ttoss/react-icons": "^0.5.4",
|
|
49
|
+
"@ttoss/test-utils": "^4.0.0"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"React",
|