cozy-ui 140.2.0 → 140.3.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 +8 -0
- package/package.json +1 -1
- package/react/ColorList/Readme.md +37 -0
- package/react/ColorList/helpers.js +22 -0
- package/react/ColorList/index.jsx +60 -0
- package/react/ImageList/index.js +3 -0
- package/react/ImageListItem/index.js +3 -0
- package/react/ImageListItemBar/index.js +3 -0
- package/react/index.js +1 -0
- package/skills/cozy-ui-reference/SKILL.md +1 -1
- package/skills/cozy-ui-reference/references/components.md +8 -1
- package/transpiled/react/ColorList/helpers.d.ts +1 -0
- package/transpiled/react/ColorList/helpers.js +2 -0
- package/transpiled/react/ColorList/index.d.ts +16 -0
- package/transpiled/react/ColorList/index.js +58 -0
- package/transpiled/react/ImageList/index.d.ts +2 -0
- package/transpiled/react/ImageList/index.js +2 -0
- package/transpiled/react/ImageListItem/index.d.ts +2 -0
- package/transpiled/react/ImageListItem/index.js +2 -0
- package/transpiled/react/ImageListItemBar/index.d.ts +2 -0
- package/transpiled/react/ImageListItemBar/index.js +2 -0
- package/transpiled/react/index.d.ts +1 -0
- package/transpiled/react/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [140.3.0](https://github.com/cozy/cozy-ui/compare/v140.2.0...v140.3.0) (2026-07-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add ColorList component ([ade8132](https://github.com/cozy/cozy-ui/commit/ade8132))
|
|
7
|
+
* Reexport ImageList, ImageListItem and ImageListItemBar ([7480e4b](https://github.com/cozy/cozy-ui/commit/7480e4b))
|
|
8
|
+
|
|
1
9
|
# [140.2.0](https://github.com/cozy/cozy-ui/compare/v140.1.2...v140.2.0) (2026-07-09)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
```jsx
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import ColorList from 'cozy-ui/transpiled/react/ColorList'
|
|
4
|
+
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
5
|
+
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
6
|
+
import Variants from 'cozy-ui/docs/components/Variants'
|
|
7
|
+
|
|
8
|
+
const initialVariants = [{ medium: false }]
|
|
9
|
+
|
|
10
|
+
const ColorPickerDemo = ({ variant }) => {
|
|
11
|
+
const { isMobile } = useBreakpoints()
|
|
12
|
+
const [selectedColor, setSelectedColor] = useState('')
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ width: (variant.medium || isMobile) ? '100%' : 180 }}>
|
|
16
|
+
<ColorList
|
|
17
|
+
size={variant.medium ? 'medium' : undefined}
|
|
18
|
+
selectedColor={selectedColor}
|
|
19
|
+
onClick={color => {
|
|
20
|
+
console.info('color :', color)
|
|
21
|
+
setSelectedColor(color)
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
;
|
|
29
|
+
|
|
30
|
+
<DemoProvider>
|
|
31
|
+
<Variants initialVariants={initialVariants} screenshotAllVariants>
|
|
32
|
+
{variant => (
|
|
33
|
+
<ColorPickerDemo variant={variant}/>
|
|
34
|
+
)}
|
|
35
|
+
</Variants>
|
|
36
|
+
</DemoProvider>
|
|
37
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const COLORS = [
|
|
2
|
+
'#273891',
|
|
3
|
+
'#7E57E3',
|
|
4
|
+
'#9E83E8',
|
|
5
|
+
'#91CEF6',
|
|
6
|
+
'#2D83FF', // file-folder color, don't remove it
|
|
7
|
+
'#006BD8',
|
|
8
|
+
'#038199',
|
|
9
|
+
'#51B588',
|
|
10
|
+
'#457D6C',
|
|
11
|
+
'#1EBBCC',
|
|
12
|
+
'#E0465C',
|
|
13
|
+
'#ED20A4',
|
|
14
|
+
'#ED768D',
|
|
15
|
+
'#B85B17',
|
|
16
|
+
'#EDA91D',
|
|
17
|
+
'#BA8144',
|
|
18
|
+
'#ED916B',
|
|
19
|
+
'#EDC661',
|
|
20
|
+
'#131326',
|
|
21
|
+
'#646580'
|
|
22
|
+
]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Icon, Check } from '@linagora/twake-icons'
|
|
2
|
+
import propTypes from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import { COLORS } from './helpers'
|
|
6
|
+
import Avatar from '../Avatar'
|
|
7
|
+
import ButtonBase from '../ButtonBase'
|
|
8
|
+
import ImageList from '../ImageList'
|
|
9
|
+
import ImageListItem from '../ImageListItem'
|
|
10
|
+
import { useBreakpoints } from '../providers/Breakpoints'
|
|
11
|
+
|
|
12
|
+
const sizeToPx = {
|
|
13
|
+
small: 21,
|
|
14
|
+
medium: 41
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const ColorList = ({ size, selectedColor, onClick }) => {
|
|
18
|
+
const { isMobile } = useBreakpoints()
|
|
19
|
+
const _size = size || (isMobile ? 'medium' : 'small')
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ImageList
|
|
23
|
+
cols={_size === 'medium' ? 5 : 7}
|
|
24
|
+
rowHeight={sizeToPx[_size]}
|
|
25
|
+
gap={_size === 'medium' ? 16 : 5}
|
|
26
|
+
>
|
|
27
|
+
{COLORS.map(color => (
|
|
28
|
+
<ImageListItem
|
|
29
|
+
key={color}
|
|
30
|
+
className="u-ta-center"
|
|
31
|
+
classes={{ item: 'u-ov-visible' }}
|
|
32
|
+
>
|
|
33
|
+
<ButtonBase
|
|
34
|
+
className="u-bdrs-circle"
|
|
35
|
+
component="div"
|
|
36
|
+
onClick={() => onClick?.(color)}
|
|
37
|
+
>
|
|
38
|
+
<Avatar color={color} size={sizeToPx[_size]}>
|
|
39
|
+
{selectedColor?.toUpperCase() === color ? (
|
|
40
|
+
<Icon icon={Check} size={_size === 'medium' ? 19 : 10} />
|
|
41
|
+
) : (
|
|
42
|
+
' '
|
|
43
|
+
)}
|
|
44
|
+
</Avatar>
|
|
45
|
+
</ButtonBase>
|
|
46
|
+
</ImageListItem>
|
|
47
|
+
))}
|
|
48
|
+
</ImageList>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ColorList.propTypes = {
|
|
53
|
+
size: propTypes.oneOf(['small', 'medium']),
|
|
54
|
+
selectedColor: propTypes.string,
|
|
55
|
+
onClick: propTypes.func
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { COLORS }
|
|
59
|
+
|
|
60
|
+
export default ColorList
|
package/react/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
} from './Nav'
|
|
14
14
|
export { default as ListItemText } from './ListItemText'
|
|
15
15
|
export { default as Spinner } from './Spinner'
|
|
16
|
+
export { default as ColorList } from './ColorList'
|
|
16
17
|
export { default as Accordion } from './Accordion'
|
|
17
18
|
export { default as AccordionSummary } from './AccordionSummary'
|
|
18
19
|
export { default as AccordionDetails } from './AccordionDetails'
|
|
@@ -25,7 +25,7 @@ import 'cozy-ui/transpiled/react/stylesheet.css'
|
|
|
25
25
|
|
|
26
26
|
## What This Skill Provides
|
|
27
27
|
|
|
28
|
-
*
|
|
28
|
+
* 91+ React components with examples and extracted props.
|
|
29
29
|
* CSS utility classes for spacing, typography, colors, layout, and component-specific classes.
|
|
30
30
|
* Cozy theming conventions built on Material-UI v4.
|
|
31
31
|
* Import patterns for `cozy-ui/transpiled/react` and `cozy-ui/dist`.
|
|
@@ -17,7 +17,7 @@ Generated reference for React components available in cozy-ui. Use this file to
|
|
|
17
17
|
- **Utils**: [DropdownText](#dropdowntext), [MuiCozyTheme](#muicozytheme)
|
|
18
18
|
- **Hooks & Providers**: [Breakpoints (providers/Breakpoints)](#breakpoints-providers-breakpoints), [ConfirmDialog (providers/ConfirmDialog)](#confirmdialog-providers-confirmdialog), [CozyTheme (providers/CozyTheme)](#cozytheme-providers-cozytheme), [Selection (providers/Selection)](#selection-providers-selection), [useConfirmExit (hooks/useConfirmExit)](#useconfirmexit-hooks-useconfirmexit)
|
|
19
19
|
- **Labs**: [IconGrid (Labs/IconGrid)](#icongrid-labs-icongrid), [Labs](#labs), [PasswordInput (Labs/PasswordInput)](#passwordinput-labs-passwordinput)
|
|
20
|
-
- **Other**: [Autocomplete](#autocomplete), [BottomSheet](#bottomsheet), [ColorPickerCustom](#colorpickercustom), [providers](#providers)
|
|
20
|
+
- **Other**: [Autocomplete](#autocomplete), [BottomSheet](#bottomsheet), [ColorList](#colorlist), [ColorPickerCustom](#colorpickercustom), [providers](#providers)
|
|
21
21
|
|
|
22
22
|
## Buttons
|
|
23
23
|
|
|
@@ -1824,6 +1824,13 @@ import BottomSheet from 'cozy-ui/transpiled/react/BottomSheet'
|
|
|
1824
1824
|
```
|
|
1825
1825
|
|
|
1826
1826
|
|
|
1827
|
+
### ColorList
|
|
1828
|
+
|
|
1829
|
+
```jsx
|
|
1830
|
+
import ColorList from 'cozy-ui/transpiled/react/ColorList'
|
|
1831
|
+
```
|
|
1832
|
+
|
|
1833
|
+
|
|
1827
1834
|
### ColorPickerCustom
|
|
1828
1835
|
|
|
1829
1836
|
With saturation, hue and hex input for manual input or copy/paste.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COLORS: string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export var COLORS = ['#273891', '#7E57E3', '#9E83E8', '#91CEF6', '#2D83FF', // file-folder color, don't remove it
|
|
2
|
+
'#006BD8', '#038199', '#51B588', '#457D6C', '#1EBBCC', '#E0465C', '#ED20A4', '#ED768D', '#B85B17', '#EDA91D', '#BA8144', '#ED916B', '#EDC661', '#131326', '#646580'];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { COLORS };
|
|
2
|
+
export default ColorList;
|
|
3
|
+
import { COLORS } from "./helpers";
|
|
4
|
+
declare function ColorList({ size, selectedColor, onClick }: {
|
|
5
|
+
size: any;
|
|
6
|
+
selectedColor: any;
|
|
7
|
+
onClick: any;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
declare namespace ColorList {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
const size: propTypes.Requireable<string>;
|
|
12
|
+
const selectedColor: propTypes.Requireable<string>;
|
|
13
|
+
const onClick: propTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
import propTypes_1 from "prop-types";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Icon, Check } from '@linagora/twake-icons';
|
|
2
|
+
import propTypes from 'prop-types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { COLORS } from "cozy-ui/transpiled/react/ColorList/helpers";
|
|
5
|
+
import Avatar from "cozy-ui/transpiled/react/Avatar";
|
|
6
|
+
import ButtonBase from "cozy-ui/transpiled/react/ButtonBase";
|
|
7
|
+
import ImageList from "cozy-ui/transpiled/react/ImageList";
|
|
8
|
+
import ImageListItem from "cozy-ui/transpiled/react/ImageListItem";
|
|
9
|
+
import { useBreakpoints } from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
10
|
+
var sizeToPx = {
|
|
11
|
+
small: 21,
|
|
12
|
+
medium: 41
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var ColorList = function ColorList(_ref) {
|
|
16
|
+
var size = _ref.size,
|
|
17
|
+
selectedColor = _ref.selectedColor,
|
|
18
|
+
_onClick = _ref.onClick;
|
|
19
|
+
|
|
20
|
+
var _useBreakpoints = useBreakpoints(),
|
|
21
|
+
isMobile = _useBreakpoints.isMobile;
|
|
22
|
+
|
|
23
|
+
var _size = size || (isMobile ? 'medium' : 'small');
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(ImageList, {
|
|
26
|
+
cols: _size === 'medium' ? 5 : 7,
|
|
27
|
+
rowHeight: sizeToPx[_size],
|
|
28
|
+
gap: _size === 'medium' ? 16 : 5
|
|
29
|
+
}, COLORS.map(function (color) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(ImageListItem, {
|
|
31
|
+
key: color,
|
|
32
|
+
className: "u-ta-center",
|
|
33
|
+
classes: {
|
|
34
|
+
item: 'u-ov-visible'
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(ButtonBase, {
|
|
37
|
+
className: "u-bdrs-circle",
|
|
38
|
+
component: "div",
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(color);
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
43
|
+
color: color,
|
|
44
|
+
size: sizeToPx[_size]
|
|
45
|
+
}, (selectedColor === null || selectedColor === void 0 ? void 0 : selectedColor.toUpperCase()) === color ? /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
+
icon: Check,
|
|
47
|
+
size: _size === 'medium' ? 19 : 10
|
|
48
|
+
}) : ' ')));
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
ColorList.propTypes = {
|
|
53
|
+
size: propTypes.oneOf(['small', 'medium']),
|
|
54
|
+
selectedColor: propTypes.string,
|
|
55
|
+
onClick: propTypes.func
|
|
56
|
+
};
|
|
57
|
+
export { COLORS };
|
|
58
|
+
export default ColorList;
|
|
@@ -2,6 +2,7 @@ export { default as Badge } from "./Badge";
|
|
|
2
2
|
export { default as Sidebar } from "./Sidebar";
|
|
3
3
|
export { default as ListItemText } from "./ListItemText";
|
|
4
4
|
export { default as Spinner } from "./Spinner";
|
|
5
|
+
export { default as ColorList } from "./ColorList";
|
|
5
6
|
export { default as Accordion } from "./Accordion";
|
|
6
7
|
export { default as AccordionSummary } from "./AccordionSummary";
|
|
7
8
|
export { default as AccordionDetails } from "./AccordionDetails";
|
|
@@ -5,6 +5,7 @@ export { default as Sidebar } from './Sidebar';
|
|
|
5
5
|
export { default as Nav, NavItem, NavIcon, NavText, NavDesktopLimiter, NavLink, genNavLink } from './Nav';
|
|
6
6
|
export { default as ListItemText } from './ListItemText';
|
|
7
7
|
export { default as Spinner } from './Spinner';
|
|
8
|
+
export { default as ColorList } from './ColorList';
|
|
8
9
|
export { default as Accordion } from './Accordion';
|
|
9
10
|
export { default as AccordionSummary } from './AccordionSummary';
|
|
10
11
|
export { default as AccordionDetails } from './AccordionDetails';
|