cozy-ui 133.0.1 → 134.1.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 +41 -5
- package/assets/icons/ui/planet.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsBar/index.jsx +3 -2
- package/react/BottomSheet/BottomSheet.jsx +4 -2
- package/react/CozyDialogs/SpecificDialogs/Readme.md +0 -58
- package/react/Icon/Readme.md +3 -1
- package/react/Icons/Planet.jsx +12 -0
- package/react/providers/CozyTheme/index.jsx +12 -23
- package/transpiled/react/ActionsBar/index.js +5 -1
- package/transpiled/react/BottomSheet/BottomSheet.js +2 -0
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/Planet.d.ts +2 -0
- package/transpiled/react/Icons/Planet.js +13 -0
- package/transpiled/react/providers/CozyTheme/index.d.ts +3 -4
- package/transpiled/react/providers/CozyTheme/index.js +16 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# [134.1.0](https://github.com/cozy/cozy-ui/compare/v134.0.0...v134.1.0) (2025-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Icon:** Add planet ([e3268b0](https://github.com/cozy/cozy-ui/commit/e3268b0))
|
|
7
|
+
|
|
8
|
+
# [134.0.0](https://github.com/cozy/cozy-ui/compare/v133.0.1...v134.0.0) (2025-11-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ActionsBar:** Theme type wasn't set correctly ([89f4cc7](https://github.com/cozy/cozy-ui/commit/89f4cc7))
|
|
14
|
+
* **BottomSheet:** Theme type wasn't set correctly ([3f5e3e3](https://github.com/cozy/cozy-ui/commit/3f5e3e3))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **CozyTheme:** Rename prop `settingsThemeType` in `type` ([f397f65](https://github.com/cozy/cozy-ui/commit/f397f65))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **CozyTheme:** If you use `import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme'` you must replace `settingsThemeType` prop by `type`. Expl: `<CozyTheme settingsThemeType={}>` becomes `<CozyTheme type={}>`
|
|
25
|
+
|
|
1
26
|
## [133.0.1](https://github.com/cozy/cozy-ui/compare/v133.0.0...v133.0.1) (2025-11-05)
|
|
2
27
|
|
|
3
28
|
|
|
@@ -24,7 +49,18 @@
|
|
|
24
49
|
|
|
25
50
|
* If you use a component in that list, you must import it from `cozy-ui-plus` instead: `AppIcon, AppLinker, AppSections, AppTitle, CipherIcon, ContactPicker, Contacts/AddModal, Contacts/GroupsSelect, Contacts/Header, ContactsList, ContactsListModal, AuthenticationDialogs, Field, FileImageLoader, FilePicker, hooks/useClientErrors, IntentDialogOpener, IntentIframe, Labs/CollectionField, ListItem/ListItemByDoc, ListItem/ListItemBase, ListItem/ListItemContact, ListItem/ListItemFile, Paywall, providers/CozyTheme, providers/Intent, QualificationGrid, QualificationIcon, QualificationItem, QualificationModal, ShortcutTile, SquareAppIcon, Storage, UploadQueue, Wizard`.
|
|
26
51
|
|
|
27
|
-
|
|
52
|
+
You can use this codemods to migrate:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
yarn add cozy-ui-plus
|
|
56
|
+
yarn global add @cozy/codemods
|
|
57
|
+
yarn global add jscodeshift@0.13.1
|
|
58
|
+
jscodeshift -t $(yarn global dir)/node_modules/@cozy/codemods/src/transforms/transform-ui-bc-133.js src babel --ignore-pattern=src/targets/ --extensions js,jsx,tsx --parser tsx
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You probably will need to fix linter issue after that with something like `yarn lint --fix`.
|
|
62
|
+
|
|
63
|
+
* Please note that these components have been completely removed: `deprecated/IntentModal, deprecated/IntentOpener, deprecated/QuotaAlert`
|
|
28
64
|
* If you used `deprecated/ActionMenu/Actions/modif` and `deprecated/ActionMenu/Actions/viewInContacts` please use those in `/ActionsMenu/Actions` instead
|
|
29
65
|
* **BarContextProvider:** If you use `BarContextProvider` you must create it yourself. Take a look to the code to copy/paste
|
|
30
66
|
* **Actions:** You must `import { fetchBlobFileById, isFile } from 'cozy-client/dist/models/file'` and pass it as action's option `makeActions([], { fetchBlobFileById, isFile })` when using `print` action.
|
|
@@ -3052,7 +3088,7 @@ jscodeshift -t $(yarn global dir)/node_modules/@cozy/codemods/src/transforms/tra
|
|
|
3052
3088
|
|
|
3053
3089
|
### BREAKING CHANGES
|
|
3054
3090
|
|
|
3055
|
-
* **Viewer:** The `toolbarProps` attribute from Viewer property has been moved into the `componentsProps` attribute.
|
|
3091
|
+
* **Viewer:** The `toolbarProps` attribute from Viewer property has been moved into the `componentsProps` attribute.
|
|
3056
3092
|
|
|
3057
3093
|
You can use this codemods to migrate. **Don't forget to run js linter after the codemods.**
|
|
3058
3094
|
|
|
@@ -3065,7 +3101,7 @@ jscodeshift -t $(yarn global dir)/node_modules/@cozy/codemods/src/transforms/tra
|
|
|
3065
3101
|
```
|
|
3066
3102
|
|
|
3067
3103
|
You can do this manually by transferring the contents of `toolbarProps` to `componentsProps` under a `toolbarProps` property.
|
|
3068
|
-
* **Viewer:** The `onlyOfficeProps` attribute from Viewer property has been moved into the `componentsProps` attribute.
|
|
3104
|
+
* **Viewer:** The `onlyOfficeProps` attribute from Viewer property has been moved into the `componentsProps` attribute.
|
|
3069
3105
|
|
|
3070
3106
|
You have to move the contents of `onlyOfficeProps ` to `componentsProps` under a `OnlyOfficeViewer` property.
|
|
3071
3107
|
|
|
@@ -3307,7 +3343,7 @@ set to `1`
|
|
|
3307
3343
|
|
|
3308
3344
|
This is the list of impacted components: `MuiCozyTheme/Buttons`, `MuiCozyTheme/MuiBreadcrumbs`, `MuiCozyTheme/Dialog`, `MuiCozyTheme/Accordion`, `MuiCozyTheme/AccordionDetails`, `MuiCozyTheme/AccordionSummary`, `MuiCozyTheme/Divider`, `MuiCozyTheme/Grid`, `MuiCozyTheme/List`, `MuiCozyTheme/ListItem`, `MuiCozyTheme/ListItemIcon`, `MuiCozyTheme/ListItemSecondaryAction`, `MuiCozyTheme/ListSubheader`, `MuiCozyTheme/Menu`, `MuiCozyTheme/Switch`, `MuiCozyTheme/TextField`
|
|
3309
3345
|
|
|
3310
|
-
You can use this codemods to migrate:
|
|
3346
|
+
You can use this codemods to migrate:
|
|
3311
3347
|
|
|
3312
3348
|
```
|
|
3313
3349
|
$ yarn global add @cozy/codemods
|
|
@@ -3328,7 +3364,7 @@ $ jscodeshift -t $(yarn global dir)/node_modules/@cozy/codemods/src/transforms/t
|
|
|
3328
3364
|
* This is the list of deprecated component
|
|
3329
3365
|
`ActionMenu`, `Alerter`, `BottomDrawer`, `Button`, `ButtonAction`, `Chip`, `CompositeRow`, `GridItem`, `Infos`, `InfosCarrousel`, `InlineCard`, `IntentModal`, `IntentOpener`, `Media`, `Menus`, `Modal`, `NarrowContent`, `Overlay`, `PercentageBar`, `PercentageLine`, `PushClientButton`, `QuotaAlert`, `Radio`, `RaisedList`, `ViewStack`
|
|
3330
3366
|
|
|
3331
|
-
These components are now in a `deprecated` subfolder. Use this codemods to migrate:
|
|
3367
|
+
These components are now in a `deprecated` subfolder. Use this codemods to migrate:
|
|
3332
3368
|
|
|
3333
3369
|
```
|
|
3334
3370
|
$ yarn global add @cozy/codemods
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M7.992 0C3.576 0 0 3.584 0 8s3.576 8 7.992 8C12.416 16 16 12.416 16 8s-3.584-8-8.008-8Zm5.544 4.8h-2.36c-.256-1-.624-1.96-1.104-2.848A6.424 6.424 0 0 1 13.536 4.8ZM8 1.632A11.27 11.27 0 0 1 9.528 4.8H6.472A11.27 11.27 0 0 1 8 1.632ZM1.808 9.6A6.594 6.594 0 0 1 1.6 8c0-.552.08-1.088.208-1.6h2.704A13.212 13.212 0 0 0 4.4 8c0 .544.048 1.072.112 1.6H1.808Zm.656 1.6h2.36c.256 1 .624 1.96 1.104 2.848A6.39 6.39 0 0 1 2.464 11.2Zm2.36-6.4h-2.36a6.39 6.39 0 0 1 3.464-2.848A12.52 12.52 0 0 0 4.824 4.8ZM8 14.368A11.27 11.27 0 0 1 6.472 11.2h3.056A11.27 11.27 0 0 1 8 14.368ZM9.872 9.6H6.128A11.77 11.77 0 0 1 6 8c0-.544.056-1.08.128-1.6h3.744C9.944 6.92 10 7.456 10 8s-.056 1.072-.128 1.6Zm.2 4.448a12.52 12.52 0 0 0 1.104-2.848h2.36a6.424 6.424 0 0 1-3.464 2.848ZM11.488 9.6c.064-.528.112-1.056.112-1.6s-.048-1.072-.112-1.6h2.704c.128.512.208 1.048.208 1.6s-.08 1.088-.208 1.6h-2.704Z"/></svg>
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ import DotsIcon from '../Icons/Dots'
|
|
|
18
18
|
import Toolbar from '../Toolbar'
|
|
19
19
|
import Typography from '../Typography'
|
|
20
20
|
import useBreakpoints from '../providers/Breakpoints'
|
|
21
|
-
import CozyTheme from '../providers/CozyTheme'
|
|
21
|
+
import CozyTheme, { useCozyTheme } from '../providers/CozyTheme'
|
|
22
22
|
import { useI18n } from '../providers/I18n'
|
|
23
23
|
import { makeStyles } from '../styles'
|
|
24
24
|
|
|
@@ -111,6 +111,7 @@ const ActionsBar = ({
|
|
|
111
111
|
onClose
|
|
112
112
|
}) => {
|
|
113
113
|
const { isMobile } = useBreakpoints()
|
|
114
|
+
const { type } = useCozyTheme()
|
|
114
115
|
const anchorRef = useRef()
|
|
115
116
|
const [showMenu, setShowMenu] = useState(false)
|
|
116
117
|
const styles = useStyles({ isMobile })
|
|
@@ -137,7 +138,7 @@ const ActionsBar = ({
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
return (
|
|
140
|
-
<CozyTheme variant="inverted">
|
|
141
|
+
<CozyTheme type={type} variant="inverted">
|
|
141
142
|
<AppBar className={styles.appBar} position="fixed" color="inherit">
|
|
142
143
|
<Toolbar
|
|
143
144
|
className={styles.toolbar}
|
|
@@ -436,9 +436,11 @@ BottomSheet.propTypes = {
|
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
const BottomSheetPortal = forwardRef(({ portalProps, ...props }, ref) => {
|
|
439
|
-
const { variant } = useCozyTheme()
|
|
439
|
+
const { type, variant } = useCozyTheme()
|
|
440
440
|
const CozyThemeWrapper = portalProps?.disablePortal ? Fragment : CozyTheme
|
|
441
|
-
const wrapperProps = portalProps?.disablePortal
|
|
441
|
+
const wrapperProps = portalProps?.disablePortal
|
|
442
|
+
? undefined
|
|
443
|
+
: { type, variant }
|
|
442
444
|
|
|
443
445
|
return (
|
|
444
446
|
<Portal {...portalProps}>
|
|
@@ -45,64 +45,6 @@ const [open, setOpen] = useState(isTesting());
|
|
|
45
45
|
</DemoProvider>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
### Authentification dialog
|
|
49
|
-
|
|
50
|
-
Dialog used to authenticate a user in the cozy system. The authentication logic is implemented in the applications.
|
|
51
|
-
|
|
52
|
-
```jsx
|
|
53
|
-
import { AuthentificationDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
54
|
-
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
55
|
-
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
56
|
-
import Variants from 'cozy-ui/docs/components/Variants'
|
|
57
|
-
import FormControlLabel from 'cozy-ui/transpiled/react/FormControlLabel'
|
|
58
|
-
import RadioGroup from 'cozy-ui/transpiled/react/RadioGroup'
|
|
59
|
-
import Radio from 'cozy-ui/transpiled/react/Radios'
|
|
60
|
-
import FormControl from 'cozy-ui/transpiled/react/FormControl'
|
|
61
|
-
import FormLabel from 'cozy-ui/transpiled/react/FormLabel'
|
|
62
|
-
|
|
63
|
-
initialState = { showModal: false };
|
|
64
|
-
|
|
65
|
-
const initialVariants = [{
|
|
66
|
-
closable: true,
|
|
67
|
-
loading: false,
|
|
68
|
-
oidc: false
|
|
69
|
-
}]
|
|
70
|
-
|
|
71
|
-
const initialErrors = [{
|
|
72
|
-
default: true,
|
|
73
|
-
invalid_password: false,
|
|
74
|
-
server_error: false
|
|
75
|
-
}]
|
|
76
|
-
|
|
77
|
-
const onClose = () => setState({ showModal: false })
|
|
78
|
-
|
|
79
|
-
const onAuthentification = () => {
|
|
80
|
-
alert('authentification')
|
|
81
|
-
setState({ showModal: false })
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
<Variants initialVariants={initialVariants}>
|
|
85
|
-
{variant => (
|
|
86
|
-
<Variants initialVariants={initialErrors} radio>
|
|
87
|
-
{error => (
|
|
88
|
-
<DemoProvider>
|
|
89
|
-
<Button label="Open modal" onClick={() => setState({ showModal: true })}/>
|
|
90
|
-
{state.showModal && (
|
|
91
|
-
<AuthentificationDialog
|
|
92
|
-
onSubmit={onAuthentification}
|
|
93
|
-
onClose={variant.closable && onClose}
|
|
94
|
-
error={error.invalid_password ? 'invalid_password' : error.server_error ? 'server_error' : undefined }
|
|
95
|
-
isLoading={variant.loading}
|
|
96
|
-
isOIDC={variant.oidc}
|
|
97
|
-
/>
|
|
98
|
-
)}
|
|
99
|
-
</DemoProvider>
|
|
100
|
-
)}
|
|
101
|
-
</Variants>
|
|
102
|
-
)}
|
|
103
|
-
</Variants>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
48
|
### ShortcutDialog dialog
|
|
107
49
|
|
|
108
50
|
⚠️ Must be used within AlertProvider.
|
package/react/Icon/Readme.md
CHANGED
|
@@ -268,6 +268,7 @@ import PhoneUpload from 'cozy-ui/transpiled/react/Icons/PhoneUpload'
|
|
|
268
268
|
import PieChart from 'cozy-ui/transpiled/react/Icons/PieChart'
|
|
269
269
|
import Pin from 'cozy-ui/transpiled/react/Icons/Pin'
|
|
270
270
|
import Plane from 'cozy-ui/transpiled/react/Icons/Plane'
|
|
271
|
+
import Planet from 'cozy-ui/transpiled/react/Icons/Planet'
|
|
271
272
|
import Plus from 'cozy-ui/transpiled/react/Icons/Plus'
|
|
272
273
|
import PlusSmall from 'cozy-ui/transpiled/react/Icons/PlusSmall'
|
|
273
274
|
import PopInside from 'cozy-ui/transpiled/react/Icons/PopInside'
|
|
@@ -552,6 +553,7 @@ const icons = [
|
|
|
552
553
|
PieChart,
|
|
553
554
|
Pin,
|
|
554
555
|
Plane,
|
|
556
|
+
Planet,
|
|
555
557
|
PlusSmall,
|
|
556
558
|
Plus,
|
|
557
559
|
PopInside,
|
|
@@ -998,7 +1000,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
998
1000
|
|
|
999
1001
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
1000
1002
|
let i = 0
|
|
1001
|
-
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','matrix','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
1003
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','assign-admin','assign-moderator','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud-rainbow','cloud-plus-outlined','cloud','cloud2','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','desktop-download','devices','discuss','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email-open','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder-open','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','key2','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','matrix','merge','moped','mosaic','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','number','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','peoples','percent-circle','percent','person-add','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','planet','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','secutiry','select-all','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
|
|
1002
1004
|
;
|
|
1003
1005
|
|
|
1004
1006
|
<Grid container spacing={2}>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/planet.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgPlanet(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" {...props}>
|
|
7
|
+
<path d="M7.992 0C3.576 0 0 3.584 0 8s3.576 8 7.992 8C12.416 16 16 12.416 16 8s-3.584-8-8.008-8zm5.544 4.8h-2.36c-.256-1-.624-1.96-1.104-2.848A6.424 6.424 0 0113.536 4.8zM8 1.632A11.27 11.27 0 019.528 4.8H6.472A11.27 11.27 0 018 1.632zM1.808 9.6A6.594 6.594 0 011.6 8c0-.552.08-1.088.208-1.6h2.704A13.212 13.212 0 004.4 8c0 .544.048 1.072.112 1.6H1.808zm.656 1.6h2.36c.256 1 .624 1.96 1.104 2.848A6.39 6.39 0 012.464 11.2zm2.36-6.4h-2.36a6.39 6.39 0 013.464-2.848A12.52 12.52 0 004.824 4.8zM8 14.368A11.27 11.27 0 016.472 11.2h3.056A11.27 11.27 0 018 14.368zM9.872 9.6H6.128A11.77 11.77 0 016 8c0-.544.056-1.08.128-1.6h3.744C9.944 6.92 10 7.456 10 8s-.056 1.072-.128 1.6zm.2 4.448a12.52 12.52 0 001.104-2.848h2.36a6.424 6.424 0 01-3.464 2.848zM11.488 9.6c.064-.528.112-1.056.112-1.6s-.048-1.072-.112-1.6h2.704c.128.512.208 1.048.208 1.6s-.08 1.088-.208 1.6h-2.704z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgPlanet
|
|
@@ -10,7 +10,7 @@ import useMediaQuery from '../../hooks/useMediaQuery'
|
|
|
10
10
|
export const CozyThemeContext = createContext()
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean
|
|
13
|
+
* @returns {{ type: 'light'|'dark', variant: 'normal'|'inverted', isLight: boolean }}
|
|
14
14
|
*/
|
|
15
15
|
export const useCozyTheme = () => {
|
|
16
16
|
const context = useContext(CozyThemeContext)
|
|
@@ -31,42 +31,32 @@ export const useCozyTheme = () => {
|
|
|
31
31
|
return context
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const CozyTheme = ({
|
|
35
|
-
variant,
|
|
36
|
-
className,
|
|
37
|
-
ignoreItself,
|
|
38
|
-
settingsThemeType,
|
|
39
|
-
children
|
|
40
|
-
}) => {
|
|
34
|
+
const CozyTheme = ({ type, variant, className, ignoreItself, children }) => {
|
|
41
35
|
const uiThemeType = localStorage.getItem('ui-theme-type') // use only for cozy-ui documentation and argos screenshots
|
|
42
36
|
const uiThemeVariant = localStorage.getItem('ui-theme-variant') // use only for cozy-ui documentation and argos screenshots
|
|
43
37
|
|
|
44
38
|
const deviceThemeType = useMediaQuery('(prefers-color-scheme: dark)')
|
|
45
39
|
? 'dark'
|
|
46
40
|
: 'light'
|
|
47
|
-
const filteredSettingsThemeType = ['light', 'dark'].includes(
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
? settingsThemeType
|
|
41
|
+
const filteredSettingsThemeType = ['light', 'dark'].includes(type)
|
|
42
|
+
? type
|
|
51
43
|
: undefined
|
|
52
44
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const selfThemeVariant = uiThemeVariant || variant
|
|
45
|
+
const _type = uiThemeType || filteredSettingsThemeType || deviceThemeType
|
|
46
|
+
const _variant = uiThemeVariant || variant
|
|
56
47
|
|
|
57
48
|
return (
|
|
58
49
|
<CozyThemeContext.Provider
|
|
59
50
|
value={{
|
|
60
|
-
type:
|
|
61
|
-
variant:
|
|
62
|
-
isLight:
|
|
51
|
+
type: _type,
|
|
52
|
+
variant: _variant,
|
|
53
|
+
isLight: _type === 'light'
|
|
63
54
|
}}
|
|
64
55
|
>
|
|
65
|
-
<MuiCozyTheme type={
|
|
56
|
+
<MuiCozyTheme type={_type} variant={_variant}>
|
|
66
57
|
<div
|
|
67
58
|
className={cx(className, {
|
|
68
|
-
[`TwakeTheme--${
|
|
69
|
-
Boolean(selfThemeVariant),
|
|
59
|
+
[`TwakeTheme--${_type}-${_variant}`]: Boolean(_variant),
|
|
70
60
|
'u-dc': ignoreItself
|
|
71
61
|
})}
|
|
72
62
|
>
|
|
@@ -78,11 +68,10 @@ const CozyTheme = ({
|
|
|
78
68
|
}
|
|
79
69
|
|
|
80
70
|
CozyTheme.propTypes = {
|
|
71
|
+
type: PropTypes.oneOf(['light', 'dark', 'auto']),
|
|
81
72
|
variant: PropTypes.oneOf(['normal', 'inverted']),
|
|
82
73
|
/** Causes this element's children to appear as if they were direct children of the element's parent, ignoring the element itself. */
|
|
83
74
|
ignoreItself: PropTypes.bool,
|
|
84
|
-
/** Theme type from io.cozy.settings.instance */
|
|
85
|
-
settingsThemeType: PropTypes.oneOf(['light', 'dark', 'auto']),
|
|
86
75
|
className: PropTypes.string,
|
|
87
76
|
children: PropTypes.node
|
|
88
77
|
}
|
|
@@ -18,7 +18,7 @@ import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
|
|
|
18
18
|
import Toolbar from "cozy-ui/transpiled/react/Toolbar";
|
|
19
19
|
import Typography from "cozy-ui/transpiled/react/Typography";
|
|
20
20
|
import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
21
|
-
import CozyTheme from "cozy-ui/transpiled/react/providers/CozyTheme";
|
|
21
|
+
import CozyTheme, { useCozyTheme } from "cozy-ui/transpiled/react/providers/CozyTheme";
|
|
22
22
|
import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
23
23
|
import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
24
24
|
var useStyles = makeStyles({
|
|
@@ -121,6 +121,9 @@ var ActionsBar = function ActionsBar(_ref5) {
|
|
|
121
121
|
var _useBreakpoints2 = useBreakpoints(),
|
|
122
122
|
isMobile = _useBreakpoints2.isMobile;
|
|
123
123
|
|
|
124
|
+
var _useCozyTheme = useCozyTheme(),
|
|
125
|
+
type = _useCozyTheme.type;
|
|
126
|
+
|
|
124
127
|
var anchorRef = useRef();
|
|
125
128
|
|
|
126
129
|
var _useState = useState(false),
|
|
@@ -147,6 +150,7 @@ var ActionsBar = function ActionsBar(_ref5) {
|
|
|
147
150
|
};
|
|
148
151
|
|
|
149
152
|
return /*#__PURE__*/React.createElement(CozyTheme, {
|
|
153
|
+
type: type,
|
|
150
154
|
variant: "inverted"
|
|
151
155
|
}, /*#__PURE__*/React.createElement(AppBar, {
|
|
152
156
|
className: styles.appBar,
|
|
@@ -436,10 +436,12 @@ var BottomSheetPortal = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
436
436
|
props = _objectWithoutProperties(_ref4, _excluded);
|
|
437
437
|
|
|
438
438
|
var _useCozyTheme2 = useCozyTheme(),
|
|
439
|
+
type = _useCozyTheme2.type,
|
|
439
440
|
variant = _useCozyTheme2.variant;
|
|
440
441
|
|
|
441
442
|
var CozyThemeWrapper = portalProps !== null && portalProps !== void 0 && portalProps.disablePortal ? Fragment : CozyTheme;
|
|
442
443
|
var wrapperProps = portalProps !== null && portalProps !== void 0 && portalProps.disablePortal ? undefined : {
|
|
444
|
+
type: type,
|
|
443
445
|
variant: variant
|
|
444
446
|
};
|
|
445
447
|
return /*#__PURE__*/React.createElement(Portal, portalProps, /*#__PURE__*/React.createElement(CozyThemeWrapper, wrapperProps, /*#__PURE__*/React.createElement(BottomSheet, _extends({
|