@manuscripts/style-guide 3.6.2 → 3.6.4

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.
Files changed (63) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/components/Avatar.js +10 -10
  3. package/dist/cjs/components/Button.js +16 -16
  4. package/dist/cjs/components/Checkbox.js +2 -2
  5. package/dist/cjs/components/ContextMenu.js +1 -1
  6. package/dist/cjs/components/DateInput.js +3 -3
  7. package/dist/cjs/components/Dialog.js +1 -1
  8. package/dist/cjs/components/Drawer.js +2 -2
  9. package/dist/cjs/components/Dropdown.js +7 -5
  10. package/dist/cjs/components/ExpandableSection.js +5 -5
  11. package/dist/cjs/components/Form.js +4 -4
  12. package/dist/cjs/components/Menus/Menus.js +4 -4
  13. package/dist/cjs/components/Menus/Submenu.js +2 -2
  14. package/dist/cjs/components/NavDropdown.js +8 -10
  15. package/dist/cjs/components/Resizer/ResizerButton.js +1 -1
  16. package/dist/cjs/components/Resizer/ResizerButtonInner.js +9 -9
  17. package/dist/cjs/components/SelectedItemsBox.js +3 -3
  18. package/dist/cjs/components/StyledModal.js +7 -7
  19. package/dist/cjs/components/SystemUserAvatar.js +5 -5
  20. package/dist/cjs/components/TextField.js +8 -8
  21. package/dist/cjs/components/ToggleSwitch.js +7 -7
  22. package/dist/cjs/components/icons/camera.js +7 -0
  23. package/dist/cjs/components/icons/file-headshot-grid.js +5 -0
  24. package/dist/cjs/components/icons/index.js +7 -3
  25. package/dist/cjs/lib/files.js +5 -0
  26. package/dist/es/components/Avatar.js +10 -10
  27. package/dist/es/components/Button.js +16 -16
  28. package/dist/es/components/Checkbox.js +2 -2
  29. package/dist/es/components/ContextMenu.js +1 -1
  30. package/dist/es/components/DateInput.js +3 -3
  31. package/dist/es/components/Dialog.js +1 -1
  32. package/dist/es/components/Drawer.js +2 -2
  33. package/dist/es/components/Dropdown.js +7 -5
  34. package/dist/es/components/ExpandableSection.js +5 -5
  35. package/dist/es/components/Form.js +4 -4
  36. package/dist/es/components/Menus/Menus.js +4 -4
  37. package/dist/es/components/Menus/Submenu.js +2 -2
  38. package/dist/es/components/NavDropdown.js +8 -10
  39. package/dist/es/components/Resizer/ResizerButton.js +1 -1
  40. package/dist/es/components/Resizer/ResizerButtonInner.js +9 -9
  41. package/dist/es/components/SelectedItemsBox.js +3 -3
  42. package/dist/es/components/StyledModal.js +7 -7
  43. package/dist/es/components/SystemUserAvatar.js +5 -5
  44. package/dist/es/components/TextField.js +8 -8
  45. package/dist/es/components/ToggleSwitch.js +7 -7
  46. package/dist/es/components/icons/camera.js +3 -0
  47. package/dist/es/components/icons/file-headshot-grid.js +3 -0
  48. package/dist/es/components/icons/index.js +2 -0
  49. package/dist/es/lib/files.js +6 -1
  50. package/dist/types/components/Button.d.ts +36 -47
  51. package/dist/types/components/Checkbox.d.ts +1 -1
  52. package/dist/types/components/DateInput.d.ts +2 -2
  53. package/dist/types/components/Dropdown.d.ts +5 -7
  54. package/dist/types/components/Form.d.ts +3 -3
  55. package/dist/types/components/NavDropdown.d.ts +9 -12
  56. package/dist/types/components/Resizer/ResizerButtonInner.d.ts +2 -2
  57. package/dist/types/components/StyledModal.d.ts +8 -9
  58. package/dist/types/components/TextField.d.ts +2 -2
  59. package/dist/types/components/icons/camera.d.ts +19 -0
  60. package/dist/types/components/icons/file-headshot-grid.d.ts +19 -0
  61. package/dist/types/components/icons/index.d.ts +2 -0
  62. package/dist/types/lib/files.d.ts +2 -1
  63. package/package.json +1 -1
package/README.md CHANGED
@@ -9,9 +9,9 @@ React components for Manuscripts applications.
9
9
  import { PrimaryButton } from '@manuscripts/style-guide'
10
10
 
11
11
  const Example: React.FunctionComponent<{
12
- handleClick: React.MouseEventHandler<HTMLButtonElement>
12
+ handleClick: React.MouseEventHandler<HTMLButtonElement>
13
13
  }> = ({ handleClick }) => (
14
- <div>
14
+ <div>
15
15
  <PrimaryButton onClick={handleClick}>Done</PrimaryButton>
16
16
  </div>
17
17
  )
