@indico-data/design-system 1.0.49 → 1.0.50
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/lib/components/index.d.ts +1 -0
- package/lib/components/text-truncate/TextTruncate.d.ts +7 -0
- package/lib/components/text-truncate/TextTruncate.styles.d.ts +2 -0
- package/lib/components/text-truncate/TextTruncate.test.d.ts +1 -0
- package/lib/components/text-truncate/index.d.ts +1 -0
- package/lib/index.d.ts +8 -1
- package/lib/index.esm.js +9 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/WizardWithSidebar/WizardWithSidebar.styles.ts +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/text-truncate/TextTruncate.stories.mdx +59 -0
- package/src/components/text-truncate/TextTruncate.styles.ts +3 -0
- package/src/components/text-truncate/TextTruncate.test.tsx +18 -0
- package/src/components/text-truncate/TextTruncate.tsx +21 -0
- package/src/components/text-truncate/index.ts +1 -0
- package/src/index.ts +1 -0
|
@@ -13,3 +13,4 @@ export { LoadingAwareContainer } from './LoadingAwareContainer';
|
|
|
13
13
|
export { Wizard, WizardCard, WizardSection, StyledWizard } from './Wizard';
|
|
14
14
|
export { WizardWithSidebar } from './WizardWithSidebar';
|
|
15
15
|
export { Drawer } from './Navigation/Drawer';
|
|
16
|
+
export { TextTruncate } from './text-truncate';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledTextTruncate: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextTruncate } from './TextTruncate';
|
package/lib/index.d.ts
CHANGED
|
@@ -1068,4 +1068,11 @@ type Props = PermafrostComponent & {
|
|
|
1068
1068
|
};
|
|
1069
1069
|
declare const Drawer: (props: Props) => react_jsx_runtime.JSX.Element;
|
|
1070
1070
|
|
|
1071
|
-
|
|
1071
|
+
interface TextTruncateProps {
|
|
1072
|
+
string: string;
|
|
1073
|
+
maxChars: number;
|
|
1074
|
+
children: any;
|
|
1075
|
+
}
|
|
1076
|
+
declare function TextTruncate({ string, maxChars, children }: TextTruncateProps): react_jsx_runtime.JSX.Element;
|
|
1077
|
+
|
|
1078
|
+
export { animation as ANIMATION, Radio as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, CirclePulse, CircleSpinner, ConfirmModal, Drawer, EditableInput, GlobalStyles, Icon, IconButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio$1 as Radio, RadioGroup$1 as RadioGroup, RandomLoadingMessage, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, StyledWizard, typography as TYPOGRAPHY, TextInput, TextTruncate, Wizard, WizardCard, WizardSection, WizardWithSidebar, faIcons, indicons };
|
package/lib/index.esm.js
CHANGED
|
@@ -17326,13 +17326,13 @@ const StyledWizardWithSidebar = styled.div `
|
|
|
17326
17326
|
.wizard-sidebar {
|
|
17327
17327
|
width: 245px;
|
|
17328
17328
|
padding: 30px;
|
|
17329
|
-
border-right: 1px solid
|
|
17329
|
+
border-right: 1px solid ${allColors.silverChalice};
|
|
17330
17330
|
|
|
17331
17331
|
.sidebar-step {
|
|
17332
17332
|
margin-bottom: ${spacings.sm};
|
|
17333
17333
|
display: flex;
|
|
17334
17334
|
align-items: center;
|
|
17335
|
-
color:
|
|
17335
|
+
color: ${allColors.silverChalice};
|
|
17336
17336
|
&.current-step,
|
|
17337
17337
|
&.prior-step {
|
|
17338
17338
|
color: ${allColors.black};
|
|
@@ -17639,5 +17639,11 @@ const Drawer = (props) => {
|
|
|
17639
17639
|
return (jsx(StyledDrawer, Object.assign({ id: id, "data-cy": props['data-cy'], "data-testid": props['data-testid'], style: style }, restOfProps, { className: drawerClasses, onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, "aria-expanded": isOpen, "$expandedWidth": $expandedWidth, "$collapsedWidth": $collapsedWidth, children: jsxs("div", { className: "drawer__wrapper", children: [jsx("div", { className: "drawer__header", children: headerComponent ? (headerComponent) : (jsxs("span", { children: [logoIcon ? jsx(Icon, { name: logoIcon, size: [24], "data-testid": "logo-icon" }) : null, jsx("p", { "data-testid": "logo-text", "aria-hidden": !isOpen, children: logoText })] })) }), jsxs("div", { className: "drawer__content", children: [(navigationItems === null || navigationItems === void 0 ? void 0 : navigationItems.length) ? (jsx("div", { className: "drawer__navigation", "data-testid": "drawer-navigation", children: jsx(DrawerLinkList, { isOpen: isOpen, listItems: navigationItems }) })) : null, (footerItems === null || footerItems === void 0 ? void 0 : footerItems.length) ? (jsx("div", { className: "drawer__footer", "data-testid": "drawer-footer", children: jsx(DrawerLinkList, { isOpen: isOpen, listItems: footerItems }) })) : null] })] }) })));
|
|
17640
17640
|
};
|
|
17641
17641
|
|
|
17642
|
-
|
|
17642
|
+
const StyledTextTruncate = styled.span ``;
|
|
17643
|
+
|
|
17644
|
+
function TextTruncate({ string, maxChars, children }) {
|
|
17645
|
+
return string.length > maxChars ? (jsxs(StyledTextTruncate, { title: string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxs(StyledTextTruncate, { children: [string, " ", children] }));
|
|
17646
|
+
}
|
|
17647
|
+
|
|
17648
|
+
export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, CirclePulse, CircleSpinner, ConfirmModal, Drawer, EditableInput, GlobalStyles, Icon, IconButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio, RadioGroup, RandomLoadingMessage, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, StyledWizard, typography as TYPOGRAPHY, TextInput, TextTruncate, Wizard, WizardCard, WizardSection, WizardWithSidebar, faIcons, indicons };
|
|
17643
17649
|
//# sourceMappingURL=index.esm.js.map
|