@linagora/twake-mui 9.15.0 → 9.17.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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ # @linagora/twake-mui [9.17.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.16.0...@linagora/twake-mui@9.17.0) (2026-10-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **twake-mui:** Translate SearchBar clear label in en, fr, ru and vi ([130409a](https://github.com/linagora/twake-ui/commit/130409a03794c3c776c447c671068128c09d8999))
7
+
8
+ # @linagora/twake-mui [9.16.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.15.0...@linagora/twake-mui@9.16.0) (2026-10-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **twake-mui:** Clean old Accordion override ([def3b03](https://github.com/linagora/twake-ui/commit/def3b03479b193a3246e716ae4adc89c4d85cbd2))
14
+ * **twake-mui:** Use theme shadow for Accordion ([97cb9b7](https://github.com/linagora/twake-ui/commit/97cb9b7ce81a61963cf9b3e5aaac615b3da4ae63))
15
+
16
+
17
+ ### Features
18
+
19
+ * **twake-mui:** Migrate Accordion from cozy-ui ([4033f8d](https://github.com/linagora/twake-ui/commit/4033f8dc03f550eed64263a77f9953e63f2572ec))
20
+
1
21
  # @linagora/twake-mui [9.15.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.14.1...@linagora/twake-mui@9.15.0) (2026-09-30)
2
22
 
3
23
 
@@ -3,6 +3,7 @@ import { IconButton } from '@mui/material';
3
3
  import debounce from '@mui/utils/debounce';
4
4
  import cx from 'classnames';
5
5
  import React, { forwardRef, useState, useMemo, useRef, useEffect } from 'react';
6
+ import { useExtendI18n, useI18n } from 'twake-i18n';
6
7
  import { DisableHighlight } from './DisableHighlight';
7
8
  import { FocusHighlight } from './FocusHighlight';
8
9
  import { SearchBarButtonBase } from './SearchBarButtonBase';
@@ -10,7 +11,14 @@ import { SearchBarIconWrapper } from './SearchBarIconWrapper';
10
11
  import { SearchBarInputBase } from './SearchBarInputBase';
11
12
  import { SearchBarRoot } from './SearchBarRoot';
12
13
  import { SearchBarTypography } from './SearchBarTypography';
14
+ import en from './locales/en.json';
15
+ import fr from './locales/fr.json';
16
+ import ru from './locales/ru.json';
17
+ import vi from './locales/vi.json';
18
+ const locales = { en, fr, ru, vi };
13
19
  export const SearchBar = forwardRef(({ placeholder, icon = Magnifier, size = 'small', type = 'search', label, componentsProps, disabledClear = false, disabledFocus = false, disabledHover = false, className, defaultValue = '', value, elevation = 1, disabled = false, onChange = () => { }, onClear = () => { }, onFocus = () => { }, onBlur = () => { }, ...props }, ref) => {
20
+ useExtendI18n(locales);
21
+ const { t } = useI18n();
14
22
  const [currentValue, setCurrentValue] = useState(defaultValue);
15
23
  const [isFocused, setIsFocused] = useState(false);
16
24
  const spreadValue = typeof value !== 'undefined' ? value : currentValue;
@@ -78,7 +86,7 @@ export const SearchBar = forwardRef(({ placeholder, icon = Magnifier, size = 'sm
78
86
  icon && (React.createElement(SearchBarIconWrapper, { className: "SearchBar-icon" },
79
87
  React.createElement(Icon, { icon: icon }))),
80
88
  React.createElement(SearchBarInputBase, { ...componentsProps?.inputBase, className: cx(componentsProps?.inputBase?.className), searchSize: size, hasIcon: !!icon, placeholder: disabled ? undefined : placeholder, value: disabled ? placeholder : spreadValue, disabled: disabled, "aria-label": placeholder || 'Search', onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur }))),
81
- spreadValue && !disabledClear && type === 'search' && !disabled && (React.createElement(IconButton, { size: "small", onClick: handleClear, "aria-label": "Clear search" },
89
+ spreadValue && !disabledClear && type === 'search' && !disabled && (React.createElement(IconButton, { size: "small", onClick: handleClear, "aria-label": t('SearchBar.clear') },
82
90
  React.createElement(Icon, { icon: Cross }))),
83
91
  !disabledHover && !disabled && (React.createElement(FocusHighlight, { className: "SearchBar-focusHighlight" })),
84
92
  disabled && (React.createElement(DisableHighlight, { className: "SearchBar-disableHighlight" }))));
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Clear search"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Effacer la recherche"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Очистить поиск"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Xóa tìm kiếm"
4
+ }
5
+ }
@@ -1,4 +1,5 @@
1
1
  import { Bottom, CheckCircle, CheckSquare, Icon, Info, RadioChecked, RadioUnchecked, Spinner, Warning, WarningCircle } from '@linagora/twake-icons';
2
+ import { accordionSummaryClasses } from '@mui/material/AccordionSummary';
2
3
  import { alertClasses } from '@mui/material/Alert';
3
4
  import { buttonClasses } from '@mui/material/Button';
4
5
  import { checkboxClasses } from '@mui/material/Checkbox';
@@ -924,53 +925,53 @@ export const overrides = {
924
925
  },
925
926
  MuiAccordion: {
926
927
  styleOverrides: {
927
- root: {
928
- '&::before': {
929
- display: 'none'
930
- }
931
- }
928
+ root: ({ theme }) => ({
929
+ boxShadow: theme.vars.shadows[1],
930
+ border: `1px solid ${theme.vars.palette.border.main}`,
931
+ overflow: 'hidden',
932
+ marginBottom: 16,
933
+ '&::before': { display: 'none' }
934
+ }),
935
+ rounded: ({ theme }) => ({ borderRadius: theme.shape.borderRadius })
932
936
  }
933
937
  },
934
938
  MuiAccordionSummary: {
935
939
  defaultProps: { expandIcon: React.createElement(AccordionExpandIcon, null) },
936
940
  styleOverrides: {
937
941
  root: ({ theme }) => ({
938
- backgroundColor: theme.palette.grey[100],
942
+ backgroundColor: theme.vars.palette.background.default,
939
943
  textTransform: 'uppercase',
940
944
  fontWeight: 'bold',
941
- fontSize: '0.875rem',
942
- minHeight: '3.5rem',
945
+ fontSize: theme.typography.pxToRem(14),
946
+ minHeight: 56,
943
947
  padding: 0,
944
- color: theme.palette.text.primary,
945
- '&.Mui-expanded': {
946
- minHeight: '3.5rem'
947
- }
948
+ [`&.${accordionSummaryClasses.expanded}`]: { minHeight: 56 }
948
949
  }),
949
- expandIconWrapper: {
950
- order: 0,
951
- '&&': {
952
- marginLeft: '0.3125rem'
953
- },
950
+ expandIconWrapper: ({ theme }) => ({
951
+ color: theme.vars.palette.text.secondary,
952
+ padding: 12,
953
+ marginLeft: 5,
954
+ marginRight: -12,
954
955
  transform: 'rotate(-90deg)',
955
- '&.Mui-expanded': {
956
- marginLeft: '0.3125rem',
957
- transform: 'rotate(0deg)'
958
- }
959
- },
956
+ [`&.${accordionSummaryClasses.expanded}`]: { transform: 'rotate(0deg)' }
957
+ }),
960
958
  content: {
961
- margin: '0.75rem 0',
962
- paddingLeft: '0.5rem',
963
- paddingRight: '0.25rem',
959
+ paddingLeft: 8,
960
+ paddingRight: 4,
964
961
  order: 1,
965
- '& > :last-child': {
966
- paddingRight: 0
967
- },
968
- '&.Mui-expanded': {
969
- margin: '0.75rem 0'
970
- }
962
+ '& > :last-child': { paddingRight: 0 },
963
+ [`&.${accordionSummaryClasses.expanded}`]: { margin: '12px 0' }
971
964
  }
972
965
  }
973
966
  },
967
+ MuiAccordionDetails: {
968
+ styleOverrides: {
969
+ root: ({ theme }) => ({
970
+ padding: 0,
971
+ borderTop: `1px solid ${theme.vars.palette.border.main}`
972
+ })
973
+ }
974
+ },
974
975
  MuiFab: {
975
976
  defaultProps: { size: 'medium' },
976
977
  styleOverrides: {
@@ -3,5 +3,5 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
3
3
  declare const meta: Meta<typeof Accordion>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Accordion>;
6
- export declare const Docs: Story;
6
+ export declare const Default: Story;
7
7
  export declare const Screenshot: Story;
@@ -4,26 +4,42 @@ const meta = {
4
4
  title: 'Accordion',
5
5
  component: Accordion,
6
6
  parameters: { layout: 'centered' },
7
- tags: ['autodocs']
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ defaultExpanded: { control: 'boolean' },
10
+ disabled: { control: 'boolean' },
11
+ disableGutters: { control: 'boolean' },
12
+ square: { control: 'boolean' }
13
+ }
8
14
  };
9
15
  export default meta;
10
- const AccordionGroup = () => (React.createElement(Stack, { spacing: 2, sx: { width: 400 } },
11
- React.createElement(Accordion, null,
12
- React.createElement(AccordionSummary, null, "Click to expand/collapse the first item"),
13
- React.createElement(AccordionDetails, null,
14
- React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur"))),
15
- React.createElement(Accordion, null,
16
- React.createElement(AccordionSummary, null, "Click to expand/collapse the second item"),
17
- React.createElement(AccordionDetails, null,
18
- React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur"))),
19
- React.createElement(Accordion, null,
20
- React.createElement(AccordionSummary, null, "Click to expand/collapse the third item"),
21
- React.createElement(AccordionDetails, null,
22
- React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur")))));
23
- export const Docs = {
24
- render: () => React.createElement(AccordionGroup, null)
16
+ const Item = ({ label, ...props }) => (React.createElement(Accordion, { ...props },
17
+ React.createElement(AccordionSummary, null,
18
+ "Click to expand/collapse the ",
19
+ label,
20
+ " item"),
21
+ React.createElement(AccordionDetails, null,
22
+ React.createElement(Typography, { sx: { m: 2 } }, "Lorem ipsum dolor sit amet consectetur"))));
23
+ export const Default = {
24
+ render: args => (React.createElement("div", { style: { width: 400, maxWidth: '100%' } },
25
+ React.createElement(Item, { ...args, label: "first" }),
26
+ React.createElement(Item, { ...args, label: "second" }),
27
+ React.createElement(Item, { ...args, label: "third" })))
25
28
  };
29
+ const Section = ({ title, children }) => (React.createElement("section", null,
30
+ React.createElement("h3", { style: { marginBottom: '12px' } }, title),
31
+ children));
32
+ // Visual Regression - Combined view for Argos testing
26
33
  export const Screenshot = {
27
34
  tags: ['argos'],
28
- render: () => React.createElement(AccordionGroup, null)
35
+ render: () => (React.createElement(Stack, { spacing: 4, sx: { width: 400, maxWidth: '100%' } },
36
+ React.createElement(Section, { title: "Default" },
37
+ React.createElement(Item, { label: "first" }),
38
+ React.createElement(Item, { label: "second" }),
39
+ React.createElement(Item, { label: "third" })),
40
+ React.createElement(Section, { title: "Expanded" },
41
+ React.createElement(Item, { label: "first", defaultExpanded: true }),
42
+ React.createElement(Item, { label: "second" })),
43
+ React.createElement(Section, { title: "Disabled" },
44
+ React.createElement(Item, { label: "first", disabled: true }))))
29
45
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "9.15.0",
4
+ "version": "9.17.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",