@@ -19,7 +19,7 @@ const Example: React.FunctionComponent<{
19
19
 
20
20
  ## Development
21
21
 
22
- Run `yarn build` to build the `dist` folder for distribution.
22
+ Run `yarn build` to build the `dist` folder for distribution.
23
23
 
24
24
  Run `yarn dev` to automatically rebuild when a file is changed.
25
25
 
@@ -30,32 +30,32 @@ const AvatarContainer = styled_components_1.default.div `
30
30
  align-items: center;
31
31
  justify-content: center;
32
32
  position: relative;
33
- opacity: ${(props) => props.opacity};
33
+ opacity: ${(props) => props.$opacity};
34
34
  `;
35
35
  const RoundedImage = styled_components_1.default.img `
36
- width: ${(props) => props.size}px;
37
- height: ${(props) => props.size}px;
36
+ width: ${(props) => props.$size}px;
37
+ height: ${(props) => props.$size}px;
38
38
  border-radius: 50%;
39
39
  align-items: center;
40
40
  justify-content: center;
41
41
  `;
42
42
  const StyledAvatar = (0, styled_components_1.default)(icons_1.ProfileIcon) `
43
43
  path {
44
- fill: ${(props) => props.color || props.theme.colors.text.secondary};
44
+ fill: ${(props) => props.$color || props.theme.colors.text.secondary};
45
45
  }
46
46
 
47
47
  &:hover path {
48
- fill: ${(props) => props.color || props.theme.colors.text.info};
48
+ fill: ${(props) => props.$color || props.theme.colors.text.info};
49
49
  }
50
50
  `;
51
51
  const InitialsCircle = styled_components_1.default.div `
52
- width: ${(props) => props.size}px;
53
- height: ${(props) => props.size}px;
52
+ width: ${(props) => props.$size}px;
53
+ height: ${(props) => props.$size}px;
54
54
  border-radius: 50%;
55
- background: ${(props) => props.bg};
55
+ background: ${(props) => props.$bg};
56
56
  color: #ffffff;
57
57
  font-weight: bold;
58
- font-size: ${(props) => Math.round(props.size * 0.4)}px;
58
+ font-size: ${(props) => Math.round(props.$size * 0.4)}px;
59
59
  display: flex;
60
60
  align-items: center;
61
61
  justify-content: center;
@@ -68,6 +68,6 @@ const Avatar = (props) => {
68
68
  setSrcError(true);
69
69
  }, []);
70
70
  const showInitials = (!props.src || srcError) && !!props.name;
71
- return ((0, jsx_runtime_1.jsx)(AvatarContainer, { opacity: props.opacity || 1, children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, size: props.size, onError: handleSrcError })) : showInitials ? ((0, jsx_runtime_1.jsx)(InitialsCircle, { size: props.size, bg: INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, color: props.color })) }));
71
+ return ((0, jsx_runtime_1.jsx)(AvatarContainer, { "$opacity": props.opacity || 1, children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : showInitials ? ((0, jsx_runtime_1.jsx)(InitialsCircle, { "$size": props.size, "$bg": INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
72
72
  };
73
73
  exports.Avatar = Avatar;
@@ -104,10 +104,10 @@ const btnStyles = (0, styled_components_1.css) `
104
104
  margin-left: ${(props) => props.theme.grid.unit}px;
105
105
  }
106
106
 
107
- ${(props) => props.danger && dangerBtnStyles}
108
- ${(props) => props.mini && miniBtnStyles}
107
+ ${(props) => props.$danger && dangerBtnStyles}
108
+ ${(props) => props.$mini && miniBtnStyles}
109
109
 
110
- :disabled {
110
+ &:disabled {
111
111
  ${disabledBtnStyles}
112
112
  }
113
113
 
@@ -177,8 +177,8 @@ exports.IconTextButton = (0, styled_components_1.default)(ButtonTemplate) `
177
177
  `;
178
178
  exports.ToggleButton = (0, styled_components_1.default)(ButtonTemplate) `
179
179
  color: ${(props) => props.theme.colors.text.primary};
180
- background-color: ${(props) => props.selected ? props.theme.colors.background.fifth : 'transparent'};
181
- border-color: ${(props) => props.selected
180
+ background-color: ${(props) => props.$selected ? props.theme.colors.background.fifth : 'transparent'};
181
+ border-color: ${(props) => props.$selected
182
182
  ? props.theme.colors.border.primary
183
183
  : props.theme.colors.border.secondary};
184
184
 
@@ -200,14 +200,14 @@ exports.ToggleButton = (0, styled_components_1.default)(ButtonTemplate) `
200
200
 
201
201
  svg {
202
202
  path[stroke] {
203
- stroke: ${(props) => props.selected
203
+ stroke: ${(props) => props.$selected
204
204
  ? props.theme.colors.brand.medium
205
205
  : props.theme.colors.text.primary};
206
206
  }
207
207
  text[fill],
208
208
  rect[fill],
209
209
  path[fill] {
210
- fill: ${(props) => props.selected
210
+ fill: ${(props) => props.$selected
211
211
  ? props.theme.colors.brand.medium
212
212
  : props.theme.colors.text.primary};
213
213
  }
@@ -219,7 +219,7 @@ exports.ToggleButtonAlt = (0, styled_components_1.default)(ButtonTemplate) `
219
219
  border: none;
220
220
  border-bottom: 1px solid transparent;
221
221
  border-radius: 0;
222
- ${(props) => props.selected && 'border-color: ' + props.theme.colors.border.info};
222
+ ${(props) => props.$selected && 'border-color: ' + props.theme.colors.border.info};
223
223
 
224
224
  font-size: ${(props) => props.theme.font.size.normal};
225
225
  padding: 0 ${(props) => props.theme.grid.unit}px;
@@ -241,21 +241,21 @@ const svgColors = (0, styled_components_1.css) `
241
241
 
242
242
  svg {
243
243
  path[stroke] {
244
- stroke: ${(props) => props.iconColor || 'currentColor'};
244
+ stroke: ${(props) => props.$iconColor || 'currentColor'};
245
245
  }
246
246
  text[fill],
247
247
  rect[fill],
248
248
  path[fill] {
249
- fill: ${(props) => props.iconColor || 'currentColor'};
249
+ fill: ${(props) => props.$iconColor || 'currentColor'};
250
250
  }
251
251
  }
252
252
  `;
253
253
  const IconButtonTemplate = (0, styled_components_1.default)(ButtonTemplate) `
254
254
  padding: 0;
255
- height: ${(props) => props.size || 40}px;
256
- width: ${(props) => props.size || 40}px;
255
+ height: ${(props) => props.$size || 40}px;
256
+ width: ${(props) => props.$size || 40}px;
257
257
 
258
- ${(props) => !props.defaultColor && svgColors}
258
+ ${(props) => !props.$defaultColor && svgColors}
259
259
  `;
260
260
  exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
261
261
  ${(props) => btnColors(props.theme.colors.text.primary, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
@@ -269,7 +269,7 @@ exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
269
269
  }
270
270
  `;
271
271
  exports.RoundIconButton = (0, styled_components_1.default)(exports.IconButton).attrs((props) => ({
272
- defaultColor: true,
272
+ $defaultColor: true,
273
273
  })) `
274
274
  background: ${(props) => props.theme.colors.background.primary};
275
275
  border: 5px solid ${(props) => props.theme.colors.background.primary} !important;
@@ -316,8 +316,8 @@ exports.IconButtonGroup = styled_components_1.default.div `
316
316
  justify-content: flex-start;
317
317
  align-items: center;
318
318
  button {
319
- width: ${(props) => props.size || 28}px;
320
- height: ${(props) => props.size || 28}px;
319
+ width: ${(props) => props.$size || 28}px;
320
+ height: ${(props) => props.$size || 28}px;
321
321
  }
322
322
  `;
323
323
  exports.TextButton = (0, styled_components_1.default)(exports.IconTextButton) `
@@ -40,14 +40,14 @@ exports.CheckboxLabel = styled_components_1.default.label `
40
40
  font-family: ${(props) => props.theme.font.family.sans};
41
41
  font-size: ${(props) => props.theme.font.size.normal};
42
42
  font-weight: ${(props) => props.theme.font.weight.normal};
43
- color: ${(props) => props.disabled
43
+ color: ${(props) => props.$disabled
44
44
  ? props.theme.colors.text.muted
45
45
  : props.theme.colors.text.primary};
46
46
  display: flex;
47
47
  flex-wrap: nowrap;
48
48
  line-height: 20px;
49
49
  margin: 8px 0;
50
- cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
50
+ cursor: ${(props) => (props.$disabled ? 'not-allowed' : 'pointer')};
51
51
 
52
52
  &::before {
53
53
  content: '';
@@ -102,7 +102,7 @@ const ContextMenu = ({ actions }) => {
102
102
  container.removeEventListener('keydown', handleKeyDown);
103
103
  };
104
104
  }, [actions]);
105
- return ((0, jsx_runtime_1.jsx)(Button_1.IconButtonGroup, { size: 32, ref: containerRef, children: actions.map((action) => {
105
+ return ((0, jsx_runtime_1.jsx)(Button_1.IconButtonGroup, { "$size": 32, ref: containerRef, children: actions.map((action) => {
106
106
  const Icon = icons[action.icon];
107
107
  return ((0, jsx_runtime_1.jsx)(ContextMenuIconButton, { "data-tooltip-content": action.label, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled, children: (0, jsx_runtime_1.jsx)(Icon, { width: 18, height: 18 }) }, action.icon));
108
108
  }) }));
@@ -40,10 +40,10 @@ const icons_1 = require("./icons");
40
40
  const inputStyles = (0, styled_components_1.css) `
41
41
  box-sizing: border-box;
42
42
  width: 100%;
43
- min-height: ${(props) => (props.variant === 'small' ? '32px' : '40px')};
43
+ min-height: ${(props) => (props.$variant === 'small' ? '32px' : '40px')};
44
44
  padding: 0 36px 0 12px;
45
45
  border: 1px solid
46
- ${(props) => props.error
46
+ ${(props) => props.$error
47
47
  ? props.theme.colors.border.error
48
48
  : props.theme.colors.border.field.default};
49
49
  border-radius: 3px;
@@ -77,7 +77,7 @@ const inputStyles = (0, styled_components_1.css) `
77
77
 
78
78
  &:focus:not(:disabled) {
79
79
  border: 2px solid
80
- ${(props) => props.error
80
+ ${(props) => props.$error
81
81
  ? props.theme.colors.border.error
82
82
  : props.theme.colors.brand.default};
83
83
  background-color: #f2fbfc;
@@ -99,7 +99,7 @@ const SecondaryTextDanger = styled_components_1.default.button.attrs({ type: 'bu
99
99
  opacity: 0.5;
100
100
  }
101
101
  `;
102
- const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { danger: true, disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }))) : props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }));
102
+ const PrimaryAction = (props) => props.isDestructive ? (props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { "$danger": true, disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { "$danger": true, disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }))) : props.hasForm ? ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, form: "formDialog", type: "submit", children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.PrimaryButton, { disabled: props.disabled, onClick: props.action, autoFocus: true, children: props.title }));
103
103
  const SecondaryAction = (props) => props.variant === 'textDanger' ? ((0, jsx_runtime_1.jsx)(SecondaryTextDanger, { disabled: props.disabled, onClick: props.action, children: props.title })) : ((0, jsx_runtime_1.jsx)(Button_1.SecondaryButton, { disabled: props.disabled, onClick: props.action, children: props.title }));
