Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
72373553
Commit
72373553
authored
Jun 19, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change color scheme for indexing alert
parent
46e795fe
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
144 additions
and
44 deletions
+144
-44
Alert.ts
theme/components/Alert.ts
+0
-42
Alert.pw.tsx
theme/components/Alert/Alert.pw.tsx
+46
-0
Alert.ts
theme/components/Alert/Alert.ts
+96
-0
Alert.pw.tsx_dark-color-mode_status-error-dark-mode-1.png
...Alert.pw.tsx_dark-color-mode_status-error-dark-mode-1.png
+0
-0
Alert.pw.tsx_dark-color-mode_status-info-colorScheme-gray-dark-mode-1.png
...k-color-mode_status-info-colorScheme-gray-dark-mode-1.png
+0
-0
Alert.pw.tsx_dark-color-mode_status-info-dark-mode-1.png
.../Alert.pw.tsx_dark-color-mode_status-info-dark-mode-1.png
+0
-0
Alert.pw.tsx_dark-color-mode_status-success-dark-mode-1.png
...ert.pw.tsx_dark-color-mode_status-success-dark-mode-1.png
+0
-0
Alert.pw.tsx_dark-color-mode_status-warning-dark-mode-1.png
...ert.pw.tsx_dark-color-mode_status-warning-dark-mode-1.png
+0
-0
Alert.pw.tsx_default_status-error-dark-mode-1.png
...shots__/Alert.pw.tsx_default_status-error-dark-mode-1.png
+0
-0
Alert.pw.tsx_default_status-info-colorScheme-gray-dark-mode-1.png
....tsx_default_status-info-colorScheme-gray-dark-mode-1.png
+0
-0
Alert.pw.tsx_default_status-info-dark-mode-1.png
...nshots__/Alert.pw.tsx_default_status-info-dark-mode-1.png
+0
-0
Alert.pw.tsx_default_status-success-dark-mode-1.png
...ots__/Alert.pw.tsx_default_status-success-dark-mode-1.png
+0
-0
Alert.pw.tsx_default_status-warning-dark-mode-1.png
...ots__/Alert.pw.tsx_default_status-warning-dark-mode-1.png
+0
-0
index.ts
theme/components/index.ts
+1
-1
IndexingAlert.tsx
ui/home/IndexingAlert.tsx
+1
-1
No files found.
theme/components/Alert.ts
deleted
100644 → 0
View file @
46e795fe
import
{
alertAnatomy
as
parts
}
from
'
@chakra-ui/anatomy
'
;
import
type
{
StyleFunctionProps
}
from
'
@chakra-ui/styled-system
'
;
import
{
createMultiStyleConfigHelpers
}
from
'
@chakra-ui/styled-system
'
;
import
{
getColor
,
mode
,
transparentize
}
from
'
@chakra-ui/theme-tools
'
;
const
{
definePartsStyle
,
defineMultiStyleConfig
}
=
createMultiStyleConfigHelpers
(
parts
.
keys
);
function
getBg
(
props
:
StyleFunctionProps
):
string
{
const
{
theme
,
colorScheme
:
c
}
=
props
;
const
lightBg
=
getColor
(
theme
,
`
${
c
}
.100`
,
c
);
const
darkBg
=
transparentize
(
`
${
c
}
.200`
,
0.16
)(
theme
);
return
mode
(
lightBg
,
darkBg
)(
props
);
}
const
baseStyle
=
definePartsStyle
({
container
:
{
borderRadius
:
'
md
'
,
px
:
6
,
py
:
3
,
},
});
const
variantSubtle
=
definePartsStyle
((
props
)
=>
{
return
{
container
:
{
bgColor
:
getBg
(
props
),
},
};
});
const
variants
=
{
subtle
:
variantSubtle
,
};
const
Alert
=
defineMultiStyleConfig
({
baseStyle
,
variants
,
});
export
default
Alert
;
theme/components/Alert/Alert.pw.tsx
0 → 100644
View file @
72373553
import
type
{
AlertProps
}
from
'
@chakra-ui/react
'
;
import
{
Alert
,
AlertIcon
,
AlertTitle
}
from
'
@chakra-ui/react
'
;
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
TestApp
from
'
playwright/TestApp
'
;
test
.
use
({
viewport
:
{
width
:
400
,
height
:
720
}
});
const
TEST_CASES
:
Array
<
AlertProps
>
=
[
{
status
:
'
info
'
,
},
{
status
:
'
warning
'
,
},
{
status
:
'
success
'
,
},
{
status
:
'
error
'
,
},
{
status
:
'
info
'
,
colorScheme
:
'
gray
'
,
},
];
TEST_CASES
.
forEach
((
props
)
=>
{
const
testName
=
Object
.
entries
(
props
).
map
(([
key
,
value
])
=>
`
${
key
}
=
${
value
}
`
).
join
(
'
,
'
);
test
(
`
${
testName
}
+@dark-mode`
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
Alert
{
...
props
}
>
<
AlertIcon
/>
<
AlertTitle
>
This is alert text
</
AlertTitle
>
</
Alert
>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
});
theme/components/Alert/Alert.ts
0 → 100644
View file @
72373553
import
{
alertAnatomy
as
parts
}
from
'
@chakra-ui/anatomy
'
;
import
type
{
StyleFunctionProps
}
from
'
@chakra-ui/styled-system
'
;
import
{
createMultiStyleConfigHelpers
,
cssVar
}
from
'
@chakra-ui/styled-system
'
;
import
{
transparentize
}
from
'
@chakra-ui/theme-tools
'
;
const
{
definePartsStyle
,
defineMultiStyleConfig
}
=
createMultiStyleConfigHelpers
(
parts
.
keys
);
const
$fg
=
cssVar
(
'
alert-fg
'
);
const
$bg
=
cssVar
(
'
alert-bg
'
);
function
getBg
(
props
:
StyleFunctionProps
)
{
const
{
theme
,
colorScheme
:
c
}
=
props
;
const
darkBg
=
transparentize
(
`
${
c
}
.200`
,
0.16
)(
theme
);
return
{
light
:
`colors.
${
c
}
.100`
,
dark
:
darkBg
,
};
}
const
baseStyle
=
definePartsStyle
({
container
:
{
bg
:
$bg
.
reference
,
px
:
'
4
'
,
py
:
'
3
'
,
},
title
:
{
fontWeight
:
'
bold
'
,
lineHeight
:
'
6
'
,
marginEnd
:
'
2
'
,
},
description
:
{
lineHeight
:
'
6
'
,
},
icon
:
{
color
:
$fg
.
reference
,
flexShrink
:
0
,
marginEnd
:
'
3
'
,
w
:
'
5
'
,
h
:
'
6
'
,
},
spinner
:
{
color
:
$fg
.
reference
,
flexShrink
:
0
,
marginEnd
:
'
3
'
,
w
:
'
5
'
,
h
:
'
5
'
,
},
});
const
variantSubtle
=
definePartsStyle
((
props
)
=>
{
const
{
colorScheme
}
=
props
;
const
bg
=
getBg
(
props
);
return
{
container
:
{
[
$fg
.
variable
]:
colorScheme
===
'
gray
'
?
'
colors.blackAlpha.800
'
:
`colors.
${
colorScheme
}
.500`
,
[
$bg
.
variable
]:
colorScheme
===
'
gray
'
?
'
colors.gray.100
'
:
bg
.
light
,
_dark
:
{
[
$fg
.
variable
]:
colorScheme
===
'
gray
'
?
'
colors.whiteAlpha.800
'
:
`colors.
${
colorScheme
}
.200`
,
[
$bg
.
variable
]:
colorScheme
===
'
gray
'
?
'
colors.gray.800
'
:
bg
.
dark
,
},
},
};
});
const
variantSolid
=
definePartsStyle
((
props
)
=>
{
const
{
colorScheme
:
c
}
=
props
;
return
{
container
:
{
[
$fg
.
variable
]:
`colors.white`
,
[
$bg
.
variable
]:
`colors.
${
c
}
.500`
,
_dark
:
{
[
$fg
.
variable
]:
`colors.gray.900`
,
[
$bg
.
variable
]:
`colors.
${
c
}
.200`
,
},
color
:
$fg
.
reference
,
},
};
});
const
variants
=
{
subtle
:
variantSubtle
,
solid
:
variantSolid
,
};
const
Alert
=
defineMultiStyleConfig
({
baseStyle
,
variants
,
defaultProps
:
{
variant
:
'
subtle
'
,
colorScheme
:
'
blue
'
,
},
});
export
default
Alert
;
theme/components/Alert/__screenshots__/Alert.pw.tsx_dark-color-mode_status-error-dark-mode-1.png
0 → 100644
View file @
72373553
2.3 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_dark-color-mode_status-info-colorScheme-gray-dark-mode-1.png
0 → 100644
View file @
72373553
2.28 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_dark-color-mode_status-info-dark-mode-1.png
0 → 100644
View file @
72373553
2.31 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_dark-color-mode_status-success-dark-mode-1.png
0 → 100644
View file @
72373553
2.35 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_dark-color-mode_status-warning-dark-mode-1.png
0 → 100644
View file @
72373553
2.33 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_default_status-error-dark-mode-1.png
0 → 100644
View file @
72373553
2.25 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_default_status-info-colorScheme-gray-dark-mode-1.png
0 → 100644
View file @
72373553
2.29 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_default_status-info-dark-mode-1.png
0 → 100644
View file @
72373553
2.29 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_default_status-success-dark-mode-1.png
0 → 100644
View file @
72373553
2.35 KB
theme/components/Alert/__screenshots__/Alert.pw.tsx_default_status-warning-dark-mode-1.png
0 → 100644
View file @
72373553
2.23 KB
theme/components/index.ts
View file @
72373553
import
Alert
from
'
./Alert
'
;
import
Alert
from
'
./Alert
/Alert
'
;
import
Badge
from
'
./Badge
'
;
import
Badge
from
'
./Badge
'
;
import
Button
from
'
./Button/Button
'
;
import
Button
from
'
./Button/Button
'
;
import
Checkbox
from
'
./Checkbox
'
;
import
Checkbox
from
'
./Checkbox
'
;
...
...
ui/home/IndexingAlert.tsx
View file @
72373553
...
@@ -97,7 +97,7 @@ const IndexingAlert = ({ className }: { className?: string }) => {
...
@@ -97,7 +97,7 @@ const IndexingAlert = ({ className }: { className?: string }) => {
}
}
return
(
return
(
<
Alert
status=
"
warning"
variant=
"solid
"
py=
{
3
}
borderRadius=
"12px"
mb=
{
6
}
className=
{
className
}
>
<
Alert
status=
"
info"
colorScheme=
"gray
"
py=
{
3
}
borderRadius=
"12px"
mb=
{
6
}
className=
{
className
}
>
{
!
isMobile
&&
<
AlertIcon
/>
}
{
!
isMobile
&&
<
AlertIcon
/>
}
<
AlertTitle
>
<
AlertTitle
>
{
content
}
{
content
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment