@indico-data/design-system 1.0.51 → 1.0.52

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/.eslintrc.js CHANGED
@@ -8,6 +8,11 @@ module.exports = {
8
8
  'plugin:@typescript-eslint/recommended',
9
9
  'plugin:react/recommended',
10
10
  ],
11
+ settings: {
12
+ react: {
13
+ version: 'detect',
14
+ },
15
+ },
11
16
  overrides: [
12
17
  {
13
18
  env: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type ComboboxProps = {
3
2
  'aria-label'?: string;
4
3
  'aria-labelledby'?: string;
@@ -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';
@@ -9,6 +9,7 @@ type Props = {
9
9
  labelColor: string;
10
10
  hoverAndSelectedColor: string;
11
11
  focusRingColor: string;
12
+ value: string;
12
13
  } & RadioGroupProps & PermafrostComponent;
13
14
  /**
14
15
  * Renders a group of radio buttons.
package/lib/index.d.ts CHANGED
@@ -365,6 +365,7 @@ declare const allColors: {
365
365
  readonly flamingo: "#f861b6";
366
366
  readonly flirt: "#910870";
367
367
  readonly forestGreen: "#1f7f1f";
368
+ readonly frostedOver: "#DCEAFD";
368
369
  readonly geraldine: "#fe9486";
369
370
  readonly grannysmith: "#92e959";
370
371
  readonly green: "#4caf50";
@@ -748,6 +749,7 @@ type Props$c = {
748
749
  labelColor: string;
749
750
  hoverAndSelectedColor: string;
750
751
  focusRingColor: string;
752
+ value: string;
751
753
  } & RadioGroupProps$1 & PermafrostComponent;
752
754
  /**
753
755
  * Renders a group of radio buttons.
@@ -1069,4 +1071,11 @@ type Props = PermafrostComponent & {
1069
1071
  };
1070
1072
  declare const Drawer: (props: Props) => react_jsx_runtime.JSX.Element;
1071
1073
 
1072
- 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, Wizard, WizardCard, WizardSection, WizardWithSidebar, faIcons, indicons };
1074
+ interface TextTruncateProps {
1075
+ string: string;
1076
+ maxChars: number;
1077
+ children: any;
1078
+ }
1079
+ declare function TextTruncate({ string, maxChars, children }: TextTruncateProps): react_jsx_runtime.JSX.Element;
1080
+
1081
+ 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
@@ -178,6 +178,7 @@ const allColors = {
178
178
  flamingo: '#f861b6',
179
179
  flirt: '#910870',
180
180
  forestGreen: '#1f7f1f',
181
+ frostedOver: '#DCEAFD',
181
182
  geraldine: '#fe9486',
182
183
  grannysmith: '#92e959',
183
184
  green: '#4caf50',
@@ -13672,10 +13673,10 @@ function RadioGroup$1(props) {
13672
13673
  isReadOnly: isReadOnly || false,
13673
13674
  lastFocusedValue,
13674
13675
  name: name || '',
13675
- selectedValue: value,
13676
- setLastFocusedValue,
13677
- setSelectedValue: onChange,
13678
13676
  defaultValue,
13677
+ value,
13678
+ setLastFocusedValue,
13679
+ onChange: onChange ? (value) => onChange(value) : undefined,
13679
13680
  };
13680
13681
  const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(radioGroupState);
13681
13682
  const { radioGroupProps, labelProps } = $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state);
@@ -13697,8 +13698,7 @@ function Radio$1(props) {
13697
13698
  isSelected = isVisuallySelected(state.selectedValue);
13698
13699
  }
13699
13700
  else {
13700
- // @ts-ignore
13701
- isSelected = state.selectedValue === props.value || (state === null || state === void 0 ? void 0 : state.defaultValue) === props.value;
13701
+ isSelected = state.selectedValue === props.value;
13702
13702
  }
13703
13703
  return (jsxs("label", { className: classNames(className, {
13704
13704
  disabled: isDisabled || state.isDisabled,
@@ -13786,8 +13786,8 @@ const StyledRadioGroup = styled(RadioGroup$1) `
13786
13786
  */
13787
13787
  function RadioGroup(_a) {
13788
13788
  var { children } = _a, props = __rest(_a, ["children"]);
13789
- const { color, hideFocusRing, labelColor, hoverAndSelectedColor, focusRingColor } = props;
13790
- return (jsx(StyledRadioGroup, Object.assign({}, props, { hideFocusRing: true, "data-cy": props['data-cy'], color: color, labelColor: labelColor, hoverAndSelectedColor: hoverAndSelectedColor, focusRingColor: focusRingColor, children: children })));
13789
+ const { value, color, hideFocusRing, labelColor, hoverAndSelectedColor, focusRingColor } = props;
13790
+ return (jsx(StyledRadioGroup, Object.assign({}, props, { hideFocusRing: hideFocusRing, "data-cy": props['data-cy'], color: color, labelColor: labelColor, hoverAndSelectedColor: hoverAndSelectedColor, focusRingColor: focusRingColor, value: value, children: children })));
13791
13791
  }
13792
13792
  /**
13793
13793
  * A single radio button and its label.
@@ -17327,13 +17327,13 @@ const StyledWizardWithSidebar = styled.div `
17327
17327
  .wizard-sidebar {
17328
17328
  width: 245px;
17329
17329
  padding: 30px;
17330
- border-right: 1px solid #aaaaaa;
17330
+ border-right: 1px solid ${allColors.silverChalice};
17331
17331
 
17332
17332
  .sidebar-step {
17333
17333
  margin-bottom: ${spacings.sm};
17334
17334
  display: flex;
17335
17335
  align-items: center;
17336
- color: #aaaaaa;
17336
+ color: ${allColors.silverChalice};
17337
17337
  &.current-step,
17338
17338
  &.prior-step {
17339
17339
  color: ${allColors.black};
@@ -17640,5 +17640,11 @@ const Drawer = (props) => {
17640
17640
  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] })] }) })));
17641
17641
  };
17642
17642
 
17643
- 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, Wizard, WizardCard, WizardSection, WizardWithSidebar, faIcons, indicons };
17643
+ const StyledTextTruncate = styled.span ``;
17644
+
17645
+ function TextTruncate({ string, maxChars, children }) {
17646
+ return string.length > maxChars ? (jsxs(StyledTextTruncate, { title: string, children: [`${string.substring(0, maxChars)}...`, children] })) : (jsxs(StyledTextTruncate, { children: [string, " ", children] }));
17647
+ }
17648
+
17649
+ 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 };
17644
17650
  //# sourceMappingURL=index.esm.js.map