104
104
  class Dialog extends react_1.default.Component {
105
105
  constructor() {
@@ -47,7 +47,7 @@ const slideIn = (0, styled_components_1.keyframes) `
47
47
  }
48
48
  `;
49
49
  const DrawerContainer = (0, List_1.withFocusTrap)(styled_components_1.default.div `
50
- width: ${(props) => props.width || '300px'};
50
+ width: ${(props) => props.$width || '300px'};
51
51
  background: ${(props) => props.theme.colors.background.primary};
52
52
  height: 100%;
53
53
  display: flex;
@@ -132,6 +132,6 @@ exports.DrawerItemMeta = styled_components_1.default.span `
132
132
  color: ${(props) => props.theme.colors.text.secondary};
133
133
  `;
134
134
  const Drawer = ({ title, onBack, width, children, }) => {
135
- return ((0, jsx_runtime_1.jsxs)(DrawerContainer, { "data-cy": "drawer", width: width, children: [(0, jsx_runtime_1.jsxs)(DrawerBackButton, { onClick: onBack, children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2190" }), "Back"] }), (0, jsx_runtime_1.jsx)(DrawerTitle, { children: title }), children] }));
135
+ return ((0, jsx_runtime_1.jsxs)(DrawerContainer, { "data-cy": "drawer", "$width": width, children: [(0, jsx_runtime_1.jsxs)(DrawerBackButton, { onClick: onBack, children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2190" }), "Back"] }), (0, jsx_runtime_1.jsx)(DrawerTitle, { children: title }), children] }));
136
136
  };
137
137
  exports.Drawer = Drawer;
@@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DropdownButton = exports.DropdownContainer = exports.DropdownList = void 0;
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
- exports.DropdownList = styled_components_1.default.div.attrs({ 'data-cy': 'dropdown' }) `
8
+ exports.DropdownList = styled_components_1.default.div.attrs({
9
+ 'data-cy': 'dropdown',
10
+ }) `
9
11
  display: flex;
10
12
  flex-direction: column;
11
13
  border: 1px solid ${(props) => props.theme.colors.border.secondary};
@@ -13,10 +15,10 @@ exports.DropdownList = styled_components_1.default.div.attrs({ 'data-cy': 'dropd
13
15
  border-radius: 4px;
14
16
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
15
17
  background: ${(props) => props.theme.colors.background.primary};
16
- width: ${(props) => (props.width ? props.width + 'px' : 'auto')};
17
- ${(props) => props.height && `max-height: ${props.height}px`};
18
- ${(props) => (props.direction === 'right' ? ' right: 0' : 'left : 0')};
19
- top: ${(props) => props.theme.grid.unit * (props.top || 3)}px;
18
+ width: ${(props) => (props.$width ? props.$width + 'px' : 'auto')};
19
+ ${(props) => props.$height && `max-height: ${props.$height}px`};
20
+ ${(props) => (props.$direction === 'right' ? ' right: 0' : 'left : 0')};
21
+ top: ${(props) => props.theme.grid.unit * (props.$top || 3)}px;
20
22
  position: absolute;
21
23
  z-index: 10;
22
24
  justify-content: space-evenly;
@@ -16,7 +16,7 @@ const ExpandableSection = ({ title, children, defaultOpen = true, bordered = fal
16
16
  setOpen((prev) => !prev);
17
17
  }
18
18
  };
19
- return ((0, jsx_runtime_1.jsxs)(Container, { bordered: bordered, children: [(0, jsx_runtime_1.jsxs)(Header, { onClick: () => setOpen((prev) => !prev), onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-expanded": open, children: [(0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsx)(ArrowIcon, { open: open })] }), (0, jsx_runtime_1.jsx)(ContentOuter, { open: open, inert: !open || undefined, children: (0, jsx_runtime_1.jsx)(ContentInner, { children: (0, jsx_runtime_1.jsx)("div", { children: children }) }) })] }));
19
+ return ((0, jsx_runtime_1.jsxs)(Container, { bordered: bordered, children: [(0, jsx_runtime_1.jsxs)(Header, { onClick: () => setOpen((prev) => !prev), onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-expanded": open, children: [(0, jsx_runtime_1.jsx)(Title, { children: title }), (0, jsx_runtime_1.jsx)(ArrowIcon, { "$open": open })] }), (0, jsx_runtime_1.jsx)(ContentOuter, { "$open": open, inert: !open || undefined, children: (0, jsx_runtime_1.jsx)(ContentInner, { children: (0, jsx_runtime_1.jsx)("div", { children: children }) }) })] }));
20
20
  };
21
21
  exports.ExpandableSection = ExpandableSection;
22
22
  const Container = styled_components_1.default.div `
@@ -40,15 +40,15 @@ const Title = styled_components_1.default.span `
40
40
  `;
41
41
  const ArrowIcon = (0, styled_components_1.default)(icons_1.ArrowDownCircleIcon) `
42
42
  transition: transform 0.25s ease;
43
- transform: rotate(${(props) => (props.open ? '180deg' : '0deg')});
43
+ transform: rotate(${(props) => (props.$open ? '180deg' : '0deg')});
44
44
  `;
45
45
  const ContentOuter = styled_components_1.default.div `
46
46
  display: grid;
47
- grid-template-rows: ${(props) => (props.open ? '1fr' : '0fr')};
48
- overflow: ${(props) => (props.open ? 'visible' : 'hidden')};
47
+ grid-template-rows: ${(props) => (props.$open ? '1fr' : '0fr')};
48
+ overflow: ${(props) => (props.$open ? 'visible' : 'hidden')};
49
49
  transition:
50
50
  grid-template-rows 0.25s ease,
51
- overflow 0s ${(props) => (props.open ? '0.25s' : '0s')} allow-discrete;
51
+ overflow 0s ${(props) => (props.$open ? '0.25s' : '0s')} allow-discrete;
52
52
  `;
53
53
  const ContentInner = styled_components_1.default.div `
54
54
  overflow: visible;
@@ -64,12 +64,12 @@ exports.FormField = styled_components_1.default.div `
64
64
  `;
65
65
  exports.FormRow = styled_components_1.default.div `
66
66
  display: flex;
67
- flex-direction: ${(props) => props.direction ?? 'column'};
67
+ flex-direction: ${(props) => props.$direction ?? 'column'};
68
68
  gap: ${(props) => props.theme.grid.unit * 2}px;
69
69
  margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
70
- justify-content: ${(props) => props.justify ?? 'flex-start'};
71
- align-items: ${(props) => props.align ?? (props.direction === 'row' ? 'center' : 'stretch')};
72
- flex-wrap: ${(props) => (props.direction === 'row' ? 'wrap' : 'nowrap')};
70
+ justify-content: ${(props) => props.$justify ?? 'flex-start'};
71
+ align-items: ${(props) => props.$align ?? (props.$direction === 'row' ? 'center' : 'stretch')};
72
+ flex-wrap: ${(props) => (props.$direction === 'row' ? 'wrap' : 'nowrap')};
73
73
  `;
74
74
  exports.FormLabel = styled_components_1.default.legend `
75
75
  &:not(:first-child) {
@@ -27,10 +27,10 @@ const MenuContainer = styled_components_1.default.div `
27
27
  & ${MenuHeading} {
28
28
  background-color: ${(props) => props.theme.colors.background.secondary};
29
29
  line-height: 24px;
30
- color: ${(props) => (props.isEnabled ? '#353535' : '#e2e2e2')};
30
+ color: ${(props) => (props.$isEnabled ? '#353535' : '#e2e2e2')};
31
31
 
32
32
  &:hover {
33
- background-color: ${(props) => (props.isEnabled ? '#f2fbfc' : '#fff')};
33
+ background-color: ${(props) => (props.$isEnabled ? '#f2fbfc' : '#fff')};
34
34
  }
35
35
  }
36
36
  `;
@@ -90,12 +90,12 @@ const Menus = ({ menus, innerRef, handleClick, close, }) => {
90
90
  }
91
91
  };
92
92
  return ((0, jsx_runtime_1.jsx)(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', onKeyDown: handleKeyDown, children: menus.map((menu, index) => {
93
- return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { ref: (el) => {
93
+ return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', "$isEnabled": menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { ref: (el) => {
94
94
  menuHeadingsRef.current[index] = el;
95
95
  }, onMouseDown: (e) => {
96
96
  e.preventDefault();
97
97
  handleClick([index]);
98
- }, isOpen: menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
98
+ }, "$isOpen": menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
99
99
  return ((0, jsx_runtime_1.jsx)(Submenu_1.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), close: close }, `${index}-${sindex}`));
100
100
  }) }) }))] }, `menu-${index}`));
101
101
  }) }));
@@ -71,7 +71,7 @@ const Container = styled_components_1.default.div `
71
71
  cursor: pointer;
72
72
  padding: 8px 16px 8px 4px;
73
73
  outline: none;
74
- ${(props) => props.isOpen && 'background: #f2fbfc;'}
74
+ ${(props) => props.$isOpen && 'background: #f2fbfc;'}
75
75
 
76
76
  &:hover, &:focus {
77
77
  background: #f2fbfc;
@@ -158,7 +158,7 @@ const SubmenuLabel = ({ menu, handleClick, close, }) => {
158
158
  }
159
159
  }
160
160
  };
161
- return ((0, jsx_runtime_1.jsxs)(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
161
+ return ((0, jsx_runtime_1.jsxs)(Container, { "$isOpen": menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
162
162
  e.preventDefault();
163
163
  handleClick([]);
164
164
  }, onKeyDown: handleKeyDown, children: [(0, jsx_runtime_1.jsx)(Active, { children: activeContent(menu) }), (0, jsx_runtime_1.jsx)(exports.Text, { children: menu.label }), menu.submenu && (0, jsx_runtime_1.jsx)(Arrow, {}), menu.shortcut && (0, jsx_runtime_1.jsx)(Shortcut_1.Shortcut, { shortcut: menu.shortcut })] }));
@@ -56,9 +56,9 @@ exports.NavDropdown = styled_components_1.default.div `
56
56
  font-weight: ${(props) => props.theme.font.weight.normal};
57
57
  max-height: 80vh;
58
58
  max-width: 300px;
59
- ${(props) => props.minWidth && 'min-width: ' + props.minWidth + 'px;'}
60
- ${(props) => (props.direction === 'right' ? ' right: 0' : 'left : 0')};
61
- top: ${(props) => (props.top ? props.top : props.theme.grid.unit * 10)}px;
59
+ ${(props) => props.$minWidth && 'min-width: ' + props.$minWidth + 'px;'}
60
+ ${(props) => (props.$direction === 'right' ? ' right: 0' : 'left : 0')};
61
+ top: ${(props) => (props.$top ? props.$top : props.theme.grid.unit * 10)}px;
62
62
  position: absolute;
63
63
  z-index: 10;
64
64
  `;
@@ -79,10 +79,10 @@ const commonStyles = (0, styled_components_1.css) `
79
79
  align-items: center;
80
80
  text-decoration: none;
81
81
  white-space: nowrap;
82
- color: ${(props) => props.disabled
82
+ color: ${(props) => props.$disabled
83
83
  ? props.theme.colors.text.secondary
84
84
  : props.theme.colors.text.primary};
85
- pointer-events: ${(props) => (props.disabled ? 'none' : 'unset')};
85
+ pointer-events: ${(props) => (props.$disabled ? 'none' : 'unset')};
86
86
 
87
87
  &:hover {
88
88
  background: ${(props) => props.theme.colors.background.fifth};
@@ -120,7 +120,7 @@ exports.NavDropdownToggle = (0, styled_components_1.default)(icons_1.ArrowUpIcon
120
120
  }
121
121
  `;
122
122
  exports.NotificationsBadge = styled_components_1.default.div `
123
- background-color: ${(props) => props.isOpen
123
+ background-color: ${(props) => props.$isOpen
124
124
  ? props.theme.colors.background.success
125
125
  : props.theme.colors.brand.default};
126
126
  color: ${(props) => props.theme.colors.text.onDark};
@@ -136,13 +136,11 @@ exports.NotificationsBadge = styled_components_1.default.div `
136
136
  padding: 2px;
137
137
  border-radius: 50px;
138
138
  `;
139
- exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.SecondaryButton).attrs((props) => ({
140
- selected: props.isOpen,
141
- })) `
139
+ exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.SecondaryButton) `
142
140
  .inheritColors path {
143
141
  fill: currentColor;
144
142
  stroke: currentColor;
145
143
  }
146
144
  `;
147
- const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
145
+ const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, "$isOpen": isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { "$isOpen": isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
148
146
  exports.NavDropdownButton = NavDropdownButton;
@@ -50,6 +50,6 @@ const inners = {
50
50
  exports.ResizerButton = react_1.default.memo(({ buttonInner, direction, side, isCollapsed = false, isVisible = false, onClick, }) => {
51
51
  const preventMouseDown = (0, react_1.useCallback)((event) => event.preventDefault(), []);
52
52
  const ResizerButtonInner = buttonInner || inners[direction][side];
53
- return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: preventMouseDown, tabIndex: 0 }));
53
+ return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, "$isCollapsed": isCollapsed, "$isVisible": isVisible, onClick: onClick, onMouseDown: preventMouseDown, tabIndex: 0 }));
54
54
  });
55
55
  exports.ResizerButton.displayName = 'ResizerButton';
@@ -31,7 +31,7 @@ const ResizerButtonInner = styled_components_1.default.button `
31
31
  background-color: #ddd;
32
32
  border-radius: ${toggleArrowDepth}px;
33
33
  position: absolute;
34
- opacity: ${(props) => (props.isVisible ? 1 : 0.5)};
34
+ opacity: ${(props) => (props.$isVisible ? 1 : 0.5)};
35
35
  transition: ${transformTransition}, ${opacityTransition};
36
36
  }
37
37
 
@@ -84,10 +84,10 @@ exports.HorizontalEndResizerButtonInner = (0, styled_components_1.default)(Horiz
84
84
  &:hover,
85
85
  &:focus {
86
86
  &::before {
87
- transform: rotate(${(props) => (props.isCollapsed ? '-40deg' : '40deg')});
87
+ transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
88
88
  }
89
89
  &::after {
90
- transform: rotate(${(props) => (props.isCollapsed ? '40deg' : '-40deg')});
90
+ transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
91
91
  }
92
92
  }
93
93
  `;
@@ -102,10 +102,10 @@ exports.HorizontalStartResizerButtonInner = (0, styled_components_1.default)(Hor
102
102
  &:hover,
103
103
  &:focus {
104
104
  &::before {
105
- transform: rotate(${(props) => (props.isCollapsed ? '40deg' : '-40deg')});
105
+ transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
106
106
  }
107
107
  &::after {
108
- transform: rotate(${(props) => (props.isCollapsed ? '-40deg' : '40deg')});
108
+ transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
109
109
  }
110
110
  }
111
111
  `;
@@ -140,10 +140,10 @@ exports.VerticalEndResizerButtonInner = (0, styled_components_1.default)(Vertica
140
140
  &:hover,
141
141
  &:focus {
142
142
  &::before {
143
- transform: rotate(${(props) => (props.isCollapsed ? '40deg' : '-40deg')});
143
+ transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
144
144
  }
145
145
  &::after {
146
- transform: rotate(${(props) => (props.isCollapsed ? '-40deg' : '40deg')});
146
+ transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
147
147
  }
148
148
  }
149
149
  `;
@@ -160,10 +160,10 @@ exports.VerticalStartResizerButtonInner = (0, styled_components_1.default)(Verti
160
160
  &:hover,
161
161
  &:focus {
162
162
  &::before {
163
- transform: rotate(${(props) => (props.isCollapsed ? '-40deg' : '40deg')});
163
+ transform: rotate(${(props) => (props.$isCollapsed ? '-40deg' : '40deg')});
164
164
  }
165
165
  &::after {
166
- transform: rotate(${(props) => (props.isCollapsed ? '40deg' : '-40deg')});
166
+ transform: rotate(${(props) => (props.$isCollapsed ? '40deg' : '-40deg')});
167
167
  }
168
168
  }
169
169
  `;
@@ -42,10 +42,10 @@ const Item = styled_components_1.default.div `
42
42
  display: flex;
43
43
  align-items: center;
44
44
  gap: 4px;
45
- background: ${(props) => (props.disabled ? '#dddcdc' : '#f2f2f2')};
45
+ background: ${(props) => (props.$disabled ? '#dddcdc' : '#f2f2f2')};
46
46
  border-radius: 6px;
47
47
  padding: 4px;
48
- color: ${(props) => props.disabled ? '#707070' : props.theme.colors.text.primary};
48
+ color: ${(props) => props.$disabled ? '#707070' : props.theme.colors.text.primary};
49
49
  font: ${(props) => props.theme.font.weight.normal}
50
50
  ${(props) => props.theme.font.size.small}
51
51
  ${(props) => props.theme.font.family.sans};
@@ -71,7 +71,7 @@ const RemoveButton = styled_components_1.default.button `
71
71
  }
72
72
  `;
73
73
  const SelectedItemsBox = ({ items, onRemove, placeholder = 'No items selected', ...props }) => {
74
- return ((0, jsx_runtime_1.jsx)(BoxContainer, { ...props, children: items.length > 0 ? ((0, jsx_runtime_1.jsx)(ItemsList, { children: items.map((item) => ((0, jsx_runtime_1.jsxs)(Item, { "data-cy": "item", disabled: !!props.disabled, children: [item.label, !props.disabled && ((0, jsx_runtime_1.jsx)(RemoveButton, { onClick: () => onRemove(item.id), "aria-label": `Remove ${item.label}`, children: "x" }))] }, item.id))) })) : ((0, jsx_runtime_1.jsx)(EmptyContainer, { children: (0, jsx_runtime_1.jsx)(Placeholder, { children: placeholder }) })) }));
74
+ return ((0, jsx_runtime_1.jsx)(BoxContainer, { ...props, children: items.length > 0 ? ((0, jsx_runtime_1.jsx)(ItemsList, { children: items.map((item) => ((0, jsx_runtime_1.jsxs)(Item, { "data-cy": "item", "$disabled": !!props.disabled, children: [item.label, !props.disabled && ((0, jsx_runtime_1.jsx)(RemoveButton, { onClick: () => onRemove(item.id), "aria-label": `Remove ${item.label}`, children: "x" }))] }, item.id))) })) : ((0, jsx_runtime_1.jsx)(EmptyContainer, { children: (0, jsx_runtime_1.jsx)(Placeholder, { children: placeholder }) })) }));
75
75
  };
76
76
  exports.SelectedItemsBox = SelectedItemsBox;
77
77
  exports.default = exports.SelectedItemsBox;
@@ -179,8 +179,8 @@ exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton)
179
179
  text-indent: -99999px;
180
180
  z-index: 2;
181
181
 
182
- ::before,
183
- ::after {
182
+ &::before,
183
+ &::after {
184
184
  background-color: ${(props) => props.theme.colors.text.secondary};
185
185
  border-radius: 2px;
186
186
  content: ' ';
@@ -192,7 +192,7 @@ exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton)
192
192
  top: calc(50% - 7px);
193
193
  left: calc(50% - 1px);
194
194
  }
195
- ::after {
195
+ &::after {
196
196
  transform: rotate(45deg);
197
197
  }
198
198
  `;
@@ -242,10 +242,10 @@ exports.ModalCardBody = styled_components_1.default.div `
242
242
  box-sizing: border-box;
243
243
  padding: ${(props) => 6 * props.theme.grid.unit}px;
244
244
  background-color: ${(props) => props.theme.colors.background.primary};
245
- width: ${(props) => props.width
246
- ? typeof props.width === 'number'
247
- ? `${props.width}px`
248
- : props.width
245
+ width: ${(props) => props.$width
246
+ ? typeof props.$width === 'number'
247
+ ? `${props.$width}px`
248
+ : props.$width
249
249
  : '640px'};
250
250
  max-width: 60vw;
251
251
  max-height: 80vh;
@@ -15,19 +15,19 @@ const SystemUserAvatarContainer = styled_components_1.default.div `
15
15
  position: relative;
16
16
  `;
17
17
  const RoundedImage = styled_components_1.default.img `
18
- width: ${(props) => props.size}px;
19
- height: ${(props) => props.size}px;
18
+ width: ${(props) => props.$size}px;
19
+ height: ${(props) => props.$size}px;
20
20
  border-radius: 50%;
21
21
  align-items: center;
22
22
  justify-content: center;
23
23
  `;
24
24
  const StyledAvatar = (0, styled_components_1.default)(icons_1.SystemUserAvatarIcon) `
25
25
  path {
26
- fill: ${(props) => props.color || props.theme.colors.text.secondary};
26
+ fill: ${(props) => props.$color || props.theme.colors.text.secondary};
27
27
  }
28
28
 
29
29
  &:hover path {
30
- fill: ${(props) => props.color || props.theme.colors.text.info};
30
+ fill: ${(props) => props.$color || props.theme.colors.text.info};
31
31
  }
32
32
  `;
33
33
  const Avatar = (props) => {
@@ -35,6 +35,6 @@ const Avatar = (props) => {
35
35
  const handleSrcError = (0, react_1.useCallback)(() => {
36
36
  setSrcError(true);
37
37
  }, []);
38
- return ((0, jsx_runtime_1.jsx)(SystemUserAvatarContainer, { children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, size: props.size, onError: handleSrcError })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, color: props.color })) }));
38
+ return ((0, jsx_runtime_1.jsx)(SystemUserAvatarContainer, { children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
39
39
  };
40
40
  exports.Avatar = Avatar;
@@ -39,7 +39,7 @@ const formik_1 = require("formik");
39
39
  const styled_components_1 = __importStar(require("styled-components"));
40
40
  exports.commonStyles = (0, styled_components_1.css) `
41
41
  border: 1px solid
42
- ${(props) => props.error
42
+ ${(props) => props.$error
43
43
  ? props.theme.colors.border.error
44
44
  : props.theme.colors.border.field.default};
45
45
  border-radius: 3px;
@@ -50,19 +50,19 @@ exports.commonStyles = (0, styled_components_1.css) `
50
50
  line-height: ${(props) => props.theme.font.lineHeight.large};
51
51
  outline: none;
52
52
  padding: ${(props) => {
53
- if (props.variant === 'small') {
53
+ if (props.$variant === 'small') {
54
54
  return '0 12px';
55
55
  }
56
- if (props.variant === 'large') {
56
+ if (props.$variant === 'large') {
57
57
  return '4px 16px';
58
58
  }
59
59
  return '0 12px';
60
60
  }};
61
61
  min-height: ${(props) => {
62
- if (props.variant === 'small') {
62
+ if (props.$variant === 'small') {
63
63
  return '32px';
64
64
  }
65
- if (props.variant === 'large') {
65
+ if (props.$variant === 'large') {
66
66
  return '40px';
67
67
  }
68
68
  return '40px';
@@ -89,13 +89,13 @@ exports.commonStyles = (0, styled_components_1.css) `
89
89
 
90
90
  &:focus:not(:disabled) {
91
91
  border: 2px solid
92
- ${(props) => props.error
92
+ ${(props) => props.$error
93
93
  ? props.theme.colors.border.error
94
94
  : props.theme.colors.brand.default};
95
95
  background-color: #f2fbfc;
96
- ${(props) => props.variant &&
96
+ ${(props) => props.$variant &&
97
97
  (0, styled_components_1.css) `
98
- padding: ${(props) => props.variant === 'small' ? '0 11px' : '3px 15px'};
98
+ padding: ${(props) => props.$variant === 'small' ? '0 11px' : '3px 15px'};
99
99
  `}
100
100
  }
101